Trying to put something on a fresh 24.04 build that will allow users to autosync data from client devices. Started with Syncthing, went to NextCloud, then back to Syncthing. Same errors in both apps.
After getting the Syncthing app to finally deploy (which took ~1 billion years of troubleshooting), adding a folder to sync results in the following output in the Syncthing UI:
2024-10-18 22:04:18: Failed to create folder root directory: mkdir /mnt/TestPool: permission denied
2024-10-18 22:04:18: Error on folder “test” (xqcgv-gpurp): folder path missing
Logs tell the same story:
2024-10-18 15:04:05.526268-07:00[FHAD7] 2024/10/18 22:04:05 INFO: My name is “truenas”
2024-10-18 15:04:05.526273-07:00[FHAD7] 2024/10/18 22:04:05 INFO: TCP listener ([::]:22000) starting
2024-10-18 15:04:05.526282-07:00[FHAD7] 2024/10/18 22:04:05 INFO: Ready to synchronize “test” (trntu-26mcl) (sendreceive)
2024-10-18 15:04:05.526288-07:00[FHAD7] 2024/10/18 22:04:05 INFO: QUIC listener ([::]:22000) starting
2024-10-18 15:04:18.074829-07:00[FHAD7] 2024/10/18 22:04:18 INFO: Adding folder “test” (xqcgv-gpurp)
2024-10-18 15:04:18.074907-07:00[FHAD7] 2024/10/18 22:04:18 INFO: No stored folder metadata for “xqcgv-gpurp”; recalculating
2024-10-18 15:04:18.074943-07:00[FHAD7] 2024/10/18 22:04:18 WARNING: Failed to create folder root directory: mkdir /mnt/TestPool: permission denied
2024-10-18 15:04:18.074957-07:00[FHAD7] 2024/10/18 22:04:18 INFO: Ready to synchronize “test” (xqcgv-gpurp) (sendreceive)
2024-10-18 15:04:18.074973-07:00[FHAD7] 2024/10/18 22:04:18 INFO: Failed initial scan of sendreceive folder “test” (xqcgv-gpurp)
2024-10-18 15:04:18.074984-07:00[FHAD7] 2024/10/18 22:04:18 WARNING: Error on folder “test” (xqcgv-gpurp): folder path missing
The trouble is, the ACL for the dataset is perfect. Syncthing runs as UID/GID 568, which corresponds to “apps.” “apps” in the ACL has all the necessary perms, no mask or default issues, and I have verified that “apps” can r/w/e in the dataset with sudo su apps
and mkdiring and touching stuff. I even tried giving ownership of the dataset to “apps,” since I was feeling generous.
NextCloud throws identical perm errors.
I suspect that this permission issue might have to do with the pool mount itself being restricted to root ownership and access only. This seems kinda weird, since dataset perms allow for SMB and bash access from regular users with the correct ACL settings. Also, why would ixSystem restrict the pool to root only, from installation, if it was gonna break all the cool apps you can put on your TrueNAS?
I have also tried checking all the Docker and Kubernetes configs, but neither Docker nor Kubernetes seems to be controllable from a terminal in TrueNAS Scale 24.04 - command not found.
A solution to this would also solve Syncthing permission denied on custom install
I have read approx. 1.468 trillion posts on this topic, including the ones in this forum, and have even resorted to consulting my disabled colleague ChatGPT, and have yet to solve. Any ideas?
Collection of links for reference, if desired:
Syncthing permission denied | TrueNAS Community
SyncThing - Directory Access Denied | TrueNAS Community
Not sure why Syncthing does not have permission on dataset on truenas scale | TrueNAS Community
Syncthing permission denied on custom install
Syncthing permission denied
Weird permission error on syncthing
Syncthing - Failed to create folder root directory mkdir /Test: permission denied.. | TrueNAS Community