Tuesday, June 5, 2012

Botched iTunes Match. A post Mortem on Fixing broken songs



So I have been hearing about iTunes Match for a while and I decided to go with it to get my huge music collection upgraded and cleaned. However, If you experience anything like I did with iTunes Match then iTunes consistently crashed over and over while trying to match songs over a week of hell..

Once iTunes was done and I had surveyed the destruction I had items that when you try to play them you receive "this item could not be downloaded" error. What you have are items iTunes thinks are in the Cloud but are actually broken in the iTunes&Cloud database (a db entry without data. that's my take at least).

*To finally (make iTunes stop crashing) finish iTunes Match I had to run ProcMon from SysInternals and track file open operations until I found the songs iTunes was choking on each time it crashed. In my case it turned out to be a couple of old items that were 100+MB... Who knows... I've dumped a lot of random crap in iTunes over the years. I got the idea for this procmon fix from user posts on the Apple Support forums, thanks guys!

Once past iTunes poor error handling iTunes Match decided it had completed (and I use this bitterly). I came to find I have a hundreds or more songs that are broken in the cloud and iTunes. I may still have more that I don't know about.. However, I did not yet know this.... I decided to delete some songs indicated as successfully Matched and try re-downloading them to verify iTunes had worked. Oops, nope, it just thinks it worked. When iTunes crashed it thought it had uploaded them to the cloud but it had not. How does this get past Quality Assurance guys?? Hire a few more Testers and think of it as a stimulus...but I digress.

Well now those songs are broken and in iTunes limbo... I wanted those suckers back/fixed. To be fair I had 24k songs purchased or backed up over 15+ years in a variety of formats. I decided to fight through the pain and fix the broken items in iTunes because, well, this is my Music collection dammit.. So this is one method of recovery...

Recovering Broken Items
Lucky for you the folks at Apple were kind enough to delete your matched items to the Windows Recycle bin. This means they are recoverable! Here’s how to do it. This should work with AAC or MP3’s. However it’s time consuming.

Step 1: The before in iTunes .  This can look one of two ways shown below.

Or (if you tried to play the broken item you got the dreaded “!” (Exclamation). Don’t worry... It’s still fixable but with one extra step.

Step 2: Find the track deleted by iTunes during the failed iTunes Match in the Recycle Bin. I found the best two ways were to either search for the artist or sort by Original Location and find the author then album directory. I know, this is work…if you are lazy then give up and go sit and watch some more tv, cry and don’t learn. We need useless lumps like you for something I guess.


Browse to the destination folder the restored song should be in after you Restore it. Use the Original Location indicated by Recycle Bin above. In this example it was @ L:\My Music\iTunes\iTunes Media\Music\Sublime\Sublime\
Restore the item by right clicking the song in Recycle Bin and selecting Restore. It will now show up in L:\My Music\iTunes\iTunes Media\Music\Sublime\Sublime\ and disappeared from Recycle Bin. Hope you browsed to the destination first or wrote it down.



Step 3: Now just Drag and Drop the restored item in to iTunes (yes, this is duping) and you will see a second item in iTunes with a cloud next to the song.
The Item with the cloud means iTunes is now re-matching the song. If it takes too long or you get impatient you can always manually start iTunes match from the the top menu bar in iTunes by clicking "Store"->"Update iTunes Match".

Step 4: If all went well after about 5 minutes you should see a normal (fixed and de-duped) song again (it cans take longer sometimes). If you had the exclamation mark then just click download again and it should play!
*If this doesn't work then you might try deleting the song from iTunes and re-adding the restored item.

 After iTunes finishes this task you should see just one item that is playable again.
**This works 98% of the time for me.

PS - Here's the part that sucks. The Song is fixed in iTunes on your computer but it is not fixed in the cloud. Once again iTunes Match is stupid. If you delete the song locally you will still receive an error when trying to download it from the cloud. I don't know how to fix the "cloud" yet. Apple.. help? Anyone?

Good Luck!

Quick Update ( iTunes 10.6.3)

As of iTunes 10.6.3 it appears the issues I was encountering with broken songs have been resolved. I can now download the broken songs however Itunes does seem to sit and "sync" my library indefinitely. It started with the lighting bolt next to "Music" so I clicked it and have allowed it to sync with the animated cloud symbol next to "Music" for 7 days now.