Automatic openldap db migration fails on release upgrade when using nested database directories
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openldap (Ubuntu) |
New
|
Medium
|
Unassigned |
Bug Description
While attempting to perform an upgrade of my home server from Ubuntu 12.04 to Ubuntu 14.04, I received the following error:
=======
Error in function:
A fatal error occurred
Please report this as a bug and include the files
/var/log/
your report. The upgrade has aborted.
Your original sources.list was saved in
/etc/apt/
SystemError: E:Sub-process /usr/bin/dpkg returned an error code (1)
Could not install the upgrades
The upgrade has aborted. Your system could be in an unusable state. A
recovery will run now (dpkg --configure -a).
Setting up slapd (2.4.31-
Backing up /etc/ldap/slapd.d in /var/backups/
Moving old database directories to /var/backups:
Loading from /var/backups/
- directory dc=waveform,
Loading the database from the LDIF dump failed with the following
error while running slapadd:
572f946e olcDbDirectory: value #0: invalid path: No such file or directory
572f946e config error processing olcDatabase=
slapadd: bad configuration directory!
dpkg: error processing package slapd (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
slapd
Upgrade complete
The upgrade has completed but there were errors during the upgrade
process.
=======
Admittedly, it's rather strange for a home server to use LDAP for authentication but I don't have a terribly complex setup: openldap with a fairly normal LDAP layout and SSSD for handling the PAM interface (no kerberos - I did try it in the past but quickly gave it up as too complex to maintain). Hence, I was rather expecting the upgrade to be relatively smooth (as much as server upgrades ever are :).
As requested in the message I'm attaching /var/log/
summary: |
- fatal error while migrating openldap during 12.04 to 14.04 upgrade + Automatic openldap db migration fails on release upgrade when using + accesslog overlay |
Changed in openldap (Ubuntu): | |
importance: | Undecided → Medium |
After a bit of playing around, it appears the root cause was that I'm using the accesslog overlay which necessitates having another database under /var/lib/ ldap/accesslog. The migration process backed up everything under /var/lib/ldap to /var/backups then re-created /var/lib/ldap - but didn't created the "accesslog" directory under it. As a result the attempt to restore the database (presumably with slapadd) failed. After I recreated the /var/lib/ ldap/accesslog directory (with appropriate ownership of openldap:openldap), the database restored successfully.