Sunday, April 5, 2009

Unknown error when syncing iPod (-50)--solved!

For about a week now, I've been getting a unknown -50 error every time I tried to sync my iPod (strange that an unknown error actually has an error code!). After much scouring of the internet, I discovered that it was something to do with my iPhoto library.

I went to the iTunes settings for my iTouch, selected the Photos tab and unselected the 'Sync photos from' option-thus erasing all photos from my iTouch. After this I was able to successfully sync my iTouch-yay! back in action. If I tried to enable syncing photos to the iTouch, it would -50 error at me again. Definitely a problem with syncing photos.

Now although this fixed the immediate problem, I was still a little unhappy. I quite regularly use my iTouch to show friends and colleagues images of my recent jaunts. So I needed to track down the actual problem.

I tried using OSX's console application to discover what was happening-but no errors were being reported here.

I decided to then have a dig around the files in the iPhoto library's directory. It was here that I found my culprit. I tried to open AlbumnData.xml in Safari and it turns out that the XML file was not well formed. About a week ago I had renamed my iPhoto library to one that included both a quote character and an ampersand. iPhoto had quite happily written that library name directly into the XML document without Unicoding the special characters.

I renamed my library (i.e. the iPhoto directory) and manually corrected the name in AlbumData.xml. Now I can sync my photos again and bore my friends and colleagues no end.

Summary steps to fix the -50 error:
1. Open iTunes and deselect the syncing of photos for your device
2. Using Safari or Firefox, open the file AlbumData.xml that is contained in your iPhoto library directory. You should get an error here describing where in the xml document it is malformed.
3. Using a text editor (I used vi), open AlbumData.xml and correct the malformed XML
4. If you renamed the library in the XML in the previous step, change the directory name of the library to the same name
5. Whilst holding down the ALT key, click on iPhoto to start it. This should give you a dialog where you can select to choose which iPhoto library to Open. Click 'Choose Library...' and select your newly renamed library.
6. In iTunes, go to the Photos tab for your device, and select sync photos from iPhoto
7. Apply and Resync

Job's a good-un!!

No comments:

Post a Comment