Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-05-2010, 01:38 AM
Member
 
Posts: 14
Default slapd fail - (restore backup)

I am trying a restore backup exercise. I want to be prepared in case the production server go down, I can just use the backup to restore the zimbra on another machine right away. However, I do not have an extra machines to be this backup server and I can only setup up a virtual machine on a Xen server. Both the production OS and the backup are running CentOS 5.4. The only different is the the backup OS resides over Xen. The zimbra version is open source version 6.04 and the backup was done using the "[Yet Another Backup Script Community Version]" script.
As soon as I restore the backup on the virtual machine and try to start zimbra, I get the following:

Starting ldap...Done.
Failed.
Failed to start slapd. Attempting debug start to determine error.
hdb_db_open: database "": db_open(/opt/zimbra/data/ldap/hdb/db/id2entry.bdb) failed: Invalid argument (22).
backend_startup_one (type=hdb, suffix=""): bi_db_open failed! (22)
bdb_db_close: database "": alock_close failed

in the log I see

Feb 5 16:03:02 mailserv slapd[18055]: @(#) $OpenLDAP: slapd 2.4.20 (Dec 4 2009 09:09:47) $ build@build11.lab.zimbra.com:/home/build/p4/GNR-604/ThirdParty/openldap/openldap-2.4.20.4z/servers/slapd
Feb 5 16:03:03 mailserv slapd[18055]: bdb(): file id2entry.bdb has LSN 1/8697712, past end of log at 1/8086791
Feb 5 16:03:03 mailserv slapd[18055]: bdb(): Commonly caused by moving a database from one database environment
Feb 5 16:03:03 mailserv slapd[18055]: bdb(): to another without clearing the database LSNs, or by removing all of
Feb 5 16:03:03 mailserv slapd[18055]: bdb(): the log files from a database environment
Feb 5 16:03:03 mailserv slapd[18055]: bdb(): /opt/zimbra/data/ldap/hdb/db/id2entry.bdb: unexpected file type or format
Feb 5 16:03:03 mailserv slapd[18055]: hdb_db_open: database "": db_open(/opt/zimbra/data/ldap/hdb/db/id2entry.bdb) failed: Invalid argument (22).
Feb 5 16:03:03 mailserv slapd[18055]: backend_startup_one (type=hdb, suffix=""): bi_db_open failed! (22)
Feb 5 16:03:03 mailserv slapd[18055]: bdb_db_close: database "": alock_close failed
Feb 5 16:03:03 mailserv slapd[18055]: slapd stopped.


I checked the [SOLVED] LDAP / slapd - Database environment corrupt (Issue & Solution) link but still not able to go it to work. But I notice there mentioned some flag -b have to be done if virtual machine is involved. Would someone be able to enlighten me on that?
Reply With Quote
  #2 (permalink)  
Old 02-05-2010, 01:54 AM
Moderator
 
Posts: 7,928
Default

It may be worth running as root
Code:
/opt/zimbra/libexec/zmfixperms --extended
__________________
Reply With Quote
  #3 (permalink)  
Old 02-05-2010, 05:37 AM
j2b j2b is offline
Special Member
 
Posts: 109
Default

Could it be just as it? Recently encountered the same problem after incorrect server shutdown (hang). The only solution worked for me, was to recover whole zimbra folder with data. Fortunately it was not active server - only LDAP, where registrations didn't take place during last period without backup. Can you seewhy confirm, that this solves your problem?
Reply With Quote
  #4 (permalink)  
Old 02-05-2010, 07:56 AM
Member
 
Posts: 14
Default

Thank you very much for your reply uxbod but it didn't work. From the log, it seems that id2entry.bdb is not in correct format for some reason. Would the LSN have something to do with it? Do I need to reset that some how?
Reply With Quote
  #5 (permalink)  
Old 02-08-2010, 07:03 AM
Member
 
Posts: 14
Default

Okay, I think I got it. I restored from the backup one more time. This time, instead of doing "zmcontrol start" right away, I do:
$ cd /opt/zimbra/data/ldap/hdb/db
$ /opt/zimbra/bdb-4.7.25.4/bin/db_recover -v

then

$ su - zimbra
# zmcontrol start

and YES! It is running. Let me try to restore another backup from the production server that will be generated tonite and see if I can repeat this and I will let you guys know the result.
Reply With Quote
  #6 (permalink)  
Old 11-24-2010, 06:35 PM
Junior Member
 
Posts: 6
Default db_recover doesn't help

I've got a similar issue, but running db_recover doesn't seem to resolve it. Any other suggestions?
Reply With Quote
  #7 (permalink)  
Old 11-24-2010, 11:42 PM
Zimbra Consultant & Moderator
 
Posts: 20,312
Default

How about starting by updating your forum profile with the output of the following command (do not post the output in this thread):

Code:
zmcontrol -v
Quote:
Originally Posted by frogstarr78 View Post
I've got a similar issue, but running db_recover doesn't seem to resolve it. Any other suggestions?
You should also give a description of what exactly happened and some detail of the errors you see in the log files.
__________________
Regards


Bill
Reply With Quote
  #8 (permalink)  
Old 12-24-2010, 06:32 AM
Loyal Member
 
Posts: 93
Default

Im getting the same error after upgrading from ubuntu 8.04 to 10.04 and Zimbra 6.0.8 to 6.0.10:

Code:
	Starting ldap...Done.
Failed.
Failed to start slapd.  Attempting debug start to determine error.
hdb_db_open: database "": db_open(/opt/zimbra/data/ldap/hdb/db/id2entry.bdb) failed: Invalid argument (22).
backend_startup_one (type=hdb, suffix=""): bi_db_open failed! (22)
bdb_db_close: database "": alock_close failed
Ive already ran fixperms and db_recover shows:

Code:
zimbra@wheelie:~/data/ldap/hdb/db$ /opt/zimbra/bdb-4.7.25.4/bin/db_recover -v
Finding last valid log LSN: file: 2 offset 4651260
Recovery starting from [2][4651112]
Recovery complete at Fri Dec 24 08:35:24 2010
Maximum transaction ID 800003aa Recovery checkpoint [2][4651260]
Reply With Quote
  #9 (permalink)  
Old 12-24-2010, 10:03 AM
Loyal Member
 
Posts: 93
Default

GRRRR, i just restored the virtual machine from backup and its getting the same errors.
Reply With Quote
  #10 (permalink)  
Old 04-06-2011, 02:04 AM
Member
 
Posts: 14
Default

Firstly, just want to let you guys know I re-tried a few times doing what I did and the new ZCS come on back every time. The ZCS I am running is still the good old open source 6.0.4 on CENTOS 5.4 over XENServer 5.5 and now with 5.6

MACscr, just curious. Have you tried restoring the machine of the same version of ZCS.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.