+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
Mac Thread, Open Directory Problem in Technical; Hi all, Bit of a head scratcher here. A few days before half term we had to shut down all ...
  1. #1

    Join Date
    Jul 2011
    Location
    Essex
    Posts
    210
    Thank Post
    22
    Thanked 34 Times in 29 Posts
    Rep Power
    25

    Open Directory Problem

    Hi all,

    Bit of a head scratcher here. A few days before half term we had to shut down all servers due to air con failing. For reasons i'm unaware of our mac server was not shutdown before the power switch was hit. The next morning our macs would not let anybody log in, not even admins, so after a few restarts of the server this seemed to rectify itself. All was working right up until easter, so back I came after a 2 week holiday to find that nobody can log into our macs yet again, only this time admin users are able to log in, but not students/teaching staff etc. The strange thing is our ODadmin account seems to have just been wiped off the face of the earth, the home directory for it still exists, but it doesn't now show up in Sys Prefs > Users. Can't log in to it either, which means I also cannot log into WGM and authenticate to LDAP.. So I can't do much at the moment! I have attached the error WGM throws at me when trying to authenticate with the correct credentials to LDAP:

    WGM Error.png

    This is also thrown at me when trying to go into Server Prefs:

    Open direct error.png

    Any ideas?!

    EDIT: We're using 10.7.3 clients and 10.6.8 server.
    Last edited by SC92; 17th April 2012 at 12:09 PM. Reason: info

  2. #2
    JR-PCS's Avatar
    Join Date
    Apr 2012
    Posts
    91
    Thank Post
    3
    Thanked 19 Times in 18 Posts
    Rep Power
    11
    Looks like your Open Directory DB has corrupted. You need to unload slapd, run db_recover and then load slapd. If your unsure how to do this, or a bit worried of making it worse it might be worth getting an apple solutions expert or consultant, like me ;-) to fix it for you.

  3. #3

    Join Date
    Jul 2011
    Location
    Essex
    Posts
    210
    Thank Post
    22
    Thanked 34 Times in 29 Posts
    Rep Power
    25
    Hi JR-PCS, thanks for the reply. Are there any guides out there on doing this? I'm not really all that worried about making it worse, as it currently can't get that much worse as nothing is working at the moment!

  4. #4
    JR-PCS's Avatar
    Join Date
    Apr 2012
    Posts
    91
    Thank Post
    3
    Thanked 19 Times in 18 Posts
    Rep Power
    11
    Run these commands from terminal.

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

    sudo /usr/bin/db_recover -h /var/db/openldap/openldap-data

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

  5. #5

    Join Date
    Jul 2011
    Location
    Essex
    Posts
    210
    Thank Post
    22
    Thanked 34 Times in 29 Posts
    Rep Power
    25
    I get an error from terminal after trying to run the first one; 'launchctl: Error unloading: org.openldap.slapd'.

    Sam

  6. #6
    JR-PCS's Avatar
    Join Date
    Apr 2012
    Posts
    91
    Thank Post
    3
    Thanked 19 Times in 18 Posts
    Rep Power
    11
    try the other two commands, as it might be that slapd is not loaded.

  7. #7

    Join Date
    Jul 2011
    Location
    Essex
    Posts
    210
    Thank Post
    22
    Thanked 34 Times in 29 Posts
    Rep Power
    25
    I'm able to run the last command, which successfully loads org.openldap.slapd it seems, but then running the second command after that gives me:

    db_recover: checkpoint LSN record [785] [6635693] not found
    db_recover: PANIC: DB_NOTFOUND: No matching key/data pair found
    db_recover: DB_ENV->open: DB_RUNRECOVERY: Fatal error, run database recovery

    Looks as if it wants me to run a recovery, but not sure what/where to find it!

  8. #8
    JR-PCS's Avatar
    Join Date
    Apr 2012
    Posts
    91
    Thank Post
    3
    Thanked 19 Times in 18 Posts
    Rep Power
    11
    you are running the recovery tool (db_recover). You want slapd to be unloaded when you run the db_recover, it sounded like you loaded slapd first. However it seems like its not finding your database.

    Could you try running the three commands in the correct order again and take a screenshot of terminal when running those commands. Also go to Server Admin > Open Directory > Logs and give me a screenshot of the LDAP log.

  9. #9

    Join Date
    Jul 2011
    Location
    Essex
    Posts
    210
    Thank Post
    22
    Thanked 34 Times in 29 Posts
    Rep Power
    25
    Here are the logs, hope they're of some help!

    EDIT: Having just read the logs, looks like they need to be restored from backup?!
    Last edited by SC92; 18th April 2012 at 11:49 AM.

  10. #10
    JR-PCS's Avatar
    Join Date
    Apr 2012
    Posts
    91
    Thank Post
    3
    Thanked 19 Times in 18 Posts
    Rep Power
    11
    Yes, it doesn't seem to be able to recover the db. You could try this, but it probably won't work either. (notice it has a -c in the recover command this time)

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

    sudo /usr/bin/db_recover -c -h /var/db/openldap/openldap-data

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

    Have you ever taken an archive of Open Directory? If you haven't and don't have a server backup to use as a restore you may have no choice but to change your OD server to standalone, restart and then promote to OD master. This will give you a blank OD, which you will need to setup again.

  11. Thanks to JR-PCS from:

    SC92 (18th April 2012)

  12. #11

    Join Date
    Jul 2011
    Location
    Essex
    Posts
    210
    Thank Post
    22
    Thanked 34 Times in 29 Posts
    Rep Power
    25
    It seemed like I was able to run the above 3 commands without fail, as in, no errors were returned when running them and all looked successful. How will I know if this had sorted the issue?!

  13. #12
    JR-PCS's Avatar
    Join Date
    Apr 2012
    Posts
    91
    Thank Post
    3
    Thanked 19 Times in 18 Posts
    Rep Power
    11
    Is everything ok in Workgroup manager now, or does that still error?

  14. #13

    Join Date
    Jul 2011
    Location
    Essex
    Posts
    210
    Thank Post
    22
    Thanked 34 Times in 29 Posts
    Rep Power
    25
    Quote Originally Posted by JR-PCS View Post
    Is everything ok in Workgroup manager now, or does that still error?
    Can't even begin to thank you enough, all is now working! Was dreading the thought of rebuilding OD from scratch, thanks so much!

  15. #14
    JR-PCS's Avatar
    Join Date
    Apr 2012
    Posts
    91
    Thank Post
    3
    Thanked 19 Times in 18 Posts
    Rep Power
    11
    Quote Originally Posted by SC92 View Post
    Can't even begin to thank you enough, all is now working! Was dreading the thought of rebuilding OD from scratch, thanks so much!
    Glad I could help. But your school might want to consider a backup plan, in case this ever happens again!

  16. #15

    Join Date
    Oct 2007
    Location
    Northamptonshire
    Posts
    311
    Thank Post
    20
    Thanked 82 Times in 69 Posts
    Rep Power
    45
    Quote Originally Posted by JR-PCS View Post
    Glad I could help. But your school might want to consider a backup plan, in case this ever happens again!
    What do you recommend for backup? I currently backup our xserve via rsync and take regular archives of the Open Directory DB. Planning to use Carbon Copy Cloner & script Open Directory DB backup before CCC backup.

    Thanks

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 5
    Last Post: 19th April 2010, 12:16 AM
  2. Replies: 0
    Last Post: 6th April 2009, 10:26 PM
  3. Replies: 1
    Last Post: 31st August 2008, 03:07 PM
  4. Active Directory Problem
    By clarky2k3 in forum Windows
    Replies: 12
    Last Post: 24th January 2008, 09:58 AM
  5. Replies: 16
    Last Post: 20th December 2007, 11:43 AM

Thread Information

Users Browsing this Thread

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

Posting Permissions

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