Music app can't find songs

The other day, the Music app (iTunes) suddenly couldn't find most of my songs (not subscription songs). I used Time Machine to restore the library file (Music Library.musiclibrary) and that fixed the problem.


The same problem happened today. Maybe my library file is just corrupt. Among the problems I have is that the genre pull-down menu (after right clicking > get info) doesn't work correctly and Music won't move my songs to the correct directory even though organize is set on.


Is there a way to completely rebuild the library?

Mac mini, macOS 12.3

Posted on Apr 12, 2022 5:18 PM

Reply
Question marked as Top-ranking reply

Posted on Apr 13, 2022 3:20 AM

Some things that might be worth trying.

  • Press and hold down Option as you launch Music and use the Choose Library option to reselect your library, typically ~/Music/Music/Music Library.musclibrary.
  • Close music then press and hold down Option+Cmd as you relaunch Music. This will open Music in a safe mode that may allow it to fix any internal errors with the database.
  • Turn Home Sharing off, then back on again if you actually use it.
  • With Music closed right-click on Music Library.musclibrary package and use Show Package Contents. Remove any .tmp files inside.


tt2

Similar questions

11 replies
Question marked as Top-ranking reply

Apr 13, 2022 3:20 AM in response to Orsage

Some things that might be worth trying.

  • Press and hold down Option as you launch Music and use the Choose Library option to reselect your library, typically ~/Music/Music/Music Library.musclibrary.
  • Close music then press and hold down Option+Cmd as you relaunch Music. This will open Music in a safe mode that may allow it to fix any internal errors with the database.
  • Turn Home Sharing off, then back on again if you actually use it.
  • With Music closed right-click on Music Library.musclibrary package and use Show Package Contents. Remove any .tmp files inside.


tt2

Apr 13, 2022 6:41 AM in response to Orsage

I should have said: Some things that might be worth trying after restoring the library once more.




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, 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



Apr 13, 2022 4:32 PM in response to Orsage

Music reads the details from the embedded tags in the files. That data generally comes back when you import tracks into a new library. The exception is tracks in .wav format that don't have tags. These will normally import as <Unknown Artist>/<Unknown Album>. I've recently written an AppleScript to update details from the path if required. What is also lost when you pull music into a new empty library are ratings, play counts, playlists, etc.


tt2

Apr 14, 2022 7:36 AM in response to Orsage

I would normally let Music do it, via the Copy files... option which makes local copies inside the media folder of anything you add, or by copying files into the Automatically Add to Music folder inside your media folder. And although I personally organize things manually, or rather with scripts, I usually recommend others to let Music do its Keep organized.. thing. It is only if you know there is a mismatch between the tags and the physical layout, or that you have .wav tracks that have details that would otherwise be lost, that you would need to use turn off the Keep & Copy options before adding to the library so that you can make use of the TagFromFilename script, then turn them back on again and consolidate the newly updated tracks.


tt2

Apr 14, 2022 12:58 AM in response to Orsage

If you've reason to think you might have useful information encoded in the file path rather than in tags for some tracks then turn off the option to Keep organized... before you add tracks to the library, then see TagFromFilename to import these details. Even when the right information is there Music can still do odd things with it, sometimes treating a single album as if it is two or more. See Grouping tracks into albums for advice if needed.


tt2

Apr 13, 2022 4:35 PM in response to turingtest2

I can live without ratings, play counts, playlists, and genres, but trying to reorganize the artists and albums yet again would be a nightmare. I've got things pretty well organized by artist name > album since I took everything from the Music folder.


What's the easiest way to get the songs reimported as artist > album? Try an import and fix anything that doesn't get organized correctly?

Apr 14, 2022 6:49 AM in response to turingtest2

Those are some powerful scripts, thank you.


My plan was to still let Music copy my files over to the Music directory, but I think what you're saying is to manually manage that part myself.


So when I want to add more songs after my library is rebuilt, should I manually add my songs to my managed directory and then import into Music with "Keep organized..." and the "Copy files to Music Media folder when adding to library" options deselected?

Apr 13, 2022 4:22 PM in response to turingtest2

Thank you. I wasn't able to restore the library this time. I've decided to give up and start over.


Most of my artists are under ... Music, but quite a few are under ... Music > Music, some of which are in the main Music folder. It's just a big mess, so I moved my songs to a completely different folder and I'm manually reordering.


If I start from a blank slate and tell Music to import, will it read the artist and album names correctly from the folders?

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 app can't find songs

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