I’m running syncthing in a LXC on Proxmox 8.1 to sync my photos. The photos are on an external HDD, mounted on the host at /mnt/hoststorage/photos and passed through as a mount point to the container, monunted at /mnt/lxcstorage/photos. The filesystem throughout is ext4.
The photos are owned on the host by the user:group mediawriter:mediawriters with rwxrwxr-- permissions.
User ‘root’ in the container is mapped to be a member of the group ‘mediawriter’ on the host. I can access, read and write all the relevant files throguh the terminal. (e.g. mkdir /mnt/lxcstorage/photos/test)
Syncthing, however, cannot access the files with ‘permission denied.’ I have absolutely no idea why, since it is running as root and root has access to the files/folders. Any help would be much appreciated:
Logs and hopefully useful output are below:
Syncthing Log (trunkated somewhat since it’s much of the same)
YYYY-MM-DD HH:MM:53 Loading ignores: lstat /mnt/lxcstorage/Photos/User/UserPictures/.stignore: permission denied
YYYY-MM-DD HH:MM:53 Ready to synchronize “User Pictures” (xxxx-xxxx) (sendreceive)
YYYY-MM-DD HH:MM:53 Relay listener (dynamic+https://relays.syncthing.net/endpoint) starting
YYYY-MM-DD HH:MM:53 Loading ignores: lstat /mnt/lxcstorage/Photos/User2/User2Pictures/.stignore: permission denied
YYYY-MM-DD HH:MM:53 Ready to synchronize “User2 Pictures” (xxxx-xxxx) (sendreceive)
YYYY-MM-DD HH:MM:53 Loading ignores: lstat /mnt/lxcstorage/Photos/User/UserVideo/.stignore: permission denied
YYYY-MM-DD HH:MM:53 Ready to synchronize “User2 Camera” (xxxx-xxxx) (sendreceive)
YYYY-MM-DD HH:MM:53 Ready to synchronize “User2 Videos” (xxxx-xxxx) (sendreceive)
YYYY-MM-DD HH:MM:53 QUIC listener ([::]:22000) starting
YYYY-MM-DD HH:MM:53 Failed initial scan of sendreceive folder “User Pictures” (xxxx-xxxx)
YYYY-MM-DD HH:MM:53 Error on folder “User Pictures” (xxxx-xxxx): stat /mnt/lxcstorage/Photos/User/UserPictures: permission denied
YYYY-MM-DD HH:MM:53 Failed initial scan of sendreceive folder “User2 Pictures” (xxxx-xxxx)
YYYY-MM-DD HH:MM:53 Error on folder “User2 Pictures” (xxxx-xxxx): stat /mnt/lxcstorage/Photos/User2/User2Pictures: permission denied
YYYY-MM-DD HH:MM:53 Failed initial scan of sendreceive folder “User2 Videos” (xxxx-xxxx)
YYYY-MM-DD HH:MM:53 Error on folder “User2 Videos” (xxxx-xxxx): stat /mnt/lxcstorage/Photos/User2/User2Videos: permission denied
Check owner of Photos dir on host system:
ls -l /mnt/hoststorage/
drwxrwxr-- 5 mediawriter mediawriters 4096 Mmm D hh:mm Photos
(have also checked anda all subdirectories share the same permissions)
Check owner of Photos dir on LXC:
ls -l /mnt/lxcstorage/
drwxrwxr-- 5 nobody mediawriters 4096 Mmm D hh:mm Photos
(I assume the issue might have something to do with the ‘nobody’ here, but have no idea why it would make a difference or how to fix it)
Check Syncthing is running as root (on LXC container)
ps aux | grep syncthing
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 161 0.0 0.8 1249208 16896 ? Ssl 16:06 0:00 /usr/bin/syncthing serve --no-browser --no-restart --logflags=0 root 222 0.0 2.4 1251384 51788 ? SNl 16:06 0:05 /usr/bin/syncthing serve --no-browser --no-restart --logflags=0 root 391 0.0 0.0 3324 1536 pts/1 S+ 16:47 0:00 grep syncthing
Check root is a member of the mediawriters group (on LXC container)
id
uid=0(root) gid=0(root) groups=0(root),1308(mediawriters)
Check that root can read/write the directory from LXC:
root@syncthing: mkdir /mnt/lxcstorage/Photos/test && ls
Other Photo Folders test
I’m not sure if there’s a specific command to check that the group is passed through correctly, but if reload the container with the passthrough commented out in the LXC .conf, the above command gives me permission denied.
Any help sorting this, gratefully received