[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: db_archive: DB_ENV->log_archive: DB_NOTFOUND: No matching key/data pair found



On Wednesday 01 July 2009 12:05:12 Andreas Krummrich wrote:
> Hi Jonathan,
>
> > -----Original Message-----
> > From: openldap-technical-bounces+andreas=krummrich.org@OpenLDAP.org
> > [mailto:openldap-technical-bounces+andreas=krummrich.org@OpenLDAP.org]
> > On Behalf Of Jonathan Clarke
> > Sent: Wednesday, July 01, 2009 11:10 AM
> > To: andreas@krummrich.org
> > Cc: openldap-technical@openldap.org
> > Subject: Re: db_archive: DB_ENV->log_archive: DB_NOTFOUND: No matching
> > key/data pair found
> >
> > Hi Andreas,
> >
> > On 30/06/2009 16:42, Andreas Krummrich wrote:
> > > I'm running OpenLDAP 2.4.11 on a debian lenny box and it seems that
> >
> > I'm
> >
> > > having trouble with the log files. I had a corrupt database some days
> >
> > ago
> >
> > > and needed to restore the database from the backup. The log said:
> > >
> > > Jun 28 01:16:59 old slapd[17374]: bdb_db_open: database
> > > "dc=intern,dc=domain,dc=de" cannot be recovered, err -30978. Restore
> >
> > from
> >
> > > backup!
> > >
> > > So I installed a new OpenLDAP server with the same versions and the
> >
> > same
> >
> > > configuration. The first thing what I found out was that db_archive
> >
> > has some
> >
> > > trouble:
> > >
> > > On the new box I get the following results from db_archive:
> > >
> > > root@new:/var/lib/ldap# db4.2_archive -sa
> > > /var/lib/ldap/cn.bdb
> > > /var/lib/ldap/dn2id.bdb
> > > /var/lib/ldap/gidNumber.bdb
> > > /var/lib/ldap/givenName.bdb
> > > /var/lib/ldap/id2entry.bdb
> > > /var/lib/ldap/loginShell.bdb
> > > /var/lib/ldap/objectClass.bdb
> > > /var/lib/ldap/sn.bdb
> > > /var/lib/ldap/uid.bdb
> > > /var/lib/ldap/uidNumber.bdb
> > > root@new:/var/lib/ldap# db4.2_archive -la
> > > /var/lib/ldap/log.0000000001
> > > root@new:/var/lib/ldap#
> > >
> > > Looks good so far. On the old box I get the following results (there
> >
> > are the
> >
> > > same databases)
> > >
> > > root@new:/var/lib/ldap# db4.2_archive -sa
> > > root@new:/var/lib/ldap# db4.2_archive -la
> > > db_archive: DB_ENV->log_archive: DB_NOTFOUND: No matching key/data
> >
> > pair
> >
> > > found
> > > root@new:/var/lib/ldap#
> >
> > If I understand correctly, your new box works fine, and your old box
> > gives you the error "No matching key/data pair found"? (should be
> > root@old above, then?)
>
> Right.
>
> > Have you restored the database from backup on your old box aswell? This
> > would involve something like rm /var/lib/ldap/* (but save DB_CONFIG),
> > then a slapadd.
>
> Yes, I had to restore the db last weekend. I removed everything under
> /var/lib/ldap and restored the db with slapadd. But the error still exists.
>
> This is what I can see in /var/log/syslog, for example:
>
> Jul  1 11:54:28 old slapd[2169]: <= bdb_dn2id: get failed: DB_NOTFOUND: No
> matching key/data pair found (-30990)
>
> Now one interesting point. I restored the backup from the old box to the
> new box this morning and it works fine there. No errors. Db42_archive works
> well and I can archive and remove the logs.

I am not satisfied that we know how you restored. You should have:

1)(Re)moved all the contents from /var/lib/ldap, except for the DB_CONFIG file, 
including the database environment (__db*), database files (*.bdb), and 
transaction logs (log.*)

2)Run slapadd with the ldif export you had from backup

3)Ensure permissions/ownership are correct on the directory and all the files 
(the user running slapd must have write access to all).

Please tell us what the exact process was that you used to restore.

Regards,
Buchan