Recently a customer reported that he was unable to add new users to his OS X 10.8 Server. To be precise, he was even unable to login as diradmin to his local OpenDirectory master.
Each login attempted created the following error message:
servermgrd: servermgr_accounts: got error 2100 trying to auth to local LDAP node
After ruling out all the common issues like discussed in “Why Is My OD LDAP Server Stopped & How To Fix It” it was time to move over to the dark side. In this case, one had to know that the auth database of the OD server itself is stored as a Berkeley DB in /var/db/openldap/authdata and that it is most likely damaged. Based on that (and after creating a backup) we can now use db_recover to repair it with the following commands:
sudo serveradmin stop dirserv sudo db_recover -h /var/db/openldap/authdata sudo serveradmin start dirserv
After a few seconds you should be able to login as diradmin again.