George Garside Blog

If you find something useful on here, it's probably an accident.

This is a fairly common error taking many forms, shown when opening a photos library with the Photos app. Your library is most likely still intact and your photos still stored safely. Just because Photos can’t automatically repair the library on launch doesn’t mean it is unrecoverable. Here's some steps you can take to recover your photos.

Photos library could not be opened

The library could not be opened.
Photos has attempted to repair the library Photos Library.photoslibrary but is unable to open it.

The most common cause of this is a permissions problem. Not necessarily that you don't have the permission, as Photos will prompt for administrator permissions if that's simply the case, but that permissions can't be obtained, even with administrator. For example, if the library is open elsewhere: on another Mac on the network, for example.

If that didn’t fix it for you, you can manually try repairing the library. If it’s a permissions problem, Photos.app doesn’t like to ask for administrator privileges automatically, instead just saying that Photos attempted to repair the library but is unable to open it without actually trying to repair it. You can force Photos to try to repair the library by holding ⌥option and ⌘command whilst launching Photos. Photos.app will try to repair the library and it may ask you for administrator privileges.

Photos library could not be created

Photos could not upgrade your library because it is on an unsupported disk volume

This error is likely due to an incorrect partition format, such as NTFS which can't be written to. Photos requires write permission to create a library or to migrate a library from iPhoto. You can fix this by copying the library to somewhere where you can write to, such as your ~/Pictures directory — the default location for photos in your home folder.

Using Console.app for error research

For more information on an error message shown in Photos like this, open Console.app, in /Applications/Utilities/ and search for “photos”. This can be extremely telling in what the problem is. For example, in my case, the important lines here is that photolibraryd “failed to open library” with an error message:

photolibraryd: Failed to open library Photos Library.photoslibrary Error: Error Domain=com.apple.lithium Code=54 “locked by remote host” UserInfo=0x7fafbbb48d90 {NSURL=file:///Volumes/Server/Shared%20Folders/Photos/Photos%20Library.photoslibrary/database/metaSchema.db.lock, NSLocalizedDescription=locked by remote host, NSLocalizedFailureReason=locked by host georgegarside.com}

The important content here is why the library failed to open. Here, the problem is that the library is “locked by remote host” which means that the library is open somewhere else on the network, as specified by the NSLocalizedDescription. The NSLocalizedFailureReason also includes the hostname of the Mac on the network which has locked the library—in this case, the device with the hostname of georgegarside.com. If you find that messages in the Console are hidden as <private>, you may need to set the Console privacy level to see private logs.

The solution to this issue: close Photos.app on the other Mac, or open a different library on that Mac if there are multiple libraries available.

Console.app Photos.app