Recently I found that certain songs in my iTunes library just stopped working. They appeared in the list, but double-clicking them, or selecting them and pressing the play button does nothing. I did a quick test today, and there were a lot of them that appeared to be broken. I tried locating the actual mp3 file in Finder, and double-clicking it — same thing: no music.
At first I was worried that there had been some update to iTunes that broke any song not purchased through the iTunes Music Store, but that would surely be the death-knoll for iTunes. So then I thought that somehow the files became corrupted. To fix them, I located a utility that, among other things, fixes the mp3 headers of a file: MP3Packer for Mac.
Just before I was about to run the utility on some broken files, however, I discovered the real reason that iTunes wasn’t playing them:
-rw------- 1 501 wheel 6663269 Jul 14 22:39 02 Don't Phunk With My Heart.mp3
It was a file permissions problem. The login that I use on my OSX box has a different uid number than 501, but these songs were owned by user 501 and set with read-write permissions for that user only. The songs were already indexed in iTunes, so they appeared in my Library (which is actually an XML database of your files, not the files themselves), but somehow the ownership of the files appears to have changed.
That they were set to user 501 is curious as well. The first user on a system is often 500 or 501, since the operating system begins numbering for ordinary users at that number. When I got my new laptop, I used the Mac OSX Migration Assistant to copy my home directory from my old laptop to my new one, but I kept my music files in a different location, and copied them over manually. My best guess is that these files, copied over manually, retained the old user id number and permissions.
Whatever the cause of the permissions problems, fixing it is easy, with a little bit of UNIX shell wizardry. From the Terminal, change to the root of the Music folder (for me, thats: /Users/Shared/Music. The default location is ~/Music.). Change all files to have global read permissions using the “find” utility:
$ cd /Users/Shared/Music
$ sudo find . -type f -exec chmod 644 '{}' \;
Then change the ownership of all mp3 files so that I own them:
$ sudo find . -name "*.mp3" -exec chown myusername '{}' \;
… where “myusername” is the username that I login with on the system (also the “short name” in macspeak).
The cause of the problem would have been obvious if iTunes produced an error message instead of just doing nothing when I attempted to play the “broken” file. “Permission denied” would have been helpful!
Add comment
Possibly Related Posts:
-
Sierra




