How can I repair the Music Library file?

The other day, hours before a major party where I had promised to contribute a major dance playlist, the Music app on one of my Macs started to deteriorate. First, I suddenly couldn't add songs to playlists. I dragged them or used the dropdown, but it was always followed by "An error occurred". Then, songs I had already added started to disappear from the playlist. I tried turning iCloud music library off and then back on, no difference. I tried restarting both the app and the Mac, only resulting in that Music eventually started crashing immediately after launching it. Every time.


I tried safe mode, no difference. I logged into another user account on the same machine and there, Music worked as normal. But back on my account, a crash every time.


I'm pretty sure the Music Library file is corrupt.


As I had the previous days re-imported hundreds of CD:s, replacing AAC versions with lossless ones (using Copy Track Info to CD Tracks from Doug's AppleScripts), going back to an earlier version using Time Machine is nothing I want.


So, now what? Any ideas?

MacBook Pro

Posted on Oct 18, 2021 2:52 PM

Reply

Similar questions

5 replies

Oct 19, 2021 3:45 PM in response to Jan Renell

OK, a bit of an update: to be able to do anything, I dragged the Music Library file out of its folder and to the desktop. Launching the Music app not only worked, everything seemed pretty fine (apart from the last 20 or so additions to the playlist I was working on when everything went south).


A new Music Library file has been created, as expected, but populated with data from what? I haven't verified almost anything yet, but so far, so good.


The old Music Library file was 76,2 MB, the new one is just 659 K (but is growing as I write). What's missing and where....?

Oct 19, 2021 11:40 AM in response to Jan Renell

Hello there Jan Renell,



Thanks for posting here on the Apple Support Communities! This is a place where other Apple users can submit questions or respond to others to help lend a hand. Let's take a closer look as we do our best to provide some additional insight.


We understand you're having issues with your Music Library. To get started, what macOS version do you currently have on your Mac? Since specific troubleshooting steps differ from version to version, and going from iTunes to the Music app, this helps us further focus our troubleshooting.


Otherwise, if you're using the newer Music app, go to Music Preferences > Files > Keep Music Media folder organized. Try toggling that and ensuring that is enabled.


If that doesn't help, restoring from a prior restore point using Time Machine would be your best bet: Restore your Mac from a backup



We hope this helps get you pointed in the right direction.


Take care.

Oct 19, 2021 12:44 PM in response to Nicholas_B2

Thanks for replying! I'm running Big Sur 11.6.


Unfortunately, using a Time Machine copy is not an option. Although the backup are just days old, maybe 80% of both local and cloud songs where replaced from re-imported CD:s in that time. Just putting the old Music Library file back would probably cause chaos when so many files are different (I also corrected song titles and such after the re-import). And bringing the whole Music (e.g. Itunes Media) folder back would mean losing all of the recent work (hundreds of CD:s).


I'd like to toggle the "Keep Music Media folder organized" switch, but Music crashes before I can do much. After launch, it gives me a pop-up saying it's checking the library, the status field shows "updating cloud music library" (translated from Swedish) with the throbber spinning. Then it crashes. I've tried, but I can't get to the toggle before that happens.

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.

How can I repair the Music Library file?

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