slapd package configuration aborts with "Program version 4.7 doesn't match environment version 0.44" error during Hardy -> Lucid upgrade
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openldap (Ubuntu) |
Fix Released
|
High
|
Thierry Carrez | ||
Lucid |
Fix Released
|
High
|
Thierry Carrez |
Bug Description
I am attempting to upgrade my Ubuntu server running Hardy to Lucid, using "do-release-upgrade -d" from the command line.
After the downloaded "lucid" upgrade script churned away for a while, I noticed that the slapd package was aborting during the package configuration.
Here are the applicable lines from the upgrade session:
Preparing to replace ldap-utils 2.4.9-0ubuntu0.
Unpacking replacement ldap-utils ...
Preparing to replace libldap-2.4-2 2.4.9-0ubuntu0.
Unpacking replacement libldap-2.4-2 ...
[...]
Preparing to replace slapd 2.4.9-0ubuntu0.
Stopping OpenLDAP: slapd.
Dumping to /var/backups/
- directory dc=ontko,dc=com... slapcat: Symbol `ldap_int_
done.
Unpacking replacement slapd ...
[...]
Setting up libldap-2.4-2 (2.4.21-0ubuntu1) ...
[...]
Setting up libldap-2.4-2 (2.4.21-0ubuntu1) ...
[...]
Setting up ldap-utils (2.4.21-0ubuntu1) ...
[...]
Setting up slapd (2.4.21-0ubuntu1) ...
Installing new version of config file /etc/ldap/
Installing new version of config file /etc/ldap/
Installing new version of config file /etc/ldap/
Installing new version of config file /etc/ldap/
Installing new version of config file /etc/ldap/
Installing new version of config file /etc/ldap/
Installing new version of config file /etc/ldap/
Installing new version of config file /etc/ldap/
Installing new version of config file /etc/ldap/
Installing new version of config file /etc/ldap/
Installing new version of config file /etc/ldap/
Configuration file `/etc/ldap/
==> File on system created by you or by a script.
==> File also in package provided by package maintainer.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer's version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : background this process to examine the situation
The default action is to keep your current version.
*** ldapns.schema (Y/I/N/O/D/Z) [default=N] ? y
Installing new version of config file /etc/ldap/
Installing new version of config file /etc/apparmor.
Configuration file `/etc/default/
==> Modified (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer's version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : background this process to examine the situation
The default action is to keep your current version.
*** slapd (Y/I/N/O/D/Z) [default=N] ? n
Installing new version of config file /etc/init.d/slapd ...
Backing up /etc/ldap/
failed.
Migrating slapd.conf file (/etc/ldap/
bdb(
hdb_db_open: database "dc=ontko,dc=com" cannot be opened, err -30971. Restore from backup!
backend_
slap_startup failed (test would succeed using the -u switch)
dpkg: error processing slapd (--configure):
subprocess installed post-installation script returned error exit status 1
[...]
Errors were encountered while processing:
slapd
[do-release-upgrade run terminated...]
The do-release-upgrade process continued configuring other packages, but after it completed the "slapd" package is listed as unconfigured; when I tried to configure it manually I got similar errors:
~# dpkg --configure --pending
Setting up slapd (2.4.21-0ubuntu1) ...
Backing up /etc/ldap/
failed.
Migrating slapd.conf file (/etc/ldap/
bdb(
hdb_db_open: database "dc=ontko,dc=com" cannot be opened, err -30971. Restore from backup!
backend_
slap_startup failed (test would succeed using the -u switch)
dpkg: error processing slapd (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
slapd
As it turns out, my do-release-upgrade session was already "planning" to abort due to an non-zero exit status from another package, but I assume this error from the slapd configuration script would also prevent the Hardy -> Lucid upgrade from running to completion.
Related branches
summary: |
- slapd package configuration aborts during Hardy -> Lucid upgrade + slapd package configuration aborts with "Program version 4.7 doesn't + match environment version 0.44" error during Hardy -> Lucid upgrade |
Changed in openldap (Ubuntu Lucid): | |
assignee: | Mathias Gug (mathiaz) → Thierry Carrez (ttx) |
Changed in openldap (Ubuntu Lucid): | |
status: | Triaged → In Progress |
This issue seems to be caused by the fact that the openldap packages switched from using v4.2 to v4.7 of the Berkeley Database libraries, as mentioned in the changelog.Debian.gz file:
openldap (2.4.14-0ubuntu1) jaunty; urgency=low
[...]
* Build against db4.7 instead of db4.2 at last! Closes: #421946.
[...]
-- Mathias Gug <email address hidden> Wed, 18 Feb 2009 18:44:00 -0500
(Since this happened during the Jaunty timeframe, it would make sense that an upgrade from Hardy to Lucid would be affected.)
The best discussion about changing to a new BDB version that I found was an old README.db4.4 that was part of the Debian "subversion" package back in 2006. The document has since been removed from that package, once Subversion started handling the DB conversion automatically, but the text is still available from the source repository for the subversion package: svn.debian. org/wsvn/ pkg-subversion/ src/tags/ 1.4.0-1/ debian/ README. db4.4
http://
The OpenLDAP changelog files and other discussions out on the web imply that slapd normally does automatic "recovery" of the BDB data files, which I understand should transparently take care of situations where the library version has changed.
However, in the case of the Ubuntu package upgrade, the "slaptest" command is getting executed before the new version of "slapd" is run, and (given the error that is occuring) it would appear that "slaptest" does not performat that same automatic recovery operation....
More specifically, the slapd.postinst script is attempting to use the "slaptest" command to migrate the slapd.conf config file to new slapd.d format, but in the case where old-BDB-version database files exist under /var/lib/ldap, that command errors out, thus causing the postinst script to abort.
In my case, I was able to get past this situation by using the commands described in the above-mentioned README.db4.4 file, as follows:
(first, install the db4.2-util package)
# cd /var/lib/ldap
# db4.2_checkpoint -1
# db4.2_recover
# db4.2_archive -d
After that I was able to run a plain "slaptest" command manually without getting the "Program version" error, and when I did another
# dpkg --pending --configure
, the slapd.postinst script's attempt to convert the configuration info was finally successful.
As far as I know there was nothing unusual about my slapd instance and associated data files before the upgrade -- but I don't have any other installation to compare them to, so it's possible that not all Hardy -> Lucid upgrades will trigger this issue. Still, I'm wondering if there is any way that the slapd.postinst script could detected and avoid this situation without requiring manual intervention. (And if not, whether this issue should be mentioned on the Lucid release notes?)