You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Photos.app fails to repair its photoslibrary on external drive

I have my photoslibrary on an external (HFS+ formatted) drive.

Yesterday, I was preparing a movie with iMovie, using videos in Photos.photoslibrary. I quit iMovie and Photos, and need to unplug my external drive to get moving, but standard eject did not succeed (device busy). I really had to leave, and thus hat to force eject before unplugging.


Today, when opening my photoslibrary, Photos.app complains that the library is corrupted and needs repairing. I click "Repair", but 1 second later, a new dialog box appears warning that the library is incoherent and needs repairing.

I click the only possible button "Repair", and the dialog box reappears 1 second later.

I click the only possible button "Repair", and the dialog box reappears 1 second later.

I click the only possible button "Repair", and the dialog box reappears 1 second later.

...

My library is 190Gb fat, so it may take a while to repair. So I check the CPU and file activity of Photos.app and photoslibraryd: none (if I stop clicking in the Dialog-Repair loop).

Quitting Photos doesn't work.

Force-quitting Photos of course works, but (logically) does not help.


What can I do???


If it was photoslibraryd that was preventing disk ejection, and created the mess, how can I know how long I will have to wait for such a daemon to finish its work?


Posted on Feb 11, 2019 7:59 AM

Reply
Question marked as Top-ranking reply

Posted on Feb 16, 2019 6:10 AM

Copying the library on another HFS+ formatted hard disk solved the problem.


The problematic library was on a disk also used for Time Machine backups, and this is probably what made the database file

/Volumes/JoMaxHfs/Photos-Library-main-exp.photoslibrary/database/photos.db

inaccessible, don't ask me why...


Anyway, as explicitly stated in footnote 1 of

https://support.apple.com/en-us/HT201517

it's bad to have the Photos Library on a Time Machine drive, although it would be good to have only one disk on the go!!!!


Similar questions

4 replies
Question marked as Top-ranking reply

Feb 16, 2019 6:10 AM in response to Orj

Copying the library on another HFS+ formatted hard disk solved the problem.


The problematic library was on a disk also used for Time Machine backups, and this is probably what made the database file

/Volumes/JoMaxHfs/Photos-Library-main-exp.photoslibrary/database/photos.db

inaccessible, don't ask me why...


Anyway, as explicitly stated in footnote 1 of

https://support.apple.com/en-us/HT201517

it's bad to have the Photos Library on a Time Machine drive, although it would be good to have only one disk on the go!!!!


Feb 11, 2019 8:24 AM in response to Orj

The library seems pretty screwed up and I am really scared!!!


PowerPhotos "could not determine the version of library ..." and "Could not determine the database schema of the library ...".


photoslibraryd error log on opening the library is:


Failed to open library Photos-Library-main-exp.photoslibrary Error: Error Domain=com.apple.lithium Code=305 "Database error." UserInfo={NSFilePath=/Volumes/JoMaxHfs/Photos-Library-main-exp.photoslibrary/database/photos.db, NSLocalizedDescription=Database error., NSLocalizedFailureReason=Schema could not be read.}


And each click on the "Repair" dialog box generates:


Fatal SQLite error 6922 (Error Domain=com.apple.lithium Code=304 "Database error : disk I/O error" UserInfo={NSLocalizedDescription=Database error : disk I/O error, SqliteErrorCode=6922}) for LiSqliteDb<0x7ff697f5dc90>: /Volumes/JoMaxHfs/Photos-Library-main-exp.photoslibrary/database/photos.db with callstack: (

0   photolibraryd                       0x0000000107a709c1 __24-[LiServiceLibrary init]_block_invoke + 272

1   photolibraryd                       0x00000001079b2b23 -[LiSqliteDb handleSqliteError:code:] + 182

2   photolibraryd                       0x00000001079b2bc3 -[LiSqliteDb handleSqliteErrorCode:] + 97

3   photolibraryd                       0x00000001079cec6a -[LiSqliteDb(RidListModule) createRidListVirtualTable] + 328

4   photolibraryd                       0x00000001079b3aa2 -[LiSqliteDb openPath:asReadOnly:create:attemptJournalCleanup:error:] + 2351

5   photolibraryd                       0x0000000107a71137 -[LiServiceLibrary openDatabaseWithSchema:migrateTables:error:progress:] + 989


Library is being relinquished (sendToAll=1) at path /Volumes/JoMaxHfs/Photos-Library-main-exp.photoslibrary


Failed to open library Photos-Library-main-exp.photoslibrary Error: Error Domain=com.apple.lithium Code=304 "Database error : disk I/O error" UserInfo={NSLocalizedDescription=Database error : disk I/O error, SqliteErrorCode=6922}

Feb 16, 2019 10:44 AM in response to Orj

The problematic library was on a disk also used for Time Machine backups, and this is probably what made the database file
/Volumes/JoMaxHfs/Photos-Library-main-exp.photoslibrary/database/photos.db

inaccessible, don't ask me why...

The problem is, that on macOS 10.14 Mojave the Time Machine drives have a special protection, so Photos will encounter permission and file-ownership problems when trying to access a Photos Library.

But anyway, if you keep your Photos Library on your Time Machine drive, you cannot include it into your Time Machine backups, and surely you will want to make backups of your Photos Library.

Photos.app fails to repair its photoslibrary on external drive

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