Hi folks!
I’ve been playing around with Photostructure for a bit. After running on my Desktop for a little bit, I set it up using the docker-compose.yml file on a server. I started it up, looked at the pretty interface in a browser, then shut it down.
I was doing some syncs via the CLI, and after I was finished, I started it back up using the compose file, and I got this message:
photostructure | {"fatal":true,"exit":true,"status":12,"pid":27,"ppid":20,"error":"Library setup failed: ¹: Error: ModelDbJanitor(/ps/library/.photostructure) {\"from\":\"ModelDbJanitor.setup\"}: SqliteError: code SQLITE_READONLY: attempt to write a readonly database¹⁶"}
photostructure | Error: ModelDbJanitor(/ps/library/.photostructure) {"from":"ModelDbJanitor.setup"}: SqliteError: code SQLITE_READONLY: attempt to write a readonly database¹⁶
photostructure | SqliteError: attempt to write a readonly database
photostructure | at Database.exec (/ps/app/node_modules/better-sqlite3/lib/methods/wrappers.js:9:14)
photostructure | at new t.Migration (/ps/app/bin/main.js:9:688803)
photostructure | at /ps/app/bin/main.js:9:677958
photostructure | at async E._finishSetup (/ps/app/bin/main.js:9:739308)
photostructure | at async /ps/app/bin/main.js:9:737233
photostructure | {"fatal":true,"exit":true,"status":14,"pid":27,"ppid":20,"error":"main setup failed: Error: ModelDbJanitor(/ps/library/.photostructure) {\"from\":\"ModelDbJanitor.setup\"}: SqliteError: code SQLITE_READONLY: attempt to write a readonly database¹⁶"}
photostructure | This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
photostructure | SqliteError: attempt to write a readonly database
photostructure | at Database.exec (/ps/app/node_modules/better-sqlite3/lib/methods/wrappers.js:9:14)
photostructure | at new t.Migration (/ps/app/bin/main.js:9:688803)
photostructure | at /ps/app/bin/main.js:9:677958
photostructure | at async E._finishSetup (/ps/app/bin/main.js:9:739308)
photostructure | at async /ps/app/bin/main.js:9:737233
photostructure | at async Function.for (/ps/app/bin/main.js:9:738236)
photostructure | at async /ps/app/bin/main.js:9:628506
photostructure | at async /ps/app/bin/main.js:9:627268
photostructure | This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
photostructure | SqliteError: attempt to write a readonly database
photostructure | at Database.exec (/ps/app/node_modules/better-sqlite3/lib/methods/wrappers.js:9:14)
photostructure | at new t.Migration (/ps/app/bin/main.js:9:688803)
photostructure | at /ps/app/bin/main.js:9:677958
photostructure | at async E._finishSetup (/ps/app/bin/main.js:9:739308)
photostructure | at async /ps/app/bin/main.js:9:737233
photostructure | at async Function.for (/ps/app/bin/main.js:9:738236)
photostructure | at async /ps/app/bin/main.js:9:628506
photostructure | at async /ps/app/bin/main.js:9:627268
photostructure | This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
photostructure | SqliteError: attempt to write a readonly database
photostructure | at Database.exec (/ps/app/node_modules/better-sqlite3/lib/methods/wrappers.js:9:14)
photostructure | at new t.Migration (/ps/app/bin/main.js:9:688803)
photostructure | at /ps/app/bin/main.js:9:677958
photostructure | at async E._finishSetup (/ps/app/bin/main.js:9:739308)
photostructure | at async /ps/app/bin/main.js:9:737233
photostructure | at async Function.for (/ps/app/bin/main.js:9:738236)
photostructure | at async /ps/app/bin/main.js:9:628506
photostructure | at async /ps/app/bin/main.js:9:627268
photostructure | This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
photostructure | SqliteError: attempt to write a readonly database
photostructure | at Database.exec (/ps/app/node_modules/better-sqlite3/lib/methods/wrappers.js:9:14)
photostructure | at new t.Migration (/ps/app/bin/main.js:9:688803)
photostructure | at /ps/app/bin/main.js:9:677958
photostructure | at async E._finishSetup (/ps/app/bin/main.js:9:739308)
photostructure | at async /ps/app/bin/main.js:9:737233
photostructure | at async Function.for (/ps/app/bin/main.js:9:738236)
photostructure | at async /ps/app/bin/main.js:9:628506
photostructure | at async /ps/app/bin/main.js:9:627268
photostructure exited with code 0
I went to look to see if I had permission errors, but actually…
.
./README.txt
./.library-uid.json
./.NoMedia
./models
./models/version-backup
./models/version-backup/20211208-035458-db.sqlite3
./models/backup
./models/backup/20211208-040617-seq0-set20-db.sqlite3
./models/backup/20211210-181214-seq10-set2-db.sqlite3
./models/backup/20211210-191752-seq14-set2-db.sqlite3
./models/backup/20211210-183051-seq12-set3-db.sqlite3
./models/backup/20211210-172807-seq8-set4-db.sqlite3
./models/backup/20211210-190335-seq13-set1-db.sqlite3
./opened-by
./.metadata_never_index
./settings.toml
Maybe the database isn’t just “read-only”, maybe it doesn’t exist?
Please note, this is not an emergency or even a problem–there’s literally nothing in the database that wouldn’t be regenerated with just a reimport
Could this have been caused by "Control-C"ing a cli sync?
Being that I’m on a server, I guess there’s a bunch of possible version things that are relevant, but I’m running on Debian bullseye, using Photostructure for Docker:
docker-compose run --rm photostructure sh
Creating photostructure_photostructure_run ... done
/ps/app # ./photostructure --version
1.1.0