just throwing out there that if you update to mac os Catalina and avast premium security, then the app tends to "automatically" block processes from running if it thinks that its a ransomware.
following updating to catalina, my photos library was updating, during this update, a pop came up from avast and blocked a process after 30sec as it believed it to be a randomsware. once finished, these errors popped up, resulting in the photo library becoming unaccessible.
"Photos was unable to open the library “Photos Library”. (4302)"
" PHPhotosErrorInvalidState ?
these are the error i got as a result of avast blocking a process from running. it killed my photos library and had to extract the photos manually and slowly move them over to a new photos library.
avast did not keep a log or record of the processes it blocks, so there was no way to undo the damage that had already taken place.