Music hangs on Saving Music Library

This question has been posted before many times and never successfully answered. This is specific to Music.app with local files. Apple Music is turned off.


For context, my old iMac running Catalina with Music 1.0.6.10 has no problem with my music library which has about 275,000 tracks in it. (I work in radio so I have a lot of music).


This problem crops up when I try and restore/convert the Music to a new machine running Ventura.


Music seemingly hangs on quitting, showing "Saving music library..." for a very long time or forever. I've lost track after 24 hours and then force quit it. However, I find that when it's force quit, when it opens again, it has lost the location of my files.


If I get info on a song, I can see the path where it thinks the file is. But if I look on the disk, that file doesn't exist, BUT there is a file with the same name with the track number preceding it. So "Keep Organized" has updated the file name to include the track number, but the iTunes database didn't get saved after updating.


Songs that didn't have a track number in their info field are still found.


I've repeated this many times by restoring backups and trying again.


When I let the "Saving music library..." box do it's thing after 10 hours, I go and look at modification times for the files inside ~/Music/Music/Music\ Library.musiclibrary nothing has been updated.


This leads me to think it's a bug in the code that's causing this hang, and that it's related to "Keep Library Organized" and for some reason, the Music database isn't getting updated.

Posted on Jan 17, 2023 5:09 PM

Reply
Question marked as Top-ranking reply

Posted on Jan 20, 2023 7:38 PM

I was having the same problem after having moved my library on my NAS. I ended up restoring my library from Time Machine back to my laptop but was still having the same problem so turned off Keep Music Media folder organised and left Copy files to Music Media folder when adding to library on. After restarting Music, everything is now working smoothly again. I think it was the automatic file renaming and organising that was causing the problem and it really made a mess of the files on the NAS with albums being split across folders, moved to Collections or even disappearing completely. I will try to copy a clean library back to the NAS but will manually do any file renaming or organisation in future.

Similar questions

20 replies

Jan 18, 2023 6:11 PM in response to turingtest2

In Safe Mode, it took over an hour for Music to "keep files organized", but now when I got to quit, it hangs again.


I did confirm by scanning the file system that it did rename everything at the file system level. Historically, if I force quit now, and restart, the library will be pointing to the old, pre-renamed files.


So unfortunately, that hasn't fixed it. The .musicdb isn't getting updated.


I'll let it continue to run overnight on the off chance something changes.


I've been saving "Samples" of the process from Activity Monitor, and will submit those with a big report to Apple.


@turingtest2 do you know of any tools to let you dump (or ever write to) the .misicdb database?

Jan 19, 2023 2:46 PM in response to Rusty SomaFM

I thought I found the culprit: I was able to open the library and before saving, turned off "Keep Music Folder Organized". At that point, it seems to be able to quit properly. However the next time I launched it, the Keep Files Organized got turned on again somehow, and as I played songs, it renamed them. And after doing that with about 25 songs, when I now quit, it hangs again.


So I loaded a fresh clone of the original library again, opened it, turned off "Keep Music Folder Organized" again, played some files to let them update the last played times in the database, then quit. AND IT HANGS again.


So something is causing a hang when the database changes and it seems tied to the Music Library database being on an external drive.




Jan 19, 2023 11:39 AM in response to turingtest2

Thanks for the offer, but I have actually done all you suggest before. Problem first discovered when moving to Monterey (and tested on brand new machine / clean install).


One thing I didn't try yet is converting on a Big Sur machine. The other thing I'll try is moving it to a new virgin Catalina install on another machine, and confirming has the normal 'addTrackNumber' preference setting and doing the force music library organization there.


(By the way, for those following along at home, after 24 hours the Ventura machine was still stuck on the "Saving Music Library" alert)


I'll keep everyone posted to what I discover.


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Music hangs on Saving Music Library

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