You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Mac OS Server Open Directory Will Not Turn On

Yesterday I got the server application for Mac OS Mountain Lion. This is my first time working with apple server software and when I try to turn on Open Directory it says:


An Error occured on the server while processing a command.

The error occurred while processing a command of type 'setState' in plug-in 'servermgr_dirserv'.


I am not sure what is causing this. I am running the server on a 2010 iMac with Mountain Lion installed and I couldn't find any answers online. Any help would be much appriciated.



Edit: I would be willing to reinstall the server software and reset settings for it if I have to. (I just don't know how)

Mac OS Server-OTHER, OS X Server

Posted on Jul 28, 2012 7:32 AM

Reply
37 replies

Oct 15, 2012 8:21 AM in response to francisfromhavertown

Check this to repair the database, it worked perfectly for me (yes 10.8.2 screwed the openldap db for me)

http://www.prestonlee.com/2009/07/08/recovering-a-corrupt-openldap-database-on-o sx-server/


1. check if this is the problem

$ sudo /usr/libexec/slapd -Tt

2. may be backup openldap db and try repairing

$ sudo db_recover -h /var/db/openldap/openldap-data/

3. check if things were repaired correctly

$ sudo /usr/libexec/slapd -Tt

4. restart the service

Jan 8, 2013 8:05 PM in response to _Franck_

Hello!


$ sudo /usr/libexec/slapd -Tt


gives


50ecebcf olcDbDirectory: value #0: invalid path: No such file or directory

50ecebcf config error processing olcDatabase={1}bdb,cn=config: olcDbDirectory: value #0: invalid path: No such file or directory

slaptest: bad configuration file!


Open Directory was the #1 reason I wanted to use the Server, and it's very disappointing that it stopped working only after a few days.

Jan 9, 2013 7:57 PM in response to _Franck_

Thanks Frank,


After the permission repair and sudo /usr/libexec/slapd -Tt this is what I see:


50ee3ba8 bdb_monitor_db_open: monitoring disabled; configure monitor database to enable

50ee3ba8 bdb(cn=authdata): file id2entry.bdb has LSN 1/9422729, past end of log at 1/9068158

50ee3ba8 bdb(cn=authdata): Commonly caused by moving a database from one database environment

50ee3ba8 bdb(cn=authdata): to another without clearing the database LSNs, or by removing all of

50ee3ba8 bdb(cn=authdata): the log files from a database environment

50ee3ba8 bdb(cn=authdata): /var/db/openldap/authdata/id2entry.bdb: unexpected file type or format

50ee3ba8 bdb_db_open: database "cn=authdata": db_open(/var/db/openldap/authdata/id2entry.bdb) failed: Invalid argument (22).

50ee3ba8 backend_startup_one (type=bdb, suffix="cn=authdata"): bi_db_open failed! (22)

slap_startup failed (test would succeed using the -u switch)


I've googled my error messages, too, but only thing that came up for me was this thread, and nothing that I thought was very relevant...

Feb 18, 2013 8:10 AM in response to graced.info

Same issue here:


truffula:~ admin$ sudo /usr/libexec/slapd -Tt

51225150 bdb_monitor_db_open: monitoring disabled; configure monitor database to enable

51225150 bdb(cn=authdata): file id2entry.bdb has LSN 15/5271406, past end of log at 15/4833906

51225150 bdb(cn=authdata): Commonly caused by moving a database from one database environment

51225150 bdb(cn=authdata): to another without clearing the database LSNs, or by removing all of

51225150 bdb(cn=authdata): the log files from a database environment

51225150 bdb(cn=authdata): /var/db/openldap/authdata/id2entry.bdb: unexpected file type or format

51225150 bdb_db_open: database "cn=authdata": db_open(/var/db/openldap/authdata/id2entry.bdb) failed: Invalid argument (22).

51225150 backend_startup_one (type=bdb, suffix="cn=authdata"): bi_db_open failed! (22)

slap_startup failed (test would succeed using the -u switch)

Jun 6, 2013 11:42 AM in response to _Franck_

Thanks _Franck_!


I had to do a few more steps than and modify the recover command based on info from Case #2 - http://www.iredmail.org/forum/topic3694-iredmail-support-power-cut-ldap-dont-sta rt.html


1. check if this is the problem

$ sudo /usr/libexec/slapd -Tt

>> bdb_db_open: database "cn=authdata": db_open(/var/db/openldap/authdata/id2entry.bdb) failed: Invalid argument (22).

2. Stop LDAP on OD Master

$ sudo launchctl unload /System/Library/LaunchDaemons/org.openldap.slapd.plist

3. Repair Permissions

$ diskutil repairPermissions /

4. backup openldap db

$ sudo cp /var/db/openldap/authdata/id2entry.bdb /var/db/openldap/authdata/id2entry.bdb.backup

5. repair

$ sudo db_recover -cv -h /var/db/openldap/openldap-data/

>> Recovery complete at Thu Jun 6 11:01:35 2013

>> Maximum transaction ID 8000060e Recovery checkpoint [2][6589846]

6. run repair again to check

$ sudo db_recover -cv -h /var/db/openldap/openldap-data/

>> Finding last valid log LSN: file: 2 offset 6589938

>> Recovery starting from [1][28]

>> Recovery complete at Thu Jun 6 11:02:32 2013

>> Maximum transaction ID 8000060e Recovery checkpoint [2][6589938]

7. double check if things were repaired correctly

$ sudo /usr/libexec/slapd -Tt

>> bdb_monitor_db_open: monitoring disabled; configure monitor database to enable

config file testing succeeded

8. restart the service

$ sudo launchctl load /System/Library/LaunchDaemons/org.openldap.slapd.plist

Sep 24, 2013 9:11 AM in response to francisfromhavertown

I have the same Problem, i try the 8. steps of neocodesoftware from above, but they doesn't help me.

The command:

sudo /usr/libexec/slapd -Tt

always show this Error:

bdb_db_open: database "cn=authdata": db_open(/var/db/openldap/authdata/id2entry.bdb) failed: Invalid argument (22)

Then after the step 7. from neocodesoftware i also repaired the openldap/auth-data with this repair command:


sudo db_recover -cv -h /var/db/openldap/authdata/


then i restart the service with step 8. from above

sudo launchctl load /System/Library/LaunchDaemons/org.openldap.slapd.plist


and now my Open Directory came back to Live

Mac OS Server Open Directory Will Not Turn On

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.