Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 24

Thread: [SOLVED] LDAP / slapd - Database environment corrupt (Issue & Solution)

  1. #11
    jsilence is offline Intermediate Member
    Join Date
    Jan 2008
    Posts
    16
    Rep Power
    7

    Default Addition

    I have to add, that I can db_recover the oldish backup:
    Code:
    zimbra@zimbra:~$ tar xfj openldap-data-20080830.tbz 
    zimbra@zimbra:~$ cd openldap-data
    zimbra@zimbra:~/openldap-data$ /opt/zimbra/sleepycat/bin/db_recover -c
    zimbra@zimbra:~/openldap-data$ /opt/zimbra/sleepycat/bin/db_recover   
    zimbra@zimbra:~/openldap-data$ ls logs/
    log.0000000228  log.0000000229
    But after a while the ldap seems to write the next log file (log.0000000191) and chokes on that one afterwards. Maybe because of different versions of the BDB database.

    However, I'm lost.

    -jsl

  2. #12
    quanah is offline Zimbra Employee
    Join Date
    May 2007
    Location
    Zimbra
    Posts
    1,285
    Rep Power
    10

    Default

    Quote Originally Posted by jsilence View Post
    Code:
    Sep  8 09:06:02 zimbra slapd[4207]: bdb(): Ignoring log file: /opt/zimbra/openldap-data/logs/log.0000000191: magic number 0, not 40988 
    Sep  8 09:06:02 zimbra slapd[4207]: bdb(): Invalid log file: log.0000000191: Invalid argument 
    Sep  8 09:06:02 zimbra slapd[4207]: bdb(): First log record not found 
    Sep  8 09:06:02 zimbra slapd[4207]: bdb(): PANIC: Invalid argument 
    Sep  8 09:06:02 zimbra slapd[4207]: bdb_db_open: Database cannot be recovered, err -30978. Restore from backup! 
    Sep  8 09:06:02 zimbra slapd[4207]: bdb(): DB_ENV->lock_id_free interface requires an environment configured for the locking subsystem 
    Sep  8 09:06:02 zimbra slapd[4207]: bdb(): txn_checkpoint interface requires an environment configured for the transaction subsystem 
    Sep  8 09:06:02 zimbra slapd[4207]: bdb_db_close: txn_checkpoint failed: Invalid argument (22) 
    Sep  8 09:06:02 zimbra slapd[4207]: backend_startup_one: bi_db_open failed! (-30978) 
    Sep  8 09:06:02 zimbra slapd[4207]: bdb_db_close: alock_close failed 
    Sep  8 09:06:02 zimbra slapd[4207]: slapd stopped.
    Are you using a VM such as Xen instead of real hardware?

    And yes, you must use
    Code:
    -b ''
    as part of your slapadd command.
    Quanah Gibson-Mount
    Server Architect
    Zimbra, Inc
    --------------------
    Zimbra :: the leader in open source messaging and collaboration

  3. #13
    jsilence is offline Intermediate Member
    Join Date
    Jan 2008
    Posts
    16
    Rep Power
    7

    Default VMWare

    Yes I am running Zimbra in a VMWare virtual Machine. Ubuntu JeOS on a VMWare Server 1.0.4. So far it was running pretty smooth.

    I will try -b '' tonight and report.

    Thanks,

    -jsl

  4. #14
    jsilence is offline Intermediate Member
    Join Date
    Jan 2008
    Posts
    16
    Rep Power
    7

    Default Maybe solved

    Up until now, starting from my latest recuing attempt, the system is running smoothly.

    After a restore from the oldish backup, including slapadd action with the latest ldif dump, I did a 'db_upgrade' in the openldap-data directory. It came back without any output, but I have the impression, that this did the trick for me.

    Keeping my fingers crossed, thanks for helping...

    -jsl

  5. #15
    ipguru99 is offline Active Member
    Join Date
    Jun 2006
    Posts
    32
    Rep Power
    9

    Default Forums saved my ldap after power loss!

    I just keep having customers do 'customer' stuff... and then I visit the forums to figure out what they have 'customer'd' up! This was also a power loss. I followed everything and this is what happened..

    1. # su - zimbra
    2. $ ldap stop
    3. $ cd /opt/zimbra/openldap-data
    4. $ /opt/zimbra/sleepycat/bin/db_recover
    ... Still get all the Panic stuff
    Then...
    1. # su - zimbra
    2. $ ldap stop
    3. $ exit
    4. # mv /opt/zimbra/openldap-data /opt/zimbra/openldap-01-19-2009-crash
    5. # mkdir /opt/zimbra/openldap-data
    6. # cp /opt/zimbra/openldap-data-01-19-2009-crash/DB_CONFIG /opt/zimbra/openldap-data/DB_CONFIG
    7. # chown -R zimbra:zimbra /opt/zimbra/openldap-data
    8. # su - zimbra
    9. $ ~/openldap/sbin/slapadd -w -q -f ~/conf/slapd.conf -l /opt/zimbra/backup/sessions/incr-20090118.xx.x.x.x.x./ldap.bak
    10. $ ~/openldap/sbin/slapindex -f ~/conf/slapd.conf
    11. $ ldap start

    This still didn't work..

    So, now that I know exactly where the backup stuff is (because of step 9) and thinking that I was not far away from having to copy that backup data and wipe this box, I copied the stuff in /opt/zimbra/backup/sessions/incr-20090118.xxx.xxx/ldap/ (file path was a little different from the example.. and I can't remember the version they were on). Basically, I copied the db directory (which was empty) from the crashed copy and I copied the logs dir from the crashed copy.. both went into the newly populated /opt/zimbra/openldap-data directory. I did number 7 again.. then I did the below

    1. cd /opt/zimbra/openldap-data
    2. e/opt/zimbra/sleepycat/bin/db_recover

    Which is exactly what I did to begin with. Then...
    zmcontrol start
    .. and it worked...

    So I basically made sure my old ldap-data directory was out of the way.. used these commands (lines 5-10) to get as much fresh.. get the rest from backups and it worked..

    It was a little different than spelled out.. so I thought I would share.

    Thanks to everyone that jumps in the forums and writes all this stuff down!
    Last edited by ipguru99; 02-14-2009 at 04:06 PM. Reason: sleep deprivation -- customer did it again and I had to look at this.. and I couldn't even figure out what I wrote..

  6. #16
    greenrenault's Avatar
    greenrenault is offline Partner (VAR/HSP)
    Join Date
    Jul 2006
    Location
    Australia, ACT
    Posts
    197
    Rep Power
    9

    Default

    Well done and a special blessing to all those customers (that keep us employed).

  7. #17
    quanah is offline Zimbra Employee
    Join Date
    May 2007
    Location
    Zimbra
    Posts
    1,285
    Rep Power
    10

    Default

    Was this a master server rather than a replica? What release?
    Quanah Gibson-Mount
    Server Architect
    Zimbra, Inc
    --------------------
    Zimbra :: the leader in open source messaging and collaboration

  8. #18
    ipguru99 is offline Active Member
    Join Date
    Jun 2006
    Posts
    32
    Rep Power
    9

    Default

    Release 5.0.5_GA_2201.UBUNTU6 UBUNTU6 NETWORK edition

    Just a single server...

  9. #19
    saresca is offline New Member
    Join Date
    Jan 2007
    Posts
    3
    Rep Power
    8

    Default db_recover not working.

    Someone knows what to do if db_recover doesn't work.

    The problem is that the server configuration cn=mx01.xxxxx.com,cn=servers,cn=zimbra registry is truncated. I tried to modify or delete it using ldapmodify but I'm getting the following error:

    deleting entry "cn=mx01.xxxxx.com,cn=servers,cn=zimbra"
    ldapmodify: Internal (implementation specific) error (80)
    additional info: internal error

    The database has corrupted after a power fail. Trying to cat ldap db I'm gettint:

    Code:
    openldap/sbin/slapcat -f /opt/zimbra/conf/slapd.conf
    entry_header: attribute count was zero

    I could cat (not everything) doing

    Code:
    ldapsearch -h localhost -x -D "uid=zimbra,cn=admins,cn=zimbra" -w password
    I will appreciate any kind of idea.

  10. #20
    tiger2000 is offline Elite Member
    Join Date
    May 2008
    Location
    Taiwan
    Posts
    296
    Rep Power
    7

    Default rebuild ldap data (in OSS edition?)

    Dear all,

    just read another article about DB recovery from :

    [SOLVED] LDAP / slapd - Database environment corrupt (Issue & Solution)

    and i'm wondering if these steps also work in open source edition, since it use the ldap.bak from NE edition's daily backup?

    any advice on this? Thanks.

    Code:
    # su - zimbra
    $ ldap stop
    $ exit
    # mv /opt/zimbra/openldap-data /opt/zimbra/openldap-data-0704-crash
    # mkdir /opt/zimbra/openldap-data
    # cp /opt/zimbra/openldap-data-0704-crash/DB_CONFIG /opt/zimbra/openldap-data/DB_CONFIG
    # chown -R zimbra:zimbra /opt/zimbra/openldap-data
    # su - zimbra
    $ ~/openldap/sbin/slapadd -w -q -f ~/conf/slapd.conf -l /opt/zimbra/backup/ldap/incr-20070704.080005.554/ldap.bak
    $ ~/openldap/sbin/slapindex -f ~/conf/slapd.conf
    $ ldap start

Page 2 of 3 FirstFirst 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. LDAP Cannot bind on migration to new server
    By neekster in forum Migration
    Replies: 23
    Last Post: 03-09-2009, 02:08 AM
  2. Replies: 8
    Last Post: 08-07-2008, 05:18 AM
  3. Upgrade: 4.5.5 -> 4.5.6 failed, LDAP/slapd issues
    By Daimyo in forum Installation
    Replies: 7
    Last Post: 08-04-2007, 09:23 PM
  4. Bad 5.0b2 upgrade
    By JoshuaPrismon in forum Installation
    Replies: 1
    Last Post: 07-26-2007, 07:34 PM
  5. 3 testing: LDAP: 389 Failed when restore zimbra
    By victorLeong in forum Administrators
    Replies: 15
    Last Post: 05-24-2007, 06:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •