Mike’s World of fun stuff (pinball, games, electronics, amusement parks, computers, more)

If you've got a QNAP NAS and some file in your music library is causing the QNAP's iTunes server to die, here's how you can track-down the problem and fix it.
A while back, I finally decided to drop the money on a Qnap TS-219P pre-built NAS (network attached storage). It's small, silent, draws almost no power, has a nice web based UI, and features many services such as Windows (SMB) sharing, Apple (AFP) sharing, web server, iTunes server, DLNA via Twonky, and much more. Sure, I could have built my own PC to do all this, but that takes time up-front, and time to maintain it, so I spent a little more to get an "already done for me" solution.
After months and months of owning the Qnap and having it silently and reliably serving up network storage for manual file copies, OS X's Time Machine, etc. I thought things were perfect. But, one day, I ran an automated tool on my iTunes library which corrects bad ID3 data, adds album art, etc.
So, once I had reworked my entire music library with this tool, I copied all of the files to the Qnap so that its built-in iTunes server could offer them up to any machine in my house.
That's when I had a problem. When I copied the music library to the Qnap, an iTunes running on another machine would lose the connection to the shared library. It seems that at least one of the thousands of files in the library was causing the iTunes service on the Qnap to choke and die. I could delete the library and restart the service via the GUI, and it would stay running. But, as soon as I put my library back on the Qnap, the service would again die.
I inquired on the Qnap forums and the official Qnap representative offered to have someone look at my NAS to find-out why the iTunes server was dying. I asked if they had any logs or some other way that I could do it myself, since, well, I prefer doing that myself and then I would not have to either be around when their support person was available, or give them unsupervised admin access. The answer was "no" - I would need to have them look at the problem. Now, don't get me wrong, I DO appreciate Qnap's willingness to investigate the problem, but I would just prefer to know how to do it myself, in case it ever happens again in the future.
Anyway, I figured-out how to troubleshoot the crashing Qnap iTunes server myself, and figured I'd share it in case anyone else out there prefers to self-resolve problems like this.
NOTE: This is not a hand-holding HOWTO, so if you're unfamiliar with commandline stuff, please let the Qnap support people do this for you. I offer no guarantees whatsoever.
First, you need to open an SSH session to your QNAP NAS as the admin user.
Once you have done that, the name of the iTunes server is ' mt-daapd '.
In my case, doing a ' ps | grep mt-daapd ' returned no running processes, so I knew that the service was truly not running. You should run this command also to check that the service is truly dead.
If you run ' mt-daapd --help ' you'll see the usage statement, like this:

So, the next step is to run the mt-daapd in the foreground so we can watch it spew log information to the screen. Use ' mt-daapd -d 9 -c /etc/mt-daapd.conf -f ' This will cause lots of log spew to scroll-by. If the problem you're having is the same as mine, the output will stop with a segfault like this:
In this particular case, I think the "o" with the dots above it are the problem. Nothing I did would allow me to cut/paste that character on the Qnap, so I'm guessing that when that character gets encountered, that's what is causing the segfault. I chose to simply delete the directory/files by that band as they're not one of my favorites anyway:
Running ' mt-daapd -d 9 -c /etc/mt-daapd.conf -f ' again, I saw that the entire library was parsed and the service was ready to accept connections:
Control-C that to stop the foreground debug copy, and then use the Qnap web-UI to restart the service by unchecking it, hitting OK, and then re-check and OK it. Now, when you do the the ' ps | grep mt-daapd ' you should see something like this:
And, your shared iTunes library should be showing-up normally.
I love my Qnap TS-219P, but I wish they'd offer more information on self-resolving stuff like this so I don't have to figure it all out. But, hopefully, that's the last problem I run into and if so, I'm still quite happy with the purchase.
Previous post: Awesome spinning LED sphere project
Next post: Cheap, almost perfect iPad case
[powered by WordPress.]
35 queries. 0.361 seconds
May 30th, 2010 at 8:29 pm
Your posting and research has proved invaluable. Just bought the same unit and uploaded a massive library from my wife’s computer only to have the service bomb in the middle. I hopped on the device and was able to find the offending track. Once I deleted it from the system. All is right with the world. Thanks for the tips. . . .
June 1st, 2010 at 6:46 am
To be honest, if metadata can cause the server to crash like that, it is faulty.
Perhaps the tool you used has messed up the utf-8 encoding in the tags or whatever, but it shouldnt die.
I would be sending those files to the qnap support guys and telling them to make it work.
June 3rd, 2010 at 10:40 am
Brad – I’m glad it helped. I’ve been living with the broken QNAP iTunes server for months, hoping they’d fix it in every firmware release. At least I could save you some of the same frustration
Richard – I agree completely. It’s partially my fault for not wanting to turn-over unsupervised admin access to the NAS, but I might go ahead and send them the file in question so they can analyze it. I suspect that the fact that I could not paste the “o” with the dots *at all* indicates that the QNAP OS doesn’t have support for whatever language uses that symbol, so it chokes when it hits it.
June 12th, 2010 at 1:14 am
Thanks for sharing this. Fantastic tip. I found one track out of 8000+ that was causing the itunes server problems. Not the same problem as you – and I’m sure I have German characters in some of my music. Turned out it was a very short bonus track on a Hot Chip album called The Warning. It only lasts a couple of seconds and doesn’t play anything. So I deleted it and iTunes came back. Thanks again.
QNAP or itunes really need to address this. I got no error message when the itunes server suddenly disappeared after it started to scan the songs newly loaded to the QNAP.