MacOS – After 10.9 upgrade, settings keep getting deleted

iphotoituneskeychainmacossettings

Got an exceedingly odd one here. I have installed 10.9 on four machines now and each time I have seen it wipe out the login.keychain and sometimes after that it also wiped out some preferences, but after a reboot and restore of some of them things seemed to settle down. Fortunately I've been able to restore the backup on all except one. I've hit an odd wall with one of the MacBook Airs in particular where the system not only wiped out the login.keychain but snowballed into wiping out all of the other preferences it appears to all apps. This included the Dock and most application preferences. Some things seemed to remain such as Desktop and Screensaver settings, so it was quite queer.

This particular problem machine went so far as to have the iPhoto and iTunes databases continually corrupted. After turning on and off iCloud, many reboots and about 20 rebuilds of the iPhoto database, I've reached the end of my tolerance level. The most reliable way to corrupt the iPhoto database and iTunes has been to connect a new iPad Air to it. I finally got it switched over to sync via wireless and to not trigger iPhoto and iTunes automatically on connection and so that is calmed down, however the other settings such as Dock's and Finder's are being obliterated yet still on each reboot and seemingly at random times.

This is quite odd for me as I'm usually the guy that tells the Geniuses at the Apple store what is going on as I have 20 years of Unix, etc. experience, but this is just a baffling situation and I wanted to see if anyone else has seen anything quite like this. I have not yet been able to find the same scenarios with quite a bit of searching and so I felt it was time to pop on over here.

FYI, I also did reset the keychain entirely multiple times as well as run repairs, which rebuilt it since it was being deleted too apparently. Filesystem and permissions also were fine.

Any thoughts or anyone seen something similar?

Best Answer

So I found that after looking at the extended attributes that somehow this particularly problematic system had issues where there were a number of user immutable files. After resetting the extended attributes things started to become a bit more sane.

For example, I found a handy command line option on the Apple forums:

find ~ $TMPDIR.. \( -flags +sappnd,schg,uappnd,uchg -o ! -user $UID -o ! -perm -600 -o -acl \) 2> /dev/null | wc -l

(Drop off the final | wc -l to see actual files with issues.)

I then went through resetting things judiciously and selectively executing these where appropriate (also found on the Apple forum, but modified from original form):

sudo chflags -R nouchg,nouappnd ~ $TMPDIR..
sudo chown -R $UID:staff ~
sudo chmod -R u+rwX ~ 
chmod -R -N ~ # Or specific paths

For example, I found that even after executing these and rerunning the find command sans the postfixed line count that there were still a number of corrupt permissions and had to selectively run chmod -R -N on those paths again. Odd that it didn't take care of them the first time, but ultimately I ended up with a 0 count of permission afflicted files.

For good measure I took the advise of rebooting into the recovery partition and running Terminal -> resetpassword and subsequently reset the folder permissions for the homes, but I don't think that that was necessary as the permissions seemed to checkout prior to that for the folder and children.