Mac Photos - Corrupted File in Library?

I have a strange problem. Thought I would give it a shot.


I had a 2015 MacBook Pro. I was using iCloud Photo Library. Suddenly, about a year ago, the library was just constantly corrupted. It would not sync to iCloud, repairing and restoring it never worked. Everything worked fine on my iPhone and on the iCloud website. So I just basically didn't use Photos on my Mac for a year.


I recently bought a 2022 MacBook Air. Set it up from scratch, no restoring from Time Machine. Photos was working fine for a week or so but, all of a sudden, it's doing the same thing on my new computer. Library keeps corrupting. When it corrupts, it will not sync to iCloud. I cannot import photos (Dragging a JPEG into Photos says there is an error and the file cannot be imported). Trying to repair and restore is taking forever and, once it finishes, the same thing inevitably happens and it corrupts again.


There has to be some actual file in my library that is causing the corruption, since it has happened on two completely different machines running two different versions of Mac OS. But I have 28,000+ photos so where do I even begin?


What could possibly be happening that is causing this? I would recreate the library with a new system library but if there is a file that is causing it, that would seem like a solution unlikely to work.


ANY help would be greatly appreciated!

MacBook Air, macOS 13.0

Posted on Dec 12, 2022 08:31 PM

Reply
Question marked as Top-ranking reply

Posted on Dec 13, 2022 09:06 AM

So many things to check! First, where is this library? Is in the Pictures folder, or is it on an external hard drive? If so, how is this drive formatted. For it to work with Photos, it must be formatted as "either APFS format or Mac OS Extended (Journaled) format." Also "You can't store your library on a storage device used for Time Machine backups." Nothing else will give complete functionality.


Try these steps:

  • Restart the computer (of course)
  • Rebuild your Photos Library--close Photos and re-launch by option-command-clicking the app icon. (Sounds like you tried this)
  • Make a new user and see if the same problem recurs with it
  • Use another library if you have one, or make a small test Library with a few pictures in it and see if the same thing happens.
  • Start in Safe Mode (different for different computers) This bypasses certain potentially disruptive processes.

  Start up your Mac in safe mode - Apple Support 


One of these steps may fix the problem, but their failure to work is also diagnostic.


As always, you should make a backup of the library before messing around!

Similar questions

14 replies
Question marked as Top-ranking reply

Dec 13, 2022 09:06 AM in response to rdkrauss

So many things to check! First, where is this library? Is in the Pictures folder, or is it on an external hard drive? If so, how is this drive formatted. For it to work with Photos, it must be formatted as "either APFS format or Mac OS Extended (Journaled) format." Also "You can't store your library on a storage device used for Time Machine backups." Nothing else will give complete functionality.


Try these steps:

  • Restart the computer (of course)
  • Rebuild your Photos Library--close Photos and re-launch by option-command-clicking the app icon. (Sounds like you tried this)
  • Make a new user and see if the same problem recurs with it
  • Use another library if you have one, or make a small test Library with a few pictures in it and see if the same thing happens.
  • Start in Safe Mode (different for different computers) This bypasses certain potentially disruptive processes.

  Start up your Mac in safe mode - Apple Support 


One of these steps may fix the problem, but their failure to work is also diagnostic.


As always, you should make a backup of the library before messing around!

Dec 14, 2022 06:06 AM in response to rdkrauss

Are all your photos in iCloud?


Then you can rebuild your Photos Library by downloading a fresh copy from iCloud.

  • Create a new, empty photos Library by starting Photos with the option key ⌥ held down. Release the options key when the dialog to select a library appears and select to create a new library.
  • Make the new library your system photos library ( Photos > Settings > General >Use as System Photos Library)
  • Make the new library your iCloud Photos Library ( Photos > Settings > iCloud).
  • Now wait for the photos to download from iCloud back to your Library.

This will give you a fresh copy of your library, including only items that are compatible with iCloud Photos. Keep a copy of your current library on an external drive, so you can compare the new library to the old library and find out, which photos did not make it to iCloud.


Also. downloading into a new library will be faster than repairing the old library and having to wait for it to upload again into iCloud.


Dec 13, 2022 08:22 PM in response to Richard.Taylor

Thank you so much for your reply.


The library is in the Photos folder, where it gets placed by default.


Restarting has not worked, unfortunately.


Repair/Rebuild/Restore does not work because it always hangs and freezes and crashes during the sync process. (I've started saving the crash logs. Not that I understand them but in case I need to send to Apple.)


I have not tried this. If I make a new user, can I still log in to my same iCloud account as in my main user? All the photos are in iCloud Photo Library.


I tried this and the new library worked fine. I was not able to use it with iCloud though, since it was not my System Default Library.


I have not tried this. Could booting in Safe Mode and then Rebooting in regular mode actually fix it? Should I boot in Safe Mode and open Photos and see what happens?


I so appreciate your help. Would love any more feedback or ideas!


Dec 13, 2022 08:50 PM in response to Richard.Taylor

So I booted into Safe Mode and did a repair on the library. The repair and restore went much faster than in regular mode. Photos opened and seems to be trying to sync everything but it looks much better (so far) than it does in normal mode. I’m going to leave it overnight and see what happens and whether or not it crashes again.


So…jumping ahead. What if everything works perfectly in Safe Mode? What does that mean about the underlying problem?

Dec 14, 2022 05:24 AM in response to rdkrauss

An update...


In Safe Mode, it repaired and restored and fully synced the library in less than an hour. I tried adding files from my Mac and my iPhone and everything seemed to work.


I booted the computer back into Normal mode, and the library is intact, in that it synced all photos. But I cannot import photos to my Mac (it says unrecognizable file format). I cannot delete photos from my Mac. If I click delete photo and confirm, nothing happens. If I try to "Favorite" a photo on my Mac, nothing happens.


So the library seems corrupted again within the first few minutes. What do you think??

Dec 14, 2022 07:08 AM in response to rdkrauss

The advantage would be, that only items that are not causing any problems could come back from iCloud. There cannot be any incompatible legacy items in iCloud, so you do not have to track them down. But if you keep using the same library year after year, you will just carry the hidden landmines from Mac to Mac. Downloading from iCloud will save you the trouble of testing all items for compatibility to weed out damaged and incompatible items.


Dec 14, 2022 09:33 AM in response to rdkrauss

Maybe. Try it. It can't hurt. Just keep a backup!


Have you used any system-wide 3rd party software, like CleanMyMac, or anti-virus stuff, or anything like that? That stuff will potentially screw up intricate databases like Photos.


Go to System Preferences>Users & Groups and look at Login Items. Do you have stuff there? One of the things Safe Mode does is cancel the loading of these things. If you liked what you got in Safe Mode, get rid of these things. They could be the cause of your problems.

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.

Mac Photos - Corrupted File in Library?

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