Read my book

I wrote books about Webpack and React. Check them out!

Monday, December 30, 2013

osx - Migrating from Mountain Lion to Mavericks

On retrospect I upgraded my system from Mountain Lion to Mavericks too early. On the other hand it was the perfect time to do that as I had time to deal with complications. If you are considering upgrading, wait for at least 10.9.2. If you decide to go on with the upgrade, read on.

"Too many files" error

After downloading and installing the upgrade I started getting these weird "failed to open stream: Too many open files" type of errors at my iTerms. Also normal commands like "ls" yielded no results. By using "top" to examine current running processes I noticed OS X was busy indexing the newly created files. I guess it subsequently hit some system limit.

Further research lead me to a Apache related Stack Overflow entry. Also this one about ulimit came in handy. Effectively I just had to bump up the system limits a bit to make the issue go away. This was simply achieved by editing /etc/launchd.conf and bumping up the values. I settled with limit maxproc 512 1024 and limit maxfiles 16384 32768 . If you make this change, restart the system for those to take effect.

Google Chrome Crashing on Start

As if that wasn't enough Chrome started crashing on me. First it actually showed something and crashed. Eventually it just started crashing as soon as I started the app. Apparently I am not the only one suffering from this. Interestingly Chromium worked just fine so I was pretty certain it wasn't the browser. I even tried reinstalling it to no avail.

My guess is that the original one got corrupted somehow by that "too many files" issue. Even in Chromium pages failed to load sometimes before I managed to resolve that one.

I traced this issue to something known as "saved application state" OS X maintains. Even if an app is removed, the state remains. That explains why reinstalling didn't do any good. Simply removing this state for Chrome fixed the issue.

This can be achieved by navigating to ~/Library/Saved Application State and removing Google Chrome directory. Problem solved.

CalendarAgent and ssh Want to Use Keychain

Apparently Apple changed the behavior of Keychain somehow in Mavericks. As a result it kept on bugging me both randomly and when I tried to ssh somewhere. Fortunately it was easy to resolve this issue simply by tweaking Keychain Access settings and make it not to lock the keychain automatically.

Conclusion

Apart from these annoying glitches Mavericks has worked well so far. Still, if you want to avoid some potential problems or don't have time to deal with them, consider waiting a while. So far this has been the most painful OS X upgrade for me to go through. I hope they do better next time.