What uid/gid does Immich use to read external libraries, so that I can set appropriate minimal permissions on the external library?
I tried running Immich as a specific uid/gid, with the gid matching the external library filesystem permissions, and folder/file permissions set to 770/660. Immich could not read the external library. It worked when I set to 775/664. Maybe it runs the web service as a less privileged user?
I am on 25.04.1 and using the latest Immich and Immich app definition, with the new directory structure.
I made the folders/files 770/660 with the gid on the folders/files matching the Immich container gid. I didât try changing the uid on the folders/files to match immich container uid because even if that helped it wouldnât be a viable long-term solution (itâs a share that my uid writes to, so the files will all be owned by me).
I donât think you have to change ownership, but you do have to give read and maybe write access to the datasets. That way immich can actually see the files.
Immich container should be able to read because it is running as gid photos, but canât unless I make the directories 775 and files 664. It must not be reading as gid photos then?
This is what is shown in Application Metadata. It is not correct vs. what is actually configured in the container. I wonder if it is showing the template defaults and not the actual config?
App Configuration:
User ID: 3008 (immich)
Group ID: 4001 (photos)
Application Metadata
Run As Context
UID: 568
GID: 568
Username: immich
Groupname: immich
Description: Immich runs as any non-root user.
When you deploy the TrueNAS App from the catalog you can choose the uid and gid to run the immich container. I set to uid 3008, gid 4001, with gid 4001 matching the group on the external library. The external library is to-date not using POSIX/NFSv4 ACL but I will look at that as the next option if I canât work out which gid is used to read the external library.
I was facing issues when trying to load external libraries within Immich via a TrueNAS install, although I was aligned with the doc.
PERMISSIONS
The pgData dataset must be owned by the user netdata (UID 999) for postgres to start. The other datasets must be owned by the user root (UID 0) or a group that includes the user root (UID 0) for immich to have the necessary permissions.
The library dataset must have ACL mode set to Passthrough if you plan on using a storage templateand the dataset is configured for network sharing (its ACL type is set to SMB/NFSv4). When the template is applied and files need to be moved from uploads to library, immich performs chmodinternally and needs to be allowed to execute the command.
Symptom was in the output logs of Immich - server :
# Error: EACCES: permission denied, scandir ...
So basically the things to check up to makes it work are:
pgData dataset with user netdata (which is done automatically by checking the corresponding checkbox at Immich install in the TrueNAS GUI
set the external libraries data set in ACL mode Passthrough (Edit dataset > advanced option > ACL mode
Put the user apps in the dataset of the external libraries (I let full control, I assume that modify is enough), owner root
what I forgot that drives me mad is in the ACL dataset, donât forget to check âApply permissions recursivelyâ
Doing that, no need to change ownership and permission via CLI (forget about chown and chmod), which I think is not the philosophy of TrueNAS.
Thank you! I think this documentation is out of date â it is for the older TrueNAS template with many datasets and which did not allow the Immich user to be set, so Immich ran as root.
Sorry, I had meant that the documentation overall was out of date â you are completely correct on the postgres_data permissions. I have been able to avoid ACLs so far (using standard UNIX permissions only) but I might need to try ACLs next. Thank you for the ideas!
Iâm having access permission issue from Immich trying to access an external library that is mounted within Immichâs container.
Something I found is that the permission from the dataset persisted into the Immich container and most likely the owner/group IDs that is persisted into the container do not exist in the container.
For example, on my system, the directories in the mounted dataset are owned by UID 3000 but UID 3000 does not exist in Immich containerâs /etc/passwd. Instead, UID is a valid user in TrueNASâs credential list.
I suspect this is causing the access permission issue.
I had an external library working with no NFSv4 ACL and everyone-read permissions. Now with an ACL set with everyone@-read the process cannot read the images. When I run docker exec -it /bin/sh and go to the images I can read them. From the Immich GUI I can also navigate to the images and see the files are there, and even download them, but cannot display the image within in Immich. It says: âError loading imageâ.
This is the current ACL set on the directory. Group 4001 is the containerâs group.
Adding ânobodyâ to the group 4001 which has group@ privilege enabled Immich to access. I canât find where in Immich it drops privileges but it must do so somewhere in the web server.
âeveryone@â is meant to include every user, even anonymous user / nobody, but it obviously doesnât include nobody on TrueNAS. It also did not match nobody in a discrete ACL, although I may have done that incorrectly, because TrueNAS would not let me do from the UI. Adding nobody to a group that already had access is very poor from a security perspective but gets the service up and running while I try to work out if there is a better way.
Iâd appreciate if anyone else having this issue could confirm if this resolves.