[Pkg-openldap-devel] Bug#595672: Upgrading slapd from 2.4.17-2.1 to 2.4.23-4 can fail due to database issues

Steve Langasek vorlon at debian.org
Sun Sep 5 21:11:06 UTC 2010


On Sun, Sep 05, 2010 at 06:02:23PM +0100, Jamie Thompson wrote:
> I just upgraded slapd, and was left with a broken installation (until I
> fixed it manually that is).

> Here's the output:
> > Setting up slapd (2.4.23-4) ...
<snip>
> >   Backing up /etc/ldap/slapd.conf in /var/backups/slapd-2.4.17-2.1... done.
> >   Moving old database directories to /var/backups:
> >   Loading from /var/backups/slapd-2.4.17-2.1:
> >   Migrating slapd.conf to slapd.d configuration style... failed.

> > Migrating slapd.conf file (/etc/ldap/slapd.conf) to slapd.d failed with the following
> > error while running slaptest:
> >     bdb(dc=.): Program version 4.8 doesn't match environment version 4.7
> >     hdb_db_open: database "dc=." cannot be opened, err -30971. Restore from backup!
> >     backend_startup_one (type=hdb, suffix="dc=."): bi_db_open failed! (-30971)
> >     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

> My first line of enquiry was to fix the files and upgrade them manually. I
> made a backup and tried running...
> > db4.7_checkpoint -1
> ...on the directory. It informed me that the file log.0000000026 had an
> invalid version (16?), and that I shoudl run databse recovery. Which I was
> already doing, but go figure.  I then ran db4.7_recover on the directory,
> and got the same message.

> I don't update my diretory with mission-critical entries very often
> (normal updates are just DHCP-invoked updates, mainly), so I tried
> deleting the problematic log file and trying again, and was successful
> this time.  I then restarted the slapd upgrade (via apt-get install), and
> the process completed successfully.

> I still have the backups of my ldap directory if that helps.

It may be that we want the slapd.d migration to call slaptest with -u, to
ignore any such problems that aren't related to the slapd.d migration per
se.  But I don't understand the origin of this error either, so we should
get to the bottom of this.  What was the location of this log.0000000026
that you had to delete?  The log clearly shows a dump and restore of the
databases, so there should not have been any remaining files from db4.7
present there.

Can you attach a copy of /var/backups/slapd-2.4.17-2.1/slapd.conf (sanitized
to remove any sensitive information, of course)?  Specifically, I would like
to see the database/suffix/directory configs from this file, but the more
context you can provide the more likely this will be reproducible.  The
directory slaptest complains about, 'dc=.', doesn't appear to match the
information in the debconf settings for the package.

Is there any chance that the old slapd process was still running and writing
to this directory while the upgrade was under way?  That would explain files
appearing in a location that was supposed to have been cleaned out shortly
before.

Actually, looking more closely, there appear to be several lines missing
from your upgrade log.  The expected output looks like:

  Backing up /etc/ldap/slapd.conf in /var/backups/slapd-2.4.11-1... done.
  Moving old database directories to /var/backups:
  - directory dc=dodds,dc=net... done.
  Loading from /var/backups/slapd-2.4.11-1: 
  - directory dc=dodds,dc=net... done.
  - chowning database directory (openldap:openldap)... done
  Migrating slapd.conf to slapd.d configuration style... done.

I.e., a line of output for each directory that's backed up and restored. 
Have you edited the output from the upgrade log to conceal details, or has
it really not done anything with your directories here?  The slapd.conf
should help us answer this.

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek at ubuntu.com                                     vorlon at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-openldap-devel/attachments/20100905/be399a61/attachment.pgp>


More information about the Pkg-openldap-devel mailing list