Permission issue with rclone in docker

What is the problem you are having with rclone?

I'm login with a non-root account but it is in administrator group ,which is UID1000:GID0 on my QNAP NAS.
I want to run rclone via docker and expose the resulting fuse mount to the host.

However, if I add --user 1000:0 on the container start command line, I receive below warning:

2021/08/03 07:06:24 ERROR : Failed to create vfs cache - disabling: failed to make cache directory: make cache directory failed: mkdir /share: permission denied
2021/08/03 07:06:24 mount helper error: fusermount: failed to open /dev/fuse: Permission denied
2021/08/03 07:06:24 Fatal error: failed to mount FUSE fs: fusermount: exit status 1

After checking, only the root account has RW permission on /dev/fuse.

If I add --user 0:0 on the container start command line, the mount is successful.
But all the mounted files and folders are writable for root user only. Other users can only read.

My question is how shall I do to have the files with RW permission for non-root users or groups?

What is your rclone version (output from rclone version)

1.56.0

Which OS you are using and how many bits (eg Windows 7, 64 bit)

QNAP QTS 4.5.4 with docker

The command you were trying to run (eg rclone copy /tmp remote:tmp)

docker run --rm \
    --volume /share/CACHEDEV1_DATA/Container/rclone/config:/config/rclone \
    --volume /share/CACHEDEV1_DATA/Public/data:/data:shared \
    --user $(id -u):$(id -g) \
    --volume /etc/passwd:/etc/passwd:ro \
    --volume /etc/group:/etc/group:ro \
    --device /dev/fuse \
    --cap-add SYS_ADMIN \
    --security-opt apparmor:unconfined \
    rclone/rclone \
    mount OneDrive:/ /data/mount --vfs-cache-mode full --dir-cache-time 12h --vfs-read-chunk-size 32M --vfs-read-chunk-size-limit 1G --allow-other --transfers 4 --buffer-size 32M --low-level-retries 200 --dir-perms 777 --file-perms 777

A log from the command with the -vv flag

2021/08/03 07:40:40 DEBUG : Creating backend with remote "OneDrive:/"
2021/08/03 07:40:40 DEBUG : Using config file from "/config/rclone/rclone.conf"
2021/08/03 07:40:40 DEBUG : fs cache: renaming cache item "OneDrive:/" to be canonical "OneDrive:"
2021/08/03 07:40:40 INFO  : One drive root '': poll-interval is not supported by this remote
2021/08/03 07:40:40 DEBUG : vfs cache: root is "/share/homes/[my user name]/.cache/rclone/vfs/OneDrive"
2021/08/03 07:40:40 DEBUG : vfs cache: metadata root is "/share/homes/[my user name]/.cache/rclone/vfs/OneDrive"
2021/08/03 07:40:40 DEBUG : Creating backend with remote "/share/homes/[my user name]/.cache/rclone/vfs/OneDrive"
2021/08/03 07:40:40 ERROR : Failed to create vfs cache - disabling: failed to make cache directory: make cache directory failed: mkdir /share: permission denied
2021/08/03 07:40:40 DEBUG : One drive root '': Mounting on "/data/mount"
2021/08/03 07:40:40 mount helper error: fusermount: failed to open /dev/fuse: Permission denied
2021/08/03 07:40:40 Fatal error: failed to mount FUSE fs: fusermount: exit status 1

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.