Monday, June 03, 2013

Smart or Dumb: The OSX update saga

Have you ever logged into OSX at gotten a message about needing updates although you are sure you have applied them already? How about a message saying that you need to accept certain packages like iPhoto in the update manager but when you try you are told they have been purchased with another account and you need to login with that one to install them? Looking at the Apple OSX support forums across a number of sites I can tell you don't bother answering, I know it is a rhetorical question. These errors happen to a lot of people and all the time. Eventually some other forum user will suggest some bit of command line trickery that has nothing to do with the problem and the errors go away.

Most people are happy to have computer problems go away with no real need of a detailed understanding, I am not one of those people. I reverse engineer and bug hunt for a job, I can look deeper than just cryptic command line strings offered by a reader who says "it worked for them."

Before I go any farther let me say most of the advice offered actually does nothing to help the problem. After a few hours of examination, reversing apple binaries, and understanding file formats I finally got the real answer to those pesky errors: Time Machine.

Take a look at the following picture:
Its my desktop. Its pretty boring. I have no updates available.
Here is the same desktop a few seconds later but suddenly I have updates. Xcode, iPhoto and a few others.

What is the difference? You may note in photo 2 there is an external USB drive attached called "My Passport." This is my Time Machine drive for this computer. While I could walk you through the process of using everything from lsof to IDA Pro to figure it out the basic idea is that when I attach my drive with back ups of old systems the install process will search these as well to check if anything is out of date. It gets even more complicated if you use one drive to backup several systems. The App Store never bothers to tell you what app is being updated where. in fact using lsof was the only way I could seem to figure that out.

The complete explanation of tracking this error down is really boring and has alot of rabbit holes I went down in error. Here is a screen cap of where I found the right rabbit hole:
The App Store process was looking at a backup version of an app that I supposedly had updates for. This happens quick during the app store start-up and if you don't know what you are looking for you will miss it. This originally stuck out because it is looking at a backup of my Macbook Pro. I was using a Mac Mini at the time.

To wrap up if you are having weird update problems with the OSX App Store make sure you don't have a Time Machine backup mounted anywhere, reboot and try again. The reason the bits of command line trickery worked for readers on support forums are no doubt they had to reboot several times. One of these reboots unmounted the Time Machine volume and "presto magico" the problem was fixed.

I wrote this post in hopes that nobody else spends the amount of time I did to track this problem down.


No comments: