FUN WITH LINUX

Debian Jessie: upgrade problems with openldap

15 October 2015

At the moment I am upgrading all my infrastructure. Today I tried to upgrade one of my openldap-slaves and it failed so hard. It stucked during dpkg –configure. In my syslog some errors appeared:

bdb(dc=feedyourhead,dc=at): BDB1538 Program version 5.3 doesn't match environment version 5.1
bdb(dc=feedyourhead,dc=at): BDB1566 txn_checkpoint interface requires an environment configured for the transaction subsystem
bdb_db_close: database "dc=feedyourhead,dc=at": txn_checkpoint failed: Invalid argument (22).
backend_startup_one (type=hdb, suffix="dc=feedyourhead,dc=at"): bi_db_open failed! (-30969)
bdb_db_close: database "dc=feedyourhead,dc=at": alock_close failed

So I was doomed. My ldap was a mess. But I fixed it using the following commands:

cp -r /var/lib/ldap /opt/ldap_backup
cd /var/lib/ldap
db5.1_recover -v -h .
db5.1_upgrade -v -h . *.bdb
db5.1_checkpoint -v -h . -1
/etc/init.d/slapd start

Now I had a working ldap again. But whenever I tried to use apt-get, I got messages like:

slapd (2.4.40+dfsg-1+deb8u1) wird eingerichtet ...
  Backing up /etc/ldap/slapd.d in /var/backups/slapd-2.4.31-2+deb7u1... done.
  Moving old database directories to /var/backups:
  There are leftover files in /var/lib/ldap. This will probably break 
  creating the initial directory. If that's the case please move away
  stuff in there and retry the configuration.
  Loading from /var/backups/slapd-2.4.31-2+deb7u1: 
  Directory /var/lib/ldap for dc=feedyourhead,dc=at not empty, aborting.

Even a “dpkg –configure -a” did not work. I had already fixed the ldap-database, so I could just skip this configure-job. I opened /var/lib/dpkg/info/slapd.postinst and commented the following lines:

# Configuration.
# if is_initial_configuration "$@"; then
# postinst_initial_configuration
# else
# postinst_upgrade_configuration
# fi

I know, it’s a very ugly fix. But it worked for me and I have to say it was a very ugly problem too…

[ OpenLDAP  Debian  ]
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution 3.0 Unported License.

Copyright 2015-present Hoti