INSTALL GUIDE: PhotoPrism in a Jail on TrueNAS Core 13.0

scripsi

Dabbler
Joined
Jan 16, 2023
Messages
15
@A.saleh I haven't tried this myself, but it should be possible if done carefully.

The fundamental rule for mounting datasets is that the folder you are mounting into must exist and it must be completely empty. Also mounts can only be changed when the jail is not running. Because of this, if you are trying to mount one or more datasets inside another, then you must set the mount point for the parent dataset first, start the jail, create the target folder(s) for the child dataset(s) within the parent, stop the jail, and set the mount point(s) for the child dataset(s). When you are setting these child mount points, you won't be able to browse to the folders you created, because the jail is stopped - you just have to have faith that they WILL be there when the jail starts up again!

Try this, once you've got the basic PhotoPrism set up and working without anything mounted or imported into the originals folder:

mkdir /mnt/photos/originals/folder-a
chown photoprism:photoprism /mnt/photos/originals/folder-a

mkdir /mnt/photos/originals/folder-b
chown photoprism:photoprism /mnt/photos/originals/folder-b

... etc

NOTE: the chown commands above make sure that the empty folders have the right permissions for PhotoPrism to access them. Don't run these chown commands on the folders when datasets are mounted into them! If you do, then the permissions of the files within the mounted datasets may be changed, which could stop you accessing them from other jails or file shares.

Now stop the jail, go to Mount Points and click Add

For the Source, browse to /path/to/existing/photos/dataset/folder-a
For the Destination, browse to /path/to/jail/mnt/photos then type "/originals/folder-a" after it
Tick the Read-Only option if necessary then click Submit

Click Add again

For the Source, browse to /path/to/existing/photos/dataset/folder-b
For the Destination, browse to /path/to/jail/mnt/photos then type "/originals/folder-b" after it
Tick the Read-Only option if necessary then click Submit

... etc
 

jdebuhr

Dabbler
Joined
Nov 28, 2021
Messages
17
Thanks for the guide, this helped but I am running into an issue. When I go to mount my path external to the Jail, the issue I have is the path in the jail is already populated and I cannot mount it..
path in the jail is /mnt/photos. I want to mount my external to jail path to this folder, but cannot.

Then once that is done I know I can do the path for the originals ( then the Photo Sync app works)

Lastly the RAW add-on, does that work well? Looking for a good solution for my son that is a Digital Media major for sorting his photos
Thanks
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
path in the jail is /mnt/photos. I want to mount my external to jail path to this folder, but cannot.
What exactly are you doing to mount it and what happens then?
 

jdebuhr

Dabbler
Joined
Nov 28, 2021
Messages
17
What exactly are you doing to mount it and what happens then?
I select my external path on the pool that has a new Photoprism Dataset folder, I set that in the source directory. I think set my Destination directory to : /mnt/photos/ when I press save, it reports back saying I cannot mount to it as the directory must be empty. I did this as per the steps in the steps of the first post.

the /mnt/photos/ has directories under it before I even start to do work in the console. Does it create those on first run? maybe I don't want the Jail to start prior to setting up the mount points? I can blow away the jail and start over if needed.. but I do know the issue with mounting to a non empty directory has always given me this flag.
 

Lemongrass

Cadet
Joined
Mar 20, 2023
Messages
3
Hi
Gentlemen, I hope for your help. I installed photoprism, mounted a folder with photos, I can see the directory structure, but I can't open them. Photoprism says that there are no access rights. What rights and to whom should be given? There is nothing in the instructions about this. Maybe you need a user, like for an EMBY with a specific ID?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You must set the destination directory as /mnt/<name of pool>/iocage/jails/<name of jail>/root/mnt/photos, i.e. the complete path to the jail destination as seen from the host system. Why do you not simply post the verbatim paths you are using and indulge in lengthy descriptions? That make it rather difficult to help you. Just screenshot the config that is not working. There is nothing security relevant about that.

If I knew the name of your pool and the name of your jail I could give you the path ready for copy & paste.
 

Lemongrass

Cadet
Joined
Mar 20, 2023
Messages
3
/mnt/ARCHIVE/FotoAndVideo
/mnt/BUFFER/iocage/jails/photoprism/root/mnt/photos/originals
 

Attachments

  • mount point.jpg
    mount point.jpg
    16.8 KB · Views: 180

jdebuhr

Dabbler
Joined
Nov 28, 2021
Messages
17
You must set the destination directory as /mnt/<name of pool>/iocage/jails/<name of jail>/root/mnt/photos, i.e. the complete path to the jail destination as seen from the host system. Why do you not simply post the verbatim paths you are using and indulge in lengthy descriptions? That make it rather difficult to help you. Just screenshot the config that is not working. There is nothing security relevant about that.

If I knew the name of your pool and the name of your jail I could give you the path ready for copy & paste.
I am not able to access that at the moment. I will get some screenshots of what the Jail is showing me when I try to mount folders. thgat will be this evening when I am home and can spend some time with it. Thanks for your response
 

jdebuhr

Dabbler
Joined
Nov 28, 2021
Messages
17
Image attached..

this is the issue "Destination directory must be empty."
 

Attachments

  • Screenshot 2023-03-20 at 5.50.04 PM.png
    Screenshot 2023-03-20 at 5.50.04 PM.png
    534.8 KB · Views: 181

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Then I suggest you rename the existing directory inside the jail and create a new empty one.
 

jdebuhr

Dabbler
Joined
Nov 28, 2021
Messages
17
got mine running yesterday.. this is a great guide once you read and follow it closely..
 

Leek Soup

Cadet
Joined
Mar 21, 2023
Messages
9
Edit:
I got it working. The issue seemed to lie in the way I set up the MariaDB section. Destroying the jail and starting from scratch without using the MariaDB option worked. Still not sure exactly what was causing it though. Thanks again for the guide!

Original reply:
Thanks a lot for the guide, it has been super useful with setting up Photoprism!
I am almost at the end, but ran into an issue at the "Test run Photoprism" section. When I enter either of the commands
su -m photoprism -c 'photoprism --defaults-yaml /mnt/photos/options.yml passwd'
or
su -m photoprism -c 'photoprism --defaults-yaml /mnt/photos/options.yml passwd'
I get the error
Error 1698: Access denied for user "photoprism" @ "localhost"
and when I enter the command
service photoprism start
I just get "starting photoprism" and nothing else.
When I enter
service photoprism status
I get "photoprism is not running."
I am not sure what is causing this. Possibly a permission issue? I am new to this kind of stuff so I apologise if it's something obvious.

When I restart the jail, it seems that Photoprism does run for about a minute, but then stops. (My evidence for this is that the command "service photoprism status" gives "photoprism is running" as a reply for about a minute)

I am new to this kind of stuff so I apologise if it's something obvious.
Thanks.
 
Last edited:

andre.graca

Cadet
Joined
May 11, 2023
Messages
1
Edit:
I got it working. The issue seemed to lie in the way I set up the MariaDB section. Destroying the jail and starting from scratch without using the MariaDB option worked. Still not sure exactly what was causing it though. Thanks again for the guide!

Original reply:
Thanks a lot for the guide, it has been super useful with setting up Photoprism!
I am almost at the end, but ran into an issue at the "Test run Photoprism" section. When I enter either of the commands

or

I get the error

and when I enter the command

I just get "starting photoprism" and nothing else.
When I enter

I get "photoprism is not running."
I am not sure what is causing this. Possibly a permission issue? I am new to this kind of stuff so I apologise if it's something obvious.

When I restart the jail, it seems that Photoprism does run for about a minute, but then stops. (My evidence for this is that the command "service photoprism status" gives "photoprism is running" as a reply for about a minute)

I am new to this kind of stuff so I apologise if it's something obvious.
Thanks.

I seem to have a a similar problem. The installation and setup runs well and photoprism runs before the "
OPTIONAL: Mount an existing photos dataset". Once I add the new mount point I start the jail. I can see the photoprism web interface showing up for a few seconds, but then dissapears. On the jail shell, when I input 'service photoprism start' followed by 'service photoprism status', I get an output "photoprism is running as pid #####" for the first few seconds, but if I check the status again I get "photoprism is not running".

The mount point defined is Read only:
Source is /mnt/PhotographyMedia/PhotoMedia/Google Fotos/
Destination /mnt/PhotographyMedia/iocage/jails/photos/root/mnt/photos/originals

It may be something obvious, but any second pair of eyes inspecting and some feedback is appreciated.

@scripsi well done in putting this install guide together, very appreciated!

Cheers,
André
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
I have tried to follow these instructions a few times, but can never get PhotoPrism to start, with by service photoprism start
or using the su -m photoprism commands. If I try this last one I get Illegal instruction.

Any ideas?
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
When I run the commands one by one from the command line, it works now.

I’m trying to put it all together in a script, but for some reason I think the database commands are not playing nicely with me.
 
Top