Upgraded to alpha, Photostructure won't start

Expected Behavior

Upgraded from public build to alpha. Using docker-compose. Edited docker-compose.yml file to pull from alpha image, pulled.

Current Behavior

Container won’t start.

docker ps:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8f4f384b6524 photostructure/server:alpha “/sbin/tini – node …” About a minute ago Restarting (12) 35 seconds ago photostructure_photostructure_1

docker logs 8f4f384b6524:
{“fatal”:true,“exit”:true,“status”:12,“pid”:14,“ppid”:7,“error”:“Library.setup() failed¹: Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²”}
Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²
Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²
at k.throwIfUnavailable (/ps/app/bin/main.js:9:601827)
at async a.thunk (/ps/app/bin/main.js:9:582154)
{“fatal”:true,“exit”:true,“status”:14,“pid”:14,“ppid”:7,“error”:“main setup failed: Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²”}
{“fatal”:true,“exit”:true,“status”:12,“pid”:14,“ppid”:7,“error”:“Library.setup() failed¹: Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²”}
Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²
Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²
at k.throwIfUnavailable (/ps/app/bin/main.js:9:601827)
at async a.thunk (/ps/app/bin/main.js:9:582154)
{“fatal”:true,“exit”:true,“status”:14,“pid”:14,“ppid”:7,“error”:“main setup failed: Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²”}
{“fatal”:true,“exit”:true,“status”:12,“pid”:15,“ppid”:8,“error”:“Library.setup() failed¹: Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²”}
Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²
Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²
at k.throwIfUnavailable (/ps/app/bin/main.js:9:601827)
at async a.thunk (/ps/app/bin/main.js:9:582154)
{“fatal”:true,“exit”:true,“status”:14,“pid”:15,“ppid”:8,“error”:“main setup failed: Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²”}
{“fatal”:true,“exit”:true,“status”:12,“pid”:15,“ppid”:8,“error”:“Library.setup() failed¹: Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²”}
Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²
Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²
at k.throwIfUnavailable (/ps/app/bin/main.js:9:601827)
at async a.thunk (/ps/app/bin/main.js:9:582154)
{“fatal”:true,“exit”:true,“status”:14,“pid”:15,“ppid”:8,“error”:“main setup failed: Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²”}
{“fatal”:true,“exit”:true,“status”:12,“pid”:15,“ppid”:8,“error”:“Library.setup() failed¹: Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²”}
Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²
Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²
at k.throwIfUnavailable (/ps/app/bin/main.js:9:601827)
at async a.thunk (/ps/app/bin/main.js:9:582154)
{“fatal”:true,“exit”:true,“status”:14,“pid”:15,“ppid”:8,“error”:“main setup failed: Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²”}
{“fatal”:true,“exit”:true,“status”:12,“pid”:15,“ppid”:8,“error”:“Library.setup() failed¹: Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²”}
Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²
Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²
at k.throwIfUnavailable (/ps/app/bin/main.js:9:601827)
at async a.thunk (/ps/app/bin/main.js:9:582154)
{“fatal”:true,“exit”:true,“status”:14,“pid”:15,“ppid”:8,“error”:“main setup failed: Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²”}
{“fatal”:true,“exit”:true,“status”:12,“pid”:15,“ppid”:8,“error”:“Library.setup() failed¹: Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²”}
Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²
Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²
at k.throwIfUnavailable (/ps/app/bin/main.js:9:601827)
at async a.thunk (/ps/app/bin/main.js:9:582154)
{“fatal”:true,“exit”:true,“status”:14,“pid”:15,“ppid”:8,“error”:“main setup failed: Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²”}
{“fatal”:true,“exit”:true,“status”:12,“pid”:14,“ppid”:7,“error”:“Library.setup() failed¹: Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²”}
Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²
Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²
at k.throwIfUnavailable (/ps/app/bin/main.js:9:601827)
at async a.thunk (/ps/app/bin/main.js:9:582154)
{“fatal”:true,“exit”:true,“status”:14,“pid”:14,“ppid”:7,“error”:“main setup failed: Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²”}
{“fatal”:true,“exit”:true,“status”:12,“pid”:15,“ppid”:8,“error”:“Library.setup() failed¹: Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²”}
Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²
Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²
at k.throwIfUnavailable (/ps/app/bin/main.js:9:601827)
at async a.thunk (/ps/app/bin/main.js:9:582154)
{“fatal”:true,“exit”:true,“status”:14,“pid”:15,“ppid”:8,“error”:“main setup failed: Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²”}
{“fatal”:true,“exit”:true,“status”:12,“pid”:14,“ppid”:7,“error”:“Library.setup() failed¹: Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²”}
Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²
Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²
at k.throwIfUnavailable (/ps/app/bin/main.js:9:601827)
at async a.thunk (/ps/app/bin/main.js:9:582154)
{“fatal”:true,“exit”:true,“status”:14,“pid”:14,“ppid”:7,“error”:“main setup failed: Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²”}
{“fatal”:true,“exit”:true,“status”:12,“pid”:15,“ppid”:8,“error”:“Library.setup() failed¹: Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²”}
Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²
Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²
at k.throwIfUnavailable (/ps/app/bin/main.js:9:601827)
at async a.thunk (/ps/app/bin/main.js:9:582154)
{“fatal”:true,“exit”:true,“status”:14,“pid”:15,“ppid”:8,“error”:“main setup failed: Error: Library is already opened by a29bd03bbc1d (sync:3011245) (library setup)¹⁶²”}

Steps to Reproduce

1.Set up public build in docker-compose.yml. Photos show up.
2. Upgrade to alpha.
3. Start container.

Environment

Operating system and version: Ubuntu.
5.4.0-67-generic #75-Ubuntu SMP Fri Feb 19 18:03:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

PhotoStructure edition: Docker

Welcome to PhotoStructure, @jho, sorry it was misbehaving for you!

The error you’re seeing happens if the container isn’t shut down gracefully. PhotoStructure has to do a bunch of things on shutdown:

https://photostructure.com/faq/how-to-start-and-stop-photostructure/#why-does-it-take-so-long-to-shut-down

  • Verifying and repacking the library database.
  • Taking a backup of the library database.
  • Cleaning the cat box and changing the linens.
  • Copying the local database replica back to your library, if your library is on a remote filesystem.
  • Shutting down any external service processes (like sync-file and exiftool)
  • Closing and compressing logfiles.
  • Removing library opened-by lockfiles.

The last step is removing the opened-by lockfiles: if those are still present, something prior didn’t finish: which could be the database janitorial work.

So: the simplest solution is to

  1. Shut down your container

  2. Make sure you’re using -alpha.2 (or later). -alpha.1 had a shutdown bug (apologies!)

  3. Make sure you’ve configured your container to have a long shutdown wait time. The docker arg is --stop-timeout 120.

  4. Remove the lockfiles manually (replace /ps/library/ with the actual path to your library):

rm /ps/library/.photostructure/opened-by/*.json
  1. Restart your container

Hope this addresses it!