linuxserver / docker-nextcloud

GNU General Public License v3.0
678 stars 128 forks source link

[BUG] permission error on NFS volume #377

Closed the-packet-fang closed 8 months ago

the-packet-fang commented 8 months ago

Is there an existing issue for this?

Current Behavior

While trying to migrate the nc config and data from a local bind to an NFS docker volume, I keep getting the below permission errors. When connected to the container I can see that all config files are attached to /config. I added root ALL=(target_user) NOPASSWD: /bin/mkdirto the sudoer, and tried sudo -u abc -c mkdir fromcont and I could see the folder created on the server side.

Expected Behavior

the container should pick the config files and work just like the last state were it was left

Steps To Reproduce

  1. upload the conf folder to NFS_server://container_volumes/nc/conf
  2. upload the data folder to NFS_server://container_volumes/nc/data
  3. chown both folders to 997
  4. create two volume for each folder
  5. create the container and attach the volumes

Environment

- OS: ubuntu 22
- How docker service was installed: following the official document

CPU architecture

x86-64

Docker creation

docker volume create --driver local \
--opt type=nfs \
--opt o=addr=192.168.100.3,nfsvers=4,async \
--opt device=:/container_volumes/nc/conf \
nc-conf-volume

docker volume create --driver local \
--opt type=nfs \
--opt o=addr=192.168.100.3,nfsvers=4,async \
--opt device=:/container_volumes/nc/data \
nc-data-volume

docker run -d \
  --name=nextcloud \
  -e PUID=997 \
  -e PGID=997 \
  -e TZ=Africa/Casablanca \
  --network Harbor-net \
  --ip 192.168.100.20 \
  -v nc-conf-volume:/config \
  -v nc-data-volume:/data \
  --restart unless-stopped \
  lscr.io/linuxserver/nextcloud:latest

Container logs

2023-11-03T01:37:50.951785172Z 
2023-11-03T01:37:50.951794932Z       ██╗     ███████╗██╗ ██████╗ 
2023-11-03T01:37:50.951801928Z       ██║     ██╔════╝██║██╔═══██╗
2023-11-03T01:37:50.951808517Z       ██║     ███████╗██║██║   ██║
2023-11-03T01:37:50.951814852Z       ██║     ╚════██║██║██║   ██║
2023-11-03T01:37:50.951821127Z       ███████╗███████║██║╚██████╔╝
2023-11-03T01:37:50.951827443Z       ╚══════╝╚══════╝╚═╝ ╚═════╝ 
2023-11-03T01:37:50.951833924Z 
2023-11-03T01:37:50.951840138Z    Brought to you by linuxserver.io
2023-11-03T01:37:50.951846295Z ───────────────────────────────────────
2023-11-03T01:37:50.952137136Z 
2023-11-03T01:37:50.952148861Z To support LSIO projects visit:
2023-11-03T01:37:50.952155696Z https://www.linuxserver.io/donate/
2023-11-03T01:37:50.952162084Z 
2023-11-03T01:37:50.952168264Z ───────────────────────────────────────
2023-11-03T01:37:50.952175139Z GID/UID
2023-11-03T01:37:50.952195652Z ───────────────────────────────────────
2023-11-03T01:37:50.954334293Z 
2023-11-03T01:37:50.954347898Z User UID:    997
2023-11-03T01:37:50.954355271Z User GID:    997
2023-11-03T01:37:50.954374181Z ───────────────────────────────────────
2023-11-03T01:37:50.954381726Z 
2023-11-03T01:37:50.977057130Z find: /config/nginx/nginx.conf.sample: Permission denied
2023-11-03T01:37:50.977445719Z find: /config/nginx/site-confs/default.conf.sample: Permission denied
2023-11-03T01:37:50.977694373Z find: /config/nginx/ssl.conf.sample: Permission denied
2023-11-03T01:37:50.979432837Z cp: cannot create regular file '/config/nginx/nginx.conf.sample': Permission denied
2023-11-03T01:37:50.979678577Z cp: cannot create regular file '/config/nginx/ssl.conf.sample': Permission denied
2023-11-03T01:37:50.981270586Z cp: cannot create regular file '/config/nginx/site-confs/default.conf.sample': Permission denied
2023-11-03T01:37:50.981632174Z s6-rc: warning: unable to start service init-samples: command exited 1
github-actions[bot] commented 8 months ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

aptalca commented 8 months ago

https://docs.linuxserver.io/misc/support-policy/#unsupported

the-packet-fang commented 8 months ago

thanks for the reference