View Full Version : My iTunes + Slimserver wrong file count problemfound &solved

2005-03-16, 12:52
>>> slim (AT) nwgeeks (DOT) com 03/16/05 2:34 PM >>>
>To save others from pulling out their hair, I thought I would
>share this in case you have a similar situation.
>First of all, I have a pretty unusual setup:
>Slimserver 6.0b1 running on a Linux box with a raid card.
>Two 250gb hard drives in a raid0 mirror shared out to the
>network via samba
>iTunes running on a Mac. The local ~usr/Music/iTunes
>folder is actually a symbolic link pointing to the raid drives
>so my iTunes database is mirrored as well.

This isn't strange. Replace your mac with a windows box,
and you've got my setup (and a few others on this list from
what I remember).

>When iTunes launches it pulls all the data from the raid drive
>mounted via samba. It's been working ok until recently. Not
>sure if it was a slimserver change, or more likely a change in
>my setup. Recently, the slimserver started reporting that it
>found only about 2,000 of my 27,000 mp3 files. No matter
>what I tried, it could not see more than that. I wiped the
>cache file, wiped the server setup. Hell, I even backed up
>my iTunes folder & created a new database with only 199
>songs. It still had the problem of only finding a portion and
>would report "file not found" if I used debug options.

I've had this happen. It always seems to go away by itself...

>As I was doing more tests this morning, I discovered a very
>curious bug with iTunes when it saves it's data to a linux drive
>upon the program quitting. Essentially the date stamp on the
>file gets all screwed up. After about 15 seconds of itunes
>quitting, I noticed that the date stamp for the following files
>went from this:
>-rwxr--r-- 1 healy healy 42207161 Mar 16 06:57 iTunes 4
>Music Library
>-rwxr--r-- 1 healy healy 39349573 Mar 16 06:57 iTunes
>Music Library.xml

All other comments aside, this is huge!

>To this:
>-rwxr--r-- 1 healy healy 42206857 Mar 16 2005 iTunes 4
>Music Library
>-rwxr--r-- 1 healy healy 39349255 Mar 16 2005 iTunes
>Music Library.xml

That happens when the file is *a year* old. Sounds like your
time mechanism is screwed up.

>For some reason, it turns from a time stamp to a year stamp. I
>started & quit iTunes multiple times & confirmed this happens
>each time it saves it's data to the raid drive. When the slimserver
>attempts to read the data when it's in the year stamp format, it
>gives me the incorrect file count & reports file not found on 98%
>of the files. If I change the data stamp, the slimserver finds all
>the files just fine.

Have you tried executing date or uptime when you see this?
If iTunes takes too long to write out the file, the time stamp
routine might be getting confused somehow. It might be
because that file is so giganitc. Samba is not known for
it's prowess of speed. What version of samba are you running?

>I ended up writing a little cron job to do a recursive copy of
>the iTunes folder into a second location that is only used by
>the slimserver. I thought about using rsync but it preserves
>the dates so that was not an option.
>Anyways, I _think_ I've finally figured out this really obscure
>bug with iTunes writing to a linux drive mounted via samba. I
>thought I'd share in case someone out there is doing
>something like this.

Much appreciated! I'll have to check my setup when I get home.
When it happens to me, I've just copied the files someplace
else (on the samba server at a command prompt) and copied
them back. A cron job would do the job a lot better.