"Your library is currently empty"

I’m a new PhotoStructure user so please excuse me for this novice question. I’m currently using Photoview on Synology but feel Photoview a little too heavy, hence the migration. Anyway, I was able to run Photostructure on my Synology , but it doesn’t find any photos. The home page simply says “Your library is currently empty.” I also checked the FAQ article here but nothing matches my case. Any hint on where I should look at? Thanks in advance!

Hardware and Software Platform
Synology DS220+, DSM 7

Docker Setup

  1. I mounted an empty folder to /ps/library as the starting point.
  2. I mounted my actual image folder to /images, and read-only

PhotoStructure Version
I tried both latest and alpha. Both have this problem.

PhotoStructure Configuration
Select key entries as follows:

copyAssetsToLibrary = false
scanAllDrives = false
scanPaths = [
  "/images"
]

Docker Logs
Nothing super interesting…

2021-10-09 00:48:56,stdout, ...terminated.
2021-10-09 00:48:55,stdout,PhotoStructure library db has been backed up to /ps/library/.photostructure/models/backup.
2021-10-09 00:48:54,stdout,Shutting down PhotoStructure...
2021-10-09 00:48:54,stdout,"Session terminated, terminating shell...
2021-10-09 00:48:54,stdout,
2021-10-09 00:40:28,stdout,PhotoStructure is ready: <http://localhost:1787/>
2021-10-09 00:40:28,stdout,Your library is at /ps/library

/ps/logs
A bunch of errors but I’m not sure if they are relevant…

{"ts":1633740066823,"l":"error","ctx":"DbRequest","msg":"prep() failed","meta":{"sqlQuery":{"method":"select","options":{},"timeout":false,"cancelOnTimeout":false,"bindings":["enqueueAssetUpdates",3,"file:///"],"sql":"select * from `Operation` where `completedAt` is not null and `name` = ? and `version` = ? and `value` = ?"}}}
{"ts":1633740066824,"l":"error","ctx":"DbRetries","msg":"Caught db error. Not retrying.","meta":{"cause":{}}}
{"ts":1633740066827,"l":"error","ctx":"DbRequest","msg":"Error: DbRequest prep() failed {\"sqlQuery\":{\"method\":\"select\",\"options\":{},\"timeout\":false,\"cancelOnTimeout\":false,\"bindings\":[\"enqueueAssetUpdates\",3,\"file:///\"],\"sql\":\"select * from `Operation` where `completedAt` is not null and `name` = ? and `versio…\nSqliteError: no such table: Operation\n    at Database.prepare (/ps/app/node_modules/better-sqlite3/lib/methods/wrappers.js:5:21)\n    at /ps/app/bin/sync.js:9:707229\n    at d.getOrSet (/ps/app/bin/sync.js:9:45413)\n    at t.DbRequest.prep (/ps/app/bin/sync.js:9:707177)\n    at /ps/app/bin/sync.js:9:707527","meta":{"method":"select","options":{},"timeout":false,"cancelOnTimeout":false,"bindings":["enqueueAssetUpdates",3,"file:///"],"sql":"select * from `Operation` where `completedAt` is not null and `name` = ? and `version` = ? and `value` = ?"}}
{"ts":1633740066832,"l":"error","ctx":"DbRequest","msg":"prep() failed","meta":{"sqlQuery":{"method":"select","options":{},"timeout":false,"cancelOnTimeout":false,"bindings":["applyNewTagger","fs",1],"sql":"select * from `Operation` where `completedAt` is not null and `name` = ? and `value` = ? and `version` = ?"}}}
{"ts":1633740066832,"l":"error","ctx":"DbRetries","msg":"Caught db error. Not retrying.","meta":{"cause":{}}}
{"ts":1633740066834,"l":"error","ctx":"DbRequest","msg":"Error: DbRequest prep() failed {\"sqlQuery\":{\"method\":\"select\",\"options\":{},\"timeout\":false,\"cancelOnTimeout\":false,\"bindings\":[\"applyNewTagger\",\"fs\",1],\"sql\":\"select * from `Operation` where `completedAt` is not null and `name` = ? and `value` = ? and `v…\nSqliteError: no such table: Operation\n    at Database.prepare (/ps/app/node_modules/better-sqlite3/lib/methods/wrappers.js:5:21)\n    at /ps/app/bin/sync.js:9:707229\n    at d.getOrSet (/ps/app/bin/sync.js:9:45413)\n    at t.DbRequest.prep (/ps/app/bin/sync.js:9:707177)\n    at /ps/app/bin/sync.js:9:707527","meta":{"method":"select","options":{},"timeout":false,"cancelOnTimeout":false,"bindings":["applyNewTagger","fs",1],"sql":"select * from `Operation` where `completedAt` is not null and `name` = ? and `value` = ? and `version` = ?"}}
{"ts":1633740066841,"l":"error","ctx":"DbRequest","msg":"prep() failed","meta":{"sqlQuery":{"method":"select","options":{},"timeout":false,"cancelOnTimeout":false,"bindings":["forceRestartSync"],"sql":"select * from `Operation` where `completedAt` is null and `name` = ? order by `createdAt` asc"}}}
{"ts":1633740066841,"l":"error","ctx":"DbRetries","msg":"Caught db error. Not retrying.","meta":{"cause":{}}}
{"ts":1633740066843,"l":"error","ctx":"DbRequest","msg":"Error: DbRequest prep() failed {\"sqlQuery\":{\"method\":\"select\",\"options\":{},\"timeout\":false,\"cancelOnTimeout\":false,\"bindings\":[\"forceRestartSync\"],\"sql\":\"select * from `Operation` where `completedAt` is null and `name` = ? order by `createdAt` asc\"}}: Sq…\nSqliteError: no such table: Operation\n    at Database.prepare (/ps/app/node_modules/better-sqlite3/lib/methods/wrappers.js:5:21)\n    at /ps/app/bin/sync.js:9:707229\n    at d.getOrSet (/ps/app/bin/sync.js:9:45413)\n    at t.DbRequest.prep (/ps/app/bin/sync.js:9:707177)\n    at /ps/app/bin/sync.js:9:707527","meta":{"method":"select","options":{},"timeout":false,"cancelOnTimeout":false,"bindings":["forceRestartSync"],"sql":"select * from `Operation` where `completedAt` is null and `name` = ? order by `createdAt` asc"}}

Are you able to see your photo files if you open a terminal window in your container and cd to /images?

Thanks. Yes, I can. The command I use is:

docker exec -it photostructure-server ls /images

and it correctly lists the files and subfolders.

1 Like

What does the settings page look like on your front end (http://[your ip]:1787/settings)?

I actually did all settings in the web interface, not through direct modification of settings.toml. I posted the entries from the settings file (rather than posting a screenshot) just to make my post a tad more concise. So I basically selected manual scan and typed /images into the text box below the option.

Well, I have one hail Mary option… my photos directory has a trailing slash at the end, so maybe try changing /images to /images/

I don’t actually expect that to work, but I’m not sure what else to suggest. Unfortunately, the developer is on vacation through the weekend, so he may not be able to chime in until Monday.

So, hail Mary!

You didn’t explicitly say, but you did setup up mounts for /ps/tmp, /ps/log and /ps/config, right?

Also, set you log level to debug with an env variable to see if there is anything more useful logged.

Sorry I can’t help you, it wanted to make sure you knew that @mrm is out for the weekend (Where's Matthew? (7 October 2021) - #2 by Const) - I expect he can help when he gets back, if you don’t get it sorted before then.

Thanks everyone very much for the support. Really appreciated :grinning:

@tkohhh I tried the trailing slash but yeah it didn’t work either…
@avdp Yes I had mounted the folders you mentioned. I changed the log level and provide details below.
@bdillahu Yes I know that Matthew is currently not available. Thanks for the reminder :slight_smile:

So I first ran it with debug logging, and you can read the full log here (1.log). What caught my eyes is this specific line:

{"ts":1633755564203,"l":"info","ctx":"Volumes","msg":"validateMountpoints(): /images is not a directory"}

which is weird, because as I mentioned in my previous reply, I can run terminal command within the docker container and access the directory without any problem.

Then I changed the mount to /ps/images (in a similar manner to other mounted volumes) and then asked Photostructure to scan /ps/images. Full log is here (2.log). This time it doesn’t say something like "/ps/images is not a directory". However, I still do not see my images showing up :upside_down_face:

Very odd! Just curious, did you also try NOT specifying a scan path and let PS discover find what it finds? Also maybe worth trying… mount /images read/write, shouldn’t be necessary but also won’t hurt anything since PS won’t change any content outside of library.

One more thing to try… Set an env variable to NOT validate mount points. Perhaps there is some bug in that code and this might bypass it.

PS_VALIDATE_MOUNTPOINTS=“false”

Actually, doesn’t Photostructure need to write the UUID file? That could be your problem!

No, my source folders are read-only and there is no .uuid files.

Thanks again for all the support :slight_smile: Just to give an update on my side:

  1. Mounting /images as R/W does not seem to solve the problem.
  2. If I directly run the scan without specifying a path, the web interface says:
    Done.
    /ps/library: Done.
    It doesn’t say anything related to /images.
  3. Setting PS_VALIDATE_MOUNTPOINTS to false doesn’t seem to work either :frowning:

Thanks to everyone in this thread sharing tips and ideas, and welcome to PhotoStructure, @jiangzhenjerry !

Actually, they’re super relevant. If you get a SqliteError: no such table error, it means something has gone terribly wrong with your library database.

PhotoStructure uses SQLite, and applies migrations on startup as needed to ensure the correct database schema is set up. You can read a bit more about this here: What's PS_FORCE_LOCAL_DB_REPLICA?

If a table is missing, I suspect something has truncated your .photostructure/models/db.sqlite3 file. This can happen if the library uses a volume with “transparent” SSD caching (UnRaid suffers from this): and I believe you can set up DSM 6 or later to use SSD caching as well.

PhotoStructure’s library database needs to be stored directly on a local disk (and use forceLocalDbReplica=false, or you need to set up a bind mount of /ps/tmp to be a local disk (and use forceLocalDbReplica=true).

Once you’ve got that set up, restarting PhotoStructure should be enough for it to realize the db is borked, and reset the schema.

This is as I would suspect: there are a couple issues with read-only volumes, but imports should still work.

Here are the issues:

  1. If PhotoStructure can’t extract a volume UUID, the URIs for that device will be simple file:// paths which will break if you move /images to a different path, or change the source bind mount to a different volume. Read more about that here:

(as that post states, you can add a .uuid file to the root of the bind mount yourself: cat /proc/sys/kernel/random/uuid > .uuid on the host machine into the bind mount for /images)

  1. Metadata changes (like fave and rotation) won’t be able to be written back to sidecars (or the original image), but will be stored in your PhotoStructure library.

If you’re still having issues, set your LOG_LEVEL=debug, restart your container, and then email me your logs so I can take a look. Details are here: PhotoStructure | What are in my logs and error reports?

Sorry for the hassle, and thanks for sticking with it!

1 Like

Thanks a lot Matthew for your detailed explanation! Appreciated.

I don’t quite understand what you said about the database though. All the configuration directories are on my local NAS drive, and it is an HDD instead of an SSD. I don’t have an idea why the database would be truncated.

I also tried to put a .uuid file in the image folder, but it doesn’t seem to work. I sent the debug logs to your email (hello@…) together with how I set up the container. Thank you in advance for your help! :smiley: