Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

iTunes Corrupting Library File on NAS

Hi all. This will probably end up being tl;dr, but anyone who thinks they might know an answer, please help.


I have my iTunes library (the media itself) on a Synology DiskStation DS1812+. Up until today, I've had my library files on the local Mac mini, I moved them to the NAS today to see if that helps solve the issue I'm having. I'm running iTunes 11.1.1 and Mac OSX 10.8.5 (not being at 10.9 is another iTunes problem for a different discussion). I should also mention that I have eight 4TB drives in the Synology and my iTunes library has Music (7,500 songs), Movies (1,100 movies, most in HD), and TV Shows (4,700 episodes, many in HD). My Mac mini is acting as the HTPC and it's connected via HDMI to the living room TV.


In the past few months, iTunes has started to scramble around my files all over the iTunes Media folders. I'll find a song or a movie inside a TV Show season or I'll find a song listed in the Movie list. Sometimes the artwork will change to the song, but the original file using "Get Info" will show what it should be. There doesn't seem to be any rhymn or reason to it. Also, looking in the iTunes Media folders and there will be stray TV Show episodes inside music folders or three movies listed like they were part of a TV Show (01 Name of Movie, 02 Name of Movie) in the root folder of TV Shows. Sometimes TV Show episodes will migrate to an Album folder. It's really driving me nuts!


I just erased and rebuilt my iTunes library in June and don't really want to do it again if it can be helped. One of the reasons I erased everything in June was to try and solve this issue. I've even looked at switching to Plex or something like that, but that would involve so much work that I want to make sure I'm not missing something with iTunes before I take on renaming all these files to work with Plex. Anybody with any ideas would be great ! Thanks!!

OS X Mountain Lion (10.8.5)

Posted on Jan 25, 2014 6:20 PM

Reply
16 replies

Mar 2, 2017 4:42 PM in response to SMB-IL

User uploaded fileI have had similar issues lately with my iTunes media libraries. I have my iTunes Media Folder on a Synology NAS. My library is around 1200 movies, 250 TV Shows, and 7000 songs. The attachment says it all for me in my TV Shows folder. New Tricks TV Show folder with Title for Outlander and the file is Stargate: The Ark of Truth. This type of issues happens with both Purchased and Ineligible (Ripped) files. I have music, Movies, and TV Shows showing up in all of these folders. I presume it is a iCloud or iMatch issue? Any suggestions? Thanks

Feb 22, 2014 8:09 AM in response to SMB-IL

Sorry not to help but I was wondering if you had any luck with this. I'm having the same problem - some but not all files moving into the root iTunes Media folder (I don't know how bad it would be - every time it tries and I can see it doing it I try to stop it), artwork disappearing and the artwork tab being greyed out in the file information and tracks not playing. All stored on a Synology DS213j...

Feb 22, 2014 10:57 AM in response to Peter Deslandes

No, I didn't, but after trying Plex (kinda crappy compared to iTunes organization), I rebuilt the iTunes library and unchecked the option on the Advanced tab in Preferences to let iTunes copy files to the iTunes library when added. This is not an elegant solution because you have to organize your files and folders yourself, but it has stopped iTunes from throwing stuff all over the place. I did this about a week ago and haven't seen any issues as of yet. Hope this helps.

Feb 23, 2014 4:25 AM in response to SMB-IL

Thanks for the reply - it's helpful, for sure.


In some ways I don't mind when iTunes stores the files, but the fact they get corrupted at the same time is really annoying when much of it was ripped from CDs now in many boxes in my attic :(


I took a Synology firmware update the other day that mentioned a Mac / SMB 2 compatibility improvement but it's impossible to know if that's the issue and / or if Apple or Synology are responsible for the problem...


Thanks again :)

Feb 23, 2014 8:19 AM in response to Peter Deslandes

I never used to, but when in doubt, I always blame Apple. After Jobs died, it seemed Apple became like every other technology company to get software and hardware out the door and let the users be beta testers. It's really annoying! Out of all the "fan-boy" Apple products I used to own, all I have left is the Mac mini for home theatre and an iPad. Meh, times and products change, what are you gonna do? Good luck with iTunes and it's corrupting ways! :)

Apr 2, 2014 4:54 PM in response to SMB-IL

I called Apple and payed for the call last night for a similar issue. Storing my music on Synology. Suddenly many files are corrupt. I select one song to play and a completely different song starts up. If I go directly to the file and play with quicktime, it shows the file has changed (right label....Yes....but wrong music....classical).


Apple had no solution. Said Itunes couldn't possible do that. Also Imatch wouldn't cause the problem.


Trying now to recover the music from my Classic Ipod using Houdini software to see the hidden files. Not sure this will work.


Not sure if this is a Synology problem, but I have an extra Mac, so will probably start storing music there and backing up to Synology.....not the way it is supposed to work. But I'm not sure I can blame Apple for such bizarre behavior.

Jun 19, 2015 3:31 PM in response to pej5000

Did anyone ever find a resolution to this? I've been told not to store my iTunes library on a NAS, but seriously... local storage of all this media? This isn't Apple's style.


I find it hard to believe they are ignoring the issue. I've had it happen a couple of times, this last one had me spending days to fix my library.


It seems easy to restore matched and purchased media - just delete it and re-download from Match. However, uploaded files get jumbled and inserted into other media or albums and sit there hidden until I go album by album looking for uploaded songs in the midst of matched songs, play them, realize they are not what iTunes says, then have to fix manually.


What could possibly cause iTunes to just jumble all the files like that. The metadata was all correct. The file structure was all correct. (I have a copy of my old iTunes music folder structure which is helping me with the repair)


I don't want to find another tool, and I can't store all this media locally.. I've spent a ton of $ on multiple Sinology disk station NAS devices with multiple drives mirrored for protection - I'm not going to try replace those with some local drive (mirrors aren't big enough so I'd have to spend over $1000 for a multi-drive solution and even then would not fit my music and video library)


This is ridiculous.

Jun 19, 2015 7:44 PM in response to lundejd

I do not have a NAS but from my reading online this is my understanding: I believe NAS work by acting as a secondary interface between the computer and the external drive, basically the S=server component. Sometimes the drive is even in NTFS/Windows format which Macs normally cannot use. You are at the mercy of the firmware used to translate between the Mac's file system and whatever is used by the NAS. iTunes on its part feels free to throw at the NAS whatever file and path name structures it generated from the album track information, including any weird and wonderful characters present, and if the server can't handle those 100% you get unexpected things happening. Apple makes a NAS in the form of Time Capsule and the ethos is probably if you buy third party you are walking on the wild side. Like it or not it is expected third party do all the legwork in making sure their devices meet Apple's specifications, not that iTunes works with somebody else's NAS.


Normal external hard drives work. Isn't that local?

Jun 20, 2015 4:36 AM in response to Limnos

I somewhat understand where you are going, but being in IT I see thousands and thousands of instances of companies that can keep a database from going corrupt when losing contact with a disk, or using standard protocols such as SMB or even AFP.


My understanding is most of these issues happen when the NAS becomes unavailable/disconnected/unmapped. Why would iTunes just garble its own database if it can't see the files? What stops this from happening via local attached disk if it were to go offline (I've had plenty go bad)


Find me a 5 disk locally attached NAS thats as cost effective as my Synology and it becomes an answer I might entertain.


I'm not saying Apple is going to read this and do something about it, but the idea iTunes can't keep its database from corrupting regardless of whats going on is a bit ridiculous. I can try make changes to accommodate bad code but I can't excuse it because of something like a NAS manufacturers compatibility... there are just too many similar systems out there that don't exhibit this type of behavior.

Jun 20, 2015 6:08 AM in response to lundejd

Without somebody doing a careful and systematic analysis of what is going on it is hard to tell where the error lies. It could also be the NAS is feeding back some code that is causing iTunes to misinterpret what is being fed to it and corrupting the database. It could even be happening because of media file characteristics. When you play a track iTunes re-reads the metadata in that file. I am guessing here but let's say that metadata has some character that the NAS has problems interpreting and sends it back to iTunes as a line feed so the middle of the first string of metadata becomes the next line in the database. I am just making a wild guess here and do not have a NAS so if somebody really wants to analyze what is going on it may take some very careful documentation. I suspect neither Apple nor any NAS manufacturer is testing to that degree.

Jun 20, 2015 6:31 AM in response to Limnos

I suspect there are too few users (as of today) storing their music on a NAS but would guess this will only grow. Hopefully it gets addressed at some point. If it were me, I'd have iTunes just lock down any song's metadata if the physical file became unreachable.


Its not such a huge deal with my music library. I can fit it onto my iMac hard drive, at least for now. Hopefully backing it up from this single point of failure will be sufficient vs. storing it on a NAS that has better fault tolerance. This won't work for my video library.


The odd thing is how so much of the music gets garbled in just seconds. I believe this has happened to me when my NAS drive became unavailable due to network issues, and once because my computer locked up and I had no choice but to power it down (with iTunes still loaded). I think another case happened where iTunes was automatically loaded up upon startup before the NAS had a chance to map.


I spent the good part of a week fixing my library after the last disaster. ~13k songs, and I had to go album by album looking for songs that were "uploaded" or duplicate vs. matched. This is the clearest sign I have corrupted files. Most interestingly they happen to albums that are "live" recordings or older albums that may never actually match. They get injected into other albums randomly - sometimes with a very similar sounding artist, often the same artist, but once in a while completely random artists. The odd ones are when a song gets mapped to a directory, hidden file or a video... often from locations on completely different NAS devices nowhere near related to the iTunes media location. I have to take note of the incorrect albums, delete the uploaded files from iTunes and locally, then remember to re-import those albums. Most of the metadata is completely wrong with the exception of the album art.


(interestingly enough this never was an issue when I kept my music in folders of my choosing and didn't let iTunes import/organize them.)


I still have to now go through all my songs that are not matched, play each one to be sure the song is correct. I'm guessing with thousands of such files it will take me the rest of the weekend. I would guess after all this work my library will still only be 95% to where it was prior to the last corruption..


Why didn't I just restore from backup? Good question. For some reason (guessing because I have iTunes open 24/7) both my Time Machine backups and my Crashplan backups did not include the .itdb or .xml files. I have since made sure I close iTunes and copy those files off separately to be sure they get backed up.


One would have thought completely deleting the local library and re-downloading from iTunes Match would be the ultimate fix, but somehow Match inherited the corrupted file information so it was wrong both locally and in the cloud.

Jun 20, 2015 8:59 AM in response to lundejd

As you have observed it has gone on for years and likely will continue to do so. We don't know if it is iTunes or if it is the NAS. We are not permitted to discuss or speculate on Apple's policies on the ASC web site but I personally would not wait for Apple to contact Synology suggesting they set up a joint team to work on this. Likely if you ran everything from a Time Capsule you would not have problems and working out issues inside the Apple line of products as far as the network interface doorstep is likely as far as support will go. Something is probably happening at that data hand-off or inside the NAS that is resulting in things not being presented to iTunes exactly as it demands and then iTunes gets messed up. I only read of this kind of radical database mess-up in connection with using a NAS so I am inclined to think it is more a problem with the NAS since data hand-off seems to work fine with plain external hard drives of third party manufacture.

Jun 20, 2015 9:28 AM in response to Limnos

Well I'm a huge Apple fan and spend lots of $ with them (and will continue to do so) but can't excuse sloppy programming on NAS devices alone. I'm sure there is some truth to what you are saying, but it takes two... and like I said, I'm in IT and have never seen a database act this way when connecting to remote data.


But the solution is clearly not to use a NAS. Its just unfortunate iTunes is so flakey in so many ways.. even worse, there are many who will continue to move toward NAS in the home and will run into this unfortunate corruption on their own. For their sake I hope their libraries are much smaller than mine.


I'll be at Apple HQ in a month or so and will have a chance to meet with a lot of people in charge of vendor relationships and will bring this up if I get a chance and see what they say. We have a few sessions specifically around Apple's interaction and relationships with 3rd parties like Microsoft, Dropbox etc.

iTunes Corrupting Library File on NAS

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.