Score:0

Changed permissions of docker volumes folder > You don't have permission to access this resource

au flag

I am running an instance of nextcloudpi in docker. I wanted to sync the data folder between two server via rsync, but got a permission folder. So I tried to give my user "John" the permission to read the folder. It seems I did something wrong as know the instance cannot access the data folder and in the browser when trying to access nextcloud, I get "You don't have permission to access this resource." Can someone please tell me how to fix this? What should the permissions in the folder are? Right know, I have the following permissions:

$:/var/lib/docker$ sudo ls -l
drwx--x--x 4 root root 8 Mai 28 20:09 buildkit
drwx------ 3 root root 3 Jun 17 18:25 containers
drwx------ 3 root root 3 Mai 28 20:09 image
drwxr-x--- 3 root root 3 Mai 28 20:09 network
drwx------ 4 root root 4 Mai 28 20:09 plugins
drwx------ 2 root root 2 Jul  2 17:14 runtimes
drwx------ 2 root root 2 Mai 28 20:09 swarm
drwx------ 2 root root 2 Jul  2 17:14 tmp
drwx------ 2 root root 2 Mai 28 20:09 trust
drwxr--r-- 3 root root 5 Jul  2 17:14 volumes
drwx------ 3 root root 3 Mai 28 20:10 zfs

$ sudo ls -l volumes
total 7
brw------- 1 root root 0, 64 Jul  2 17:14 backingFsBlockDev
-rwxr--r-- 1 root root 32768 Jul  2 17:14 metadata.db
drwxr--r-- 3 root root     3 Mai 28 20:11 ncdata
Score:0
vn flag

To avoid permission issues, I would recommend using linuxserver.io's NextCloud image. Here you can set the PGID and PUID easily in the docker or docker-compose configuration file.

For instance, if the PGID and PUID of John is 1000, just use the default value.

Generally, for the data for each container, you should have the following permissions:

  • For files: -rw-r--r-- 1 John
  • And for directories: -rwxr-xr-x 1 John

Also, did you add the user John to the docker group? Use this command:

sudo usermod -aG docker John

Confirm with the groups command, that you're a member of the docker group.

Simon2019 avatar
au flag
I added John to the group and set all the permissions to -rwxr-xr-x. But I still have a permission error. What happens if I reinstall docker completely (sudo apt reinstall docker-compose)? Will this fix the permission and keep the volumes? Or are the volume deleted then?
Artur Meinild avatar
vn flag
You should try and remake the NextCloud container with the proper permissions. Also note, that `docker-compose` is not `docker`. `docker-compose` is "only" an abstraction layer that allows you to configure containers with `.yaml` files instead of command parameters.
Artur Meinild avatar
vn flag
Also, I don't believe persistent volumes are deleted, unless you specify this.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.