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 '
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.]