6 Replies Latest reply: Feb 18, 2013 12:59 PM by Linc Davis
Klingon725 Level 1 (0 points)

I am running Mountain Lion on a late-2012 Mac Mini (the newest one at this writing), and my system got messed up after I tried to reset my primary uid to 501 (I know, first mistake) after having migrated the system from an older Mac Mini.  This worked partially, but I continued to have issues accessing some files and got tired of resetting the permissions manually. 


I tried reinstalling Mountain Lion and since then, the system fails to boot completely.  I can get as far as seeing the desktop, Finder menu, Dock, etc., but then one or more error windows pop up relating to specific resources (I think Calendar Agent was one of them, I can't remember because I then saw the spinning disk icon and the system stopped responding).  I tried restarting by turning the computer off and then on again, but continue to get similar errors after it gets almost all the way through booting.


Although I have much of my data on the hard drive backed up to an external Seagate drive on my home network, I had not been able to do a complete backup because I have many old (pre-OS X) files that contain slashes or other characters no longer allowed in filenames, and it has proven too cumbersome to update all the filenames to make it worthwhile.  Thus, I am not able to wipe the hard drive and start from scratch.


I know how to boot in Single-User mode, which does work, but don't know enough BSD/Darwin to pinpoint the source of this problem and fix it.


Any advice about how to diagnose and/or solve this problem?  I would like to be able to correct any uid and gid conflicts that may be causing this, which I believe would work, but am not sure how to do this.  I am writing this from Safari after booting in Recovery mode.


Thanks for any help with this.  - Klingon725

Mac mini (Late 2012), OS X Mountain Lion (10.8.2), ViewSonic Optiquest Q20wb display
  • Eric Root Level 9 (50,517 points)

    Can you boot into the Safe Mode?


    Safe Mode


    Safe Mode - About


    Startup Issues - Resolve


    Someone having a similar problem.


  • Klingon725 Level 1 (0 points)

    Thanks for your reply.  When I try to boot into Safe Mode, I get the login screen, but the spinning beach ball appears and is not spinning.  I can move the beach ball around on the screen with the mouse, but cannot click on the username to log in.

  • Klingon725 Level 1 (0 points)

    As an update:  after about 10 minutes of no activity, the system finally responded and I was able to login to Safe Mode.  I am now getting crash reports for CalendarAgent (prior to this, I was getting crash reports for this application and iPhotoStream every 1-2 seconds). 


    Here is the first part of a sample crash report, in case it helps:


    Process:         CalendarAgent [443]

    Path: /System/Library/PrivateFrameworks/CalendarAgent.framework/Executables/CalendarA gent

    Identifier:      CalendarAgent

    Version:         1.0 (55)

    Code Type:       X86-64 (Native)

    Parent Process:  launchd [158]

    User ID:         501


    Date/Time:       2013-02-17 15:50:27.304 -0500

    OS Version:      Mac OS X 10.8.2 (12C2034)

    Report Version:  10


    Interval Since Last Report:          1491 sec

    Crashes Since Last Report:           33567

    Per-App Crashes Since Last Report:   137

    Anonymous UUID: 0FBC13DC-C7B2-1886-E383-F726D07CF52D


    Crashed Thread:  0  Dispatch queue: com.apple.main-thread


    Exception Type:  EXC_CRASH (SIGABRT)

    Exception Codes: 0x0000000000000000, 0x0000000000000000


    Application Specific Information:

    *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '*** +[CalEntityDescription insertNewObjectForEntityForName:inManagedObjectContext:obtainPermanentID:]: could not obtain permanent id for CalDAVError'

    terminate called throwing an exception

    abort() called


    Application Specific Backtrace 1:

    0   CoreFoundation                      0x00000001084630a6 __exceptionPreprocess + 198

    1   libobjc.A.dylib                     0x00000001082a93f0 objc_exception_throw + 43

    2   CoreFoundation                      0x0000000108462e7c +[NSException raise:format:] + 204

    3   CalendarStore                       0x0000000108799cd4 +[CalEntityDescription insertNewObjectForEntityForName:inManagedObjectContext:obtainPermanentID:] + 235

    4   CalendarStore                       0x00000001088c82b3 -[CalDAVQueueableOperation persistError:] + 344

    5   CalendarStore                       0x00000001088c7fe6 -[CalDAVQueueableOperation setError:] + 1267

    6   libdispatch.dylib                   0x0000000109f19f01 _dispatch_call_block_and_release + 15

    7   libdispatch.dylib                   0x0000000109f160b6 _dispatch_client_callout + 8

    8   libdispatch.dylib                   0x0000000109f1b0c8 _dispatch_main_queue_callback_4CF + 275

    9   CoreFoundation                      0x00000001084050fe __CFRunLoopRun + 1614

    10  CoreFoundation                      0x00000001084046b2 CFRunLoopRunSpecific + 290

    11  CalendarAgent                       0x0000000107cafab3 CalendarAgent + 2739

    12  libdyld.dylib 0x0000000109f4d7e1 start + 0


    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread

    0   libsystem_kernel.dylib              0x000000010a13b212 __pthread_kill + 10

    1   libsystem_c.dylib                          0x0000000109fc2af4 pthread_kill + 90

    2   libsystem_c.dylib                          0x000000010a006dce abort + 143

    3   libc++abi.dylib                  0x0000000109e6da17 abort_message + 257

    4   libc++abi.dylib                  0x0000000109e6b3c6 default_terminate() + 28

    5   libobjc.A.dylib                   0x00000001082a9873 _objc_terminate() + 91

    6   libc++.1.dylib                    0x0000000109dae8fe std::terminate() + 20

    7   libobjc.A.dylib                   0x00000001082a95de objc_terminate + 9

    8   libdispatch.dylib              0x0000000109f160ca _dispatch_client_callout + 28

    9   libdispatch.dylib              0x0000000109f1b0c8 _dispatch_main_queue_callback_4CF + 275

    10  com.apple.CoreFoundation              0x00000001084050fe __CFRunLoopRun + 1614

    11  com.apple.CoreFoundation              0x00000001084046b2 CFRunLoopRunSpecific + 290

    12  CalendarAgent                            0x0000000107cafab3 0x107caf000 + 2739

    13  libdyld.dylib                      0x0000000109f4d7e1 start + 1

  • Linc Davis Level 10 (192,784 points)

    Back up all data.

    This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it.


    Step 1

    If you have more than one user account, and the one in question is not an administrator account, then temporarily promote it to administrator status in the Users & Groups preference pane. To do that, unlock the preference pane using the credentials of an administrator, check the box marked Allow user to administer this computer, then reboot. You can demote the problem account back to standard status when this step has been completed.

    Triple-click the following line to select it. Copy the selected text to the Clipboard (command-C):

    { sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; sudo chown -Rh $UID:staff ~ $_ ; sudo chmod -R u+rwX ~ $_ ; chmod -R -N ~ $_ ; } 2> /dev/null

    Launch the Terminal application in any of the following ways:

    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)

    ☞ In the Finder, select Go Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.

    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.

    Paste into the Terminal window (command-V). You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.


    The command will take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear, then quit Terminal.

    Step 2 (optional)


    The first step should give you usable permissions in your home folder. This step will restore special attributes set by OS X on some user folders to protect them from unintended deletion or renaming. You can skip this step if you don't consider that protection to be necessary.

    Boot into Recovery by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.

    When the OS X Utilities screen appears, select

    Utilities Terminal

    from the menu bar. A Terminal window will open.

    In the Terminal window, type this:


    That's one word, all lower case, with no spaces. Then press return. A Reset Password window will open. You’re not  going to reset a password.

    Select your boot volume ("Macintosh HD," unless you gave it a different name) if not already selected.

    Select your username from the menu labeled Select the user account if not already selected.

    Under Reset Home Directory Permissions and ACLs, click the Reset button.



    from the menu bar.

  • Klingon725 Level 1 (0 points)

    Thank you Linc, this was extremely helpful and I now have regained control over my files and applications.  Whew!


    I am continuing to see some recurring errors in my Console.  I have seen errors like this in the past, but can't remember how I got rid of them.  It looks to me like some lingering permissions errors. 


    One example:


    2/18/13 9:38:47.679 AM postfix/master[11007]: fatal: remove private/smtpd: Permission denied

    2/18/13 9:38:48.681 AM com.apple.launchd[1]: (org.postfix.master[11007]) Exited with code: 1

    2/18/13 9:38:48.681 AM com.apple.launchd[1]: (org.postfix.master) Throttling respawn: Will start in 9 seconds


    This repeats about every 10-20 seconds, generating a new PID each time.


    Another one is as follows:


    Feb 18 09:58:40 new-host-6.home gssd[11288]: svc_mach_gss_init_context request not addressed to us


    I am also noticing that many simple Finder operations (e.g., selecting a file, clicking on an inactive window, etc.) take about 10-20 sec. to execute, during which time the spinning beach ball appears.


    Any clues about how to fix these remaining issues?


    Thanks,  - M.

  • Linc Davis Level 10 (192,784 points)

    Back up all data.


    Boot into Recovery by holding down the key combination command-R at the startup chime. Release the keys when you see a gray screen with a spinning dial.


    Note: You need an always-on Ethernet or Wi-Fi connection to the Internet to use Recovery. It won’t work with USB or PPPoE modems, or with proxy servers, or with networks that require a certificate for authentication.


    When the OS X Utilities screen appears, follow the prompts to reinstall the OS. You don't need to erase the boot volume, and you won't need your backup unless something goes wrong. If your Mac was upgraded from an older version of OS X, you’ll need the Apple ID and password you used to upgrade, so make a note of those before you begin.