Music stuck while saving library

I recently backed up my external drive (which has my music files (about 82000 songs (802.72 GB)) (the Music Library.musiclibrary is on my internal drive), reformated to AFPS, changed the drive name and then copied my music files back to the external drive. When I go to open Music, it sees all of my songs and playlists, but is not able to find any of the files if I click on any song. when I try to play any of the songs, it tells me that it can't find the song and would I like to locate it. I locate the song and then it asks if I want to locate the other missing files. I click yes to locate the missing files and after about an hour, it tells me that it found all 82k files. Great. I can then play all of these files and everything seems normal.


When I quit Music, it then starts saving the Music library.......but, it just sticks on that - nothing ever happens. I can see that the Music Library.musiclibrary file is modified at the time that I found the missing files. Because it never manages to save and quit, so I do a force quit, restart the computer and then when I open Music, I'm right back where I was - it can't locate the files.


Keep Music Media folder organized is NOT checked

Copy files to Music Media foler when adding to library IS checked


How can I resolve this?

MacBook Pro 16″

Posted on Aug 29, 2023 10:55 AM

Reply
Question marked as Top-ranking reply

Posted on Sep 3, 2023 6:12 AM

Try holding down option+cmd when launching Music to open the app in its safe mode, rather than the computer's safe mode. Apologies if that is what you've already tried.




It may help to set the correct media folder, then repair links in batches of a few thousand at a time, using the tool described below, saving the library each time.


Alternatively things might workout better if you move the active .musiclibrary package into the parent folder of the media folder on the external drive and option-start-Music to access it on that path.




The "missing file" issue with exclamation marks happens if the file is no longer where iTunes or Music expects to find it. Possible causes are that you or some third party tool has moved, renamed or deleted the file, one of its parent folders, the drive it lives on has had a name change, or you've moved a non-portable library to a different path (see Make a split library portable for details). It is also possible that iTunes or Music have changed from expecting the files to be in the pre-iTunes 9 layout to post-iTunes 9 layout, or vice-versa, and so is looking in slightly the wrong place, (see the iTunes Media Organization section of Managing your Mac media libraries - Apple Community for details) or that you've been too aggressive when deleting duplicates at some point.


Select a track with an exclamation mark, use Cmd-I to get Song Info, then click No when asked to try to locate the track. Look on the file tab for the location the library thinks the file should be. Now take a look around your hard drives. Hopefully you can locate the track in question. If a section of your library has simply been moved, a folder renamed, or a drive label has changed, it should be possible to reverse the actions. If the difference between the two paths is an additional Music folder in one path then this is a layout issue. I can explain further if that is the case. If everything is where it is supposed to be try Repair security permissions for iTunes for Mac - Apple Community.


In some cases the library may be able to repair itself if you go through the same steps with Get Info, or when playing a track, but this time click Locate and browse to the lost track. It may then offer to attempt to automatically fix other broken links. Although it says something like "use the same location" I think it expects to find the tracks in the same artist & album layout they were in previously, with one systematic change to the path.


If you want me to try to provide specific advice please post back the following details:

  1. The location of the media folder under iTunes|Music > Preferences > Advanced
  2. The location of a sample missing track shown under Song Info > File > Location that begins file://
  3. The true path to the file whose details you gave in 2



See also FixLinks - an AppleScript to repair broken links in Music - Apple Community.



tt2

Similar questions

10 replies
Question marked as Top-ranking reply

Sep 3, 2023 6:12 AM in response to S Bowen Anderson Jr

Try holding down option+cmd when launching Music to open the app in its safe mode, rather than the computer's safe mode. Apologies if that is what you've already tried.




It may help to set the correct media folder, then repair links in batches of a few thousand at a time, using the tool described below, saving the library each time.


Alternatively things might workout better if you move the active .musiclibrary package into the parent folder of the media folder on the external drive and option-start-Music to access it on that path.




The "missing file" issue with exclamation marks happens if the file is no longer where iTunes or Music expects to find it. Possible causes are that you or some third party tool has moved, renamed or deleted the file, one of its parent folders, the drive it lives on has had a name change, or you've moved a non-portable library to a different path (see Make a split library portable for details). It is also possible that iTunes or Music have changed from expecting the files to be in the pre-iTunes 9 layout to post-iTunes 9 layout, or vice-versa, and so is looking in slightly the wrong place, (see the iTunes Media Organization section of Managing your Mac media libraries - Apple Community for details) or that you've been too aggressive when deleting duplicates at some point.


Select a track with an exclamation mark, use Cmd-I to get Song Info, then click No when asked to try to locate the track. Look on the file tab for the location the library thinks the file should be. Now take a look around your hard drives. Hopefully you can locate the track in question. If a section of your library has simply been moved, a folder renamed, or a drive label has changed, it should be possible to reverse the actions. If the difference between the two paths is an additional Music folder in one path then this is a layout issue. I can explain further if that is the case. If everything is where it is supposed to be try Repair security permissions for iTunes for Mac - Apple Community.


In some cases the library may be able to repair itself if you go through the same steps with Get Info, or when playing a track, but this time click Locate and browse to the lost track. It may then offer to attempt to automatically fix other broken links. Although it says something like "use the same location" I think it expects to find the tracks in the same artist & album layout they were in previously, with one systematic change to the path.


If you want me to try to provide specific advice please post back the following details:

  1. The location of the media folder under iTunes|Music > Preferences > Advanced
  2. The location of a sample missing track shown under Song Info > File > Location that begins file://
  3. The true path to the file whose details you gave in 2



See also FixLinks - an AppleScript to repair broken links in Music - Apple Community.



tt2

Sep 4, 2023 6:07 AM in response to S Bowen Anderson Jr

Put the active library back on the external drive in the same folder as the media folder. Open Music, check that it can find the tracks, close Music. Change the name of the drive. Open Music and check that it can still play everything. Personally I'd leave the library file on the external drive. This avoids an issue if you ever open the library while the external drive isn't present which will silently reset the media folder to Media in the folder where the .musiclibrary file lives.


tt2

Sep 2, 2023 2:52 PM in response to S Bowen Anderson Jr

If I open Music in safe mode, without locating the files, it quits normally. 


If my external drive with the music files on it is connected, Music hangs on Saving Music Library.  If the external drive is not connected (I forgot to turn it on before starting Music, for example), it shows in Music's preferences that the Music files are on my internal drive (which is incorrect) and when quitting, it quits normally without hanging.


If I command-option-open or option-open Music and select my library, it opens normally and quits normally (if I don't try to locate files).  If I try to locate the files, it will find them, but then hangs when quitting.


I have tried throwing away the Music preferences which didn't seem to help, it just reset the preferences configuration.  After resetting it - correct music files location, Keep Music Media folder organized NOT checked, Copy files to Music Media folder when adding to library IS checked - it still either quits normally or hangs depending whether or not I try to locate files or not.


yesterday, I thought that found a way to resolve this - I turned off wifi and tried to locate a song.   I then asked it to locate remaining missing files based on that file's location.  It did not locate "the other 52k+ files (which is strange because there are actually 82k+ files)," but when I quit Music, it did not hang.


I then opened Music again (wifi still turned off), located another file and then asked for it to try and find the remaining missing files.  It found 51k+ of 52k+ files.  When I quit Music, it hung on Saving Music Library and after some hours, I force quit.


I tried several more times..... "Music was able to find 48,858 of 49,737 missing files."  I then quit and then it hangs on Music is Saving Music Library. .....  wifi is still off


Music was able to find 48,858 of 49,737 missing files.

Music was able to find 46,926 of 47,803 missing files.

Music was able to find 46,926 of 47,803 missing files.



The modified time on Music Library.musiclibrary changes show that it changed at the time that I said ok to the dialog box saying that the files were found.  However, every time it hangs.  Perhaps some of these clues might help to understand why this is happening? 

Sep 13, 2023 10:13 AM in response to turingtest2

Hi,

thanks for your response. I managed to resolve it, but honestly, I'm not sure exactly what I did to make it work. I transferred everything to a different external drive and it all worked just fine, didn't even need to locate files or wait for the library to save. When I saw that that worked, I tried again to the drive where I changed the name - no luck! I tried changing the name of the media folder and I changed the integer back to 0. I'm not sure which of those actions had an effect, but it now works (albeit with a new name for the media folder, but now on drive with updated name)! Thanks again for your help and suggestions, it was very, very appreciated!

Sep 3, 2023 10:11 AM in response to S Bowen Anderson Jr

Thank you so much @turingtest2 !!!! I followed your suggestions and was able re-gain access to the Music library, but I'm still stuck with the old name of the external drive....


The modified time on Music Library.musiclibrary changes show that it changed at the time that I said ok to the dialog box saying that the files were found.  However, every time it hangs.  Perhaps some of these clues might help to understand why this is happening? 


I changed the name of the drive back to the original name and upon opening Music, it automatically found all of the files, but when quitting, it hung on Saving Music Library. I then copied the Music Library.musiclibrary to the upper directory of the Music Media folder on the external drive, option opened it and it found all of the files. and, it did not hang when quitting. I then copied the Music Library.musiclibrary file to the internal Music folder and option-opened it. It found all of the files, the original file path seems to have been re-created and I am able to open/close Music and access all songs normally. BUT, the external drive is now the old name.


How can i change the name of the external drive without having this problem in Music again?


Thanks again for your help!!

Sep 6, 2023 10:03 AM in response to turingtest2

Thanks again for your comments. Unfortunately, it didn't work for me. After changing the drive name, I opened Music, located a file and asked it to locate the missing files based on the location of the found file. It found all files and they played back normally, but when i quit Music, it hung on Saving Music Library. the Music Library.musiclibrary file is in the media folder on the external drive. Here are the locations that you requested in an earlier message. It appears that the issue is the extra Music folder that Music thinks is there, but that doesn't actually exist. how can i set this up properly?


  1. The location of the media folder under iTunes|Music > Preferences > Advanced - /EXTERNALDRIVE/Consolidated Music/Music - the actual folder is /EXTERNALDRIVE/Consolidated Music/Music
  2. The location of a sample missing track shown under Song Info > File > Location that begins file:// - EXTERNALDRIVE/Consolidated Music/Music/Music/Peter Bark/Missed Calls/Peter Bark - Missed Calls.mp3
  3. The true path to the file whose details you gave in 2 - EXTERNALDRIVE/Consolidated Music/Music/Peter Bark/Missed Calls/Peter Bark - Missed Calls.mp3


Many thanks in advance!!

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 stuck while saving library

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