How to fix Photos error while trying to open iPhoto library from external hard drive "Photos was unable to open the library" error 4302 Running Catalina 10.15.7 (19H524)
The iPhoto Library has been stored on an external hard drive. Tried opening it various times. Restarted the computer. Remounted the hard drive.
Any idea how to get it to open?
Found this thread googling - https://discussions.apple.com/thread/250721038 - but don't understand the proposed solution.
First things first: before modifying the photoslibrary copy it to somewhere else/back it up, to ensure you are not losing the raw photo data (preferably multiple backups in different locations)!
I will explain what the mentioned thread means, however: You will not restore album structure, face detection data and edits, i.e. all metadata.

Open photos, immediately hit option and create a new library.

Locate the new photoslibrary package and right click on it. Hit show package contents and copy the originals (previously masters) folder onto your desktop.

While the new photoslibrary is opened, drag the originals folder onto the photos app icon in the dock.

Import the photos 


This will not preserve any albums, face detection data and more. You will have to reorganize the pictures. This method only allows you to copy all the raw photos from your old library into the new one quickly!
However, this allows you to start off fresh and - depending on how much you've been using face recognition, edit features and albums - you may have restored the photos library quite quickly.
Note: Selecting preserve folder structure when importing the pictures at step 4 will not preserve the albums. It will preserve the folder structure of the originals folder and create for each subfolder a new album.

Other things you could try:

Run first aid (preferably multiple times in recovery mode) on the external drive to check the external HDD for malfunction
Copy the library to another location and try opening it there

Your photos app window says:

Updating library


This means you must have done some macOS update. You could try to revert to the older macOS version or install a virtual machine and try opening the library from there

Apart from that I think you are out of luck, but maybe someone has a better answer, so maybe wait and do not deleted the library in its current state.

EDIT:
I just realized it says you're opening an iPhoto library, which was Apples previous photos app before the Photos app was introduced in OS X Yosemite in 2015. On Apples forum there is a good thread about what to make sure before transition from iPhoto to Photos.
It states:

Repair the permissions, and repair the database

So if you have an old Mac with an OS X version before Yosemite was introduced, you could try to repair the database there and start again.
Further, ensure the drive is formatted correctly (HFS+ usually works well) and you're not connecting to a NAS/shared network drive.

If your iPhoto Library is not in your Pictures folder, but on an external drive, check the drive for compatibility. Photos may have problems accessing the drive, if it is on a network volume and not locally mounted.


This is again a good example why backups are vital. HDDs these days are really cheap and backing up - even external devices - is not hard, even the built-in TimeMachine app can do that. So please, anyone reading this, think about your backup solution, because its only a question of time when your first device will experience data loss.