Adventures with OSX Lion. Addressbook goes funky!

Yesterday I applied the Lion 10.7.1 Update. Yes – it is available and fixes some Wi-Fi and video issues.  After applying the update my Addressbook appeared to have problems.

I have about 5,500 entries in my Addressbook and I have been through multiple clean ups to remove duplicates as a result of merges from Google, Plaxo and MobileMe. Duplicates have been nothing new. They have been happening for years. But this funkiness was different.

The two pane Faux-Leather Addressbook view would not update correctly. Three things happened:

1. Filtering in the search bar failed to work against all contacts. It would work for a group.
2. Search also failed. 
3. In the 2 pane view selecting a contact in the list on the left failed to update the view on the right. It stayed showing whichever record had been displayed first when Addressbook opened.

In another wrinkle, you could quit or Force Quit from Addressbook and reopen the application and you may be able to click on different contacts and have the record update in the right hand view pane. However, this would then stop after about 45 seconds and the right pane was frozen on whichever record was last displayed.

Fortunately, because I have had so many situations where syncing has doubled up on records I have developed a habit of taking frequent exports of the Addressbook. Just go to File….Export….Address Book Archive. This will take a snapshot of your entire addressbook.

I am regularly adding to my Addressbook as I meet new contacts. So new records are added almost daily.

A trip to the Apple Store in Towson led to my machine having the OS re-installed. The secret partition that is installed with OSX Lion proved it’s worth! Before that I worked with the Geniuses at the store to create a new test account and copy the addressbook across to the new account. The same problem appeared. They copied it to another machine and there wasn’t a problem. Interesting!

The re-install put the machine back to 10.7.0. But still the problem persisted. At this point the Genii were flumoxed! So I took the machine home where I would have access to Time Machine if I needed to restore. The challenge was on! Could I get to the bottom of the problem.

Google Sync, Adium Integration, Skype links to the addressbook, and MobileMe Sync had all been disabled to reduce the number of error vectors.

Experiments revealed that if I chose a group or distribution list first the filtering and search and right pane view all worked. So I selected all of the records in my addressbook and created a new group using File…New Group From Selection. This new group still had the problem.  This pointed to a problem with the records in the Addressbook.

The next step was to load up Textmate and take a look at the Addressbook archive. Unfortunately it is not a single file. The Archive comprises:

– AddressBook-v22.abcddb
– Configuration.plist
– Images Folder
– MailRecents-v4.abcdmr
– Metadata folder

The Images folder contains documents or .jpeg files where the filename is in the format:

This corresponds with a file in the Metadata folder where the filename is in the format:

It would be no easy task to isolate which files had been corrupted but this is what was the most likely scenario. So, I went to a backup from a couple of days prior and restored the Addressbook Archive.

After a couple of minutes the data in Addressbook had been replaced. To be safe I quit Addressbook and restarted.  Everything worked! I was just short about 30 records. I switched MobileMe Sync back on in the preferences and after a sync I was back very close to the most recent number of records. 

Apple, If you are listening. It would be great to have a view in Addressbook that could list records in Record Number sequence. This would allow you to easily identify the latest records added. And NO! Show Last Import doesn’t cut it.

One quick trick to quickly check how many records you have is to enter “*” in the search bar of Addressbook. It returns a record count.

The only way to get at records in Addressbook in Record number sequence is to write an Applescript that will do a For Next Loop through the database. it’s clumsy but it will work.

The answer to the problem does indeed appear to be a glitch in creating a recent addressbook record. 


The lessons learned are:

1. Take frequent backups. I have TimeMachine but I had problems with Addressbook crashing when quitting from Time Machine in Addressbook. Presumably because of the record corruption in the Addressbook database. I will probably write a script that will be run as a Cron job to keep a rolling three generations of Addressbook Archive.

2. MobileMe is a help (to be superceded by iCloud) it is great to have a backup of your addressbook that is in the cloud and available to your iPhone/iPad etc.

3. The OSX update didn’t mention anything about changes to Addressbook, but I will be careful in applying the 10.7.1 update.

So now I am back to a working Addressbook but I am still on 10.7.0. Next step is to re-apply the 10.7.1 update and see if Addressbook still works. Before I do that I am off to export my addressbook as an archive. You can’t be too careful!

8 thoughts on “Adventures with OSX Lion. Addressbook goes funky!

  1. Hi Mark. Came across your blog post while I was trying to figure out where the MailRecents-v4.abcdmr file is stored in OS X 10.7. I’m trying to move my previous recipients list from another computer to my new one but the address book isn’t in the applications support folder in the library in Lion. It looks like you found the file – any chance you recall where it was located? Thanks!

  2. You should find your MailRecents-v4.abcdmr file in your ~/Library/Application Support/AddressBook/ folder. Don’t forget that by default OS X Lion hides your library and the Macintosh HD Library Folders. You can unhide them with a command line instruction:chflags nohidden ~/Library

  3. Hey Mark–Great post. I am having the exact issue you described. One question–when you restored your AddressBook from Time Machine did you restore one of the files inside ~/Library/Application Support/AddressBook? Or the entire "AddressBook" folder?

  4. <html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>I restored the entire AddressBook folder.</div><div><br></div><div><br></div><br><div><div></div></div></body></html>

  5. <html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Since I fixed the problem It has not re-surfaced. I am currently on the latest iteration of OS X Lion.&nbsp;<div><br></div><div><br></div><div><br><div><div></div></div></div></body></html>

  6. I had the same issue. Thanks for sharing. I think I found an easier solution.I saved an archive first (just for safety). Then I went to the iCloud pref pane and turned off syncing. It asked if I wanted to delete the Mac Contacts. I said "yes". Then I turned syncing back on. Everything reappeared in a minute or two and searches are working again.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s