Running Docker Container Fails

I am trying to run the Docker container on my Ubuntu machine. Here is what is happening:

root@photostructure:~# docker images
REPOSITORY              TAG       IMAGE ID       CREATED        SIZE
photostructure/server   latest    7f932e83f9d4   3 months ago   353MB
root@photostructure:~# docker run photostructure/server
[
  '/ps/app/bin/main.js:9:182918',
  'u (/ps/app/bin/main.js:9:780479)',
  't.systemSettingsFile (/ps/app/bin/main.js:9:632123)',
  '/ps/app/bin/main.js:9:188096',
  'u (/ps/app/bin/main.js:9:780479)',
  'M (/ps/app/bin/main.js:9:449027)',
  't.setServiceName (/ps/app/bin/main.js:9:81923)',
  'new t.CLI (/ps/app/bin/main.js:9:153464)'
]
root@photostructure:~# docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
root@photostructure:~# docker ps -a
CONTAINER ID   IMAGE                   COMMAND                  CREATED          STATUS                      PORTS     NAMES
a845470a9669   photostructure/server   "/sbin/tini -- /ps/a…"   28 seconds ago   Exited (1) 15 seconds ago             elegant_poitras
83d52252f201   photostructure/server   "/sbin/tini -- /ps/a…"   5 minutes ago    Exited (1) 5 minutes ago              priceless_mccarthy
root@photostructure:~#

I had a similar issue on my Synology NAS with my docker image stopping itself right after starting. It turned out to be a permissions issue; the root user didn’t have read/write access to all the user folders that I was mounting to the docker image as volumes. After adding those permissions, it ran normally.

Welcome to PhotoStructure @droidus!

This “error message” from docker run is just atrocious and I apologize.

Your container is missing one of the required bind-mount directories.

With version 1.x, there are four directories:

https://photostructure.com/server/photostructure-for-docker/#docker-volume-setup

With version 2.x (currently in alpha), this is much simpler: you only need to bind mount /ps/library:

If you’re just getting started, I’d suggest you use the photostructure/server:alpha image, so you can avail yourself of this easier setup, and the new features I’ve built for v2. I’ve been holding back on releasing that build as stable due to showstopping bugs on macOS and Windows. (I currently run the alpha build on docker to host my family’s photos, fwiw).

The error, “Failed to set up config directory: /ps/config and /ps/library are missing or not writable.” is being thrown before PhotoStructure has set up logging and error reporting, which is why you’re staring at this cryptic stacktrace.

The next alpha build will fix this issue. Thanks for reporting!

Hello,
I seem to be getting the same error upon launch:


root@photostructure:~# docker ps -a
CONTAINER ID   IMAGE          COMMAND                  CREATED          STATUS                     PORTS     NAMES
fa0ef9dfcd5d   3f6642dcbd62   "/sbin/tini -- /ps/a…"   20 minutes ago   Exited (1) 6 seconds ago             pedantic_montalcini
root@photostructure:~# docker log fa0ef9dfcd5d
docker: 'log' is not a docker command.
See 'docker --help'
root@photostructure:~# docker logs fa0ef9dfcd5d
[
  '/ps/app/bin/main.js:9:182918',
  'u (/ps/app/bin/main.js:9:780479)',
  't.systemSettingsFile (/ps/app/bin/main.js:9:632123)',
  '/ps/app/bin/main.js:9:188096',
  'u (/ps/app/bin/main.js:9:780479)',
  'M (/ps/app/bin/main.js:9:449027)',
  't.setServiceName (/ps/app/bin/main.js:9:81923)',
  'new t.CLI (/ps/app/bin/main.js:9:153464)'
]
[
  '/ps/app/bin/main.js:9:182918',
  'u (/ps/app/bin/main.js:9:780479)',
  't.systemSettingsFile (/ps/app/bin/main.js:9:632123)',
  '/ps/app/bin/main.js:9:188096',
  'u (/ps/app/bin/main.js:9:780479)',
  'M (/ps/app/bin/main.js:9:449027)',
  't.setServiceName (/ps/app/bin/main.js:9:81923)',
  'new t.CLI (/ps/app/bin/main.js:9:153464)'
]
root@photostructure:~# docker images
REPOSITORY              TAG       IMAGE ID       CREATED        SIZE
photostructure/server   alpha     3f6642dcbd62   3 months ago   353MB
photostructure/server   latest    7f932e83f9d4   3 months ago   353MB
root@photostructure:~#

How did you create your docker container? Can you share the command?

docker pull photostructure/server:alpha
docker run

ok, so that’s the problem. You need a lot more than that. You need to have at the very minimum 2 bind mounts for any of this to work:

  • the folder where you want Photostructure to store its library
  • the folder (or folders) where your source photos are

The command might look something like this, the paths on the left of the : being specific to your machine of course:


docker run \
  --stop-timeout 120 \
  -v /some/path/to/PhotoStructureLibrary:/ps/library \
  -v /some/path/to/images:/media\
  photostructure/server:alpha

More info here, but note that the documentation is specific to stable - alpha is actually simpler (you only need /ps/library, not /ps/temp, /ps/config, etc) - I am sure @mrm will update the documentation at some point:

So I tried that, but I seem to be getting that first error message, again:

sudo docker run   --stop-timeout 120   -v /mnt/qnap/photoprism-test:/mnt/qnap/photoprism-test   -v /mnt/qnap/photoprism-test:/mnt/qnap/photoprism-test  photostructure/server:alpha
[
  '/ps/app/bin/main.js:9:182918',
  'u (/ps/app/bin/main.js:9:780479)',
  't.systemSettingsFile (/ps/app/bin/main.js:9:632123)',
  '/ps/app/bin/main.js:9:188096',
  'u (/ps/app/bin/main.js:9:780479)',
  'M (/ps/app/bin/main.js:9:449027)',
  't.setServiceName (/ps/app/bin/main.js:9:81923)',
  'new t.CLI (/ps/app/bin/main.js:9:153464)'
]

Did you perhaps copy and paste your attempt to make photoprism work? That container has different requirements from this application and docker image.

You need to follow these instructions: add a bind mount for /ps/library

sudo docker run --stop-timeout 120 \
  -v /mnt/qnap/photoprism-test:/ps/library \
  photostructure/server:alpha

I don’t think you’re understanding the concepts of bind mounts. You’re just repeating the same path twice.

You have to map /ps/library to an empty folder on your nas. It is not optional

Sorry about that typo. Weird.
I am getting the same error message:

[
  '/ps/app/bin/main.js:9:182918',
  'u (/ps/app/bin/main.js:9:780479)',
  't.systemSettingsFile (/ps/app/bin/main.js:9:632123)',
  '/ps/app/bin/main.js:9:188096',
  'u (/ps/app/bin/main.js:9:780479)',
  'M (/ps/app/bin/main.js:9:449027)',
  't.setServiceName (/ps/app/bin/main.js:9:81923)',
  'new t.CLI (/ps/app/bin/main.js:9:153464)'
]

Command that I am running:

sudo docker run   --stop-timeout 120   -v /mnt/qnap/photoprism-test:/ps/library     photostructure/server:alpha

Can anyone please assist?

Most likely a permission issue with your /mnt/qnap/photoprism-test folder. See @nuk’s comment above.

But also, as I mentioned earlier you need a minimum of 2 mounts. One for /ps/library (which you have) and the other mount is for where you store the pictures you want to import.

Which begs the question, what do you currently have in /mnt/qnap/photoprism-test? This may not be strictly required, but I would recommend that your /ps/library mount points to an empty folder on your NAS. This is where photostructure will store its database, thumbnails, log files, temp files. It should not be where your pictures are stored.

@nuk can you please share how you did that?

so I’m confused. @mrm’s example just has one binding mount, and your example shows two. Which is it?
Don’t mind the folder name, photoprism-test. I am testing out several programs, and this directory hasn’t been used by anything yet. There is only one PNG file inside that folder right now.

If you’re using v1.1 (the :stable tag), you must have all 4 bind mounts listed in the documentation:

https://photostructure.com/server/photostructure-for-docker/#docker-volume-setup

If you’re using an :alpha or :beta v2.x build, you must have a bind mount for /ps/library. Details are here:

If you want PhotoStructure to import photos and videos outside of your library, then add additional bind-mounts as needed. Examples are in the docker instructions linked above.

You need minimum two, but you can have as many as you want. the one in @mrm’s example is the only one strictly required for photostructure to start, but I assume you actually want photostructure to scan pictures, right? The nature of docker is that a container can’t see any folders outside of itself if you don’t mount it. So any folder you want PS to scan has to be mounted. It can be 1 folder, it can be 25 folders if you’ve got your pictures spread all over the place.

update: I stand corrected, you might be able to get away with just one. I just would not recommend it. I like to keep my source images in a read-only bind mount so that PS can’t accidentally delete them or mess with them in any way.

Also, I realize there may be some confusion on what is the “library”. Maybe this will help.

Actually, your “PhotoStructure library” directory can contain existing assets!

Note that anything already in your library directory will not be moved by automatic organization.