AIO folder permission problem

While modifying permissions for an external storage, I’ve modified accidentally the permissions for the Nextcloud folder

rm: cannot remove '/mnt/ncdata/this-is-a-test-file': Permission denied
Configuring Redis as session handler...
Setting php max children...
stat: cannot stat '/mnt/ncdata': Permission denied
The www-data user doesn't seem to have access rights in the datadir.
Most likely are the files located on a drive that does not follow linux permissions.
Please adjust the permissions like mentioned below.
The found permissions are:
(userID:groupID permissions)
but they should be:
33:0 750
(userID:groupID permissions)
              now

I’m using Portainer. I cannot access the console of the container ’ nextcloud-aio-nextcloud’ as it’s stuck in a boot loop.

Here are the permission as seen by the host :

~# ls -la /mnt/appdata/nextcloud/
total 56
drwxr-s---+  9 www-data root 4096 Mar 23 11:18 .
drwxr-x---   4 root     root 4096 Mar 21 10:38 ..
-rwxr-x---+  1 www-data root  542 Mar  2 10:23 .htaccess
-rwxr-x---+  1 www-data root    0 Mar  2 10:23 .ocdata
drwxr-s---+  6 www-data root   76 Aug 27  2022 admin
drwxr-s---+ 14 www-data root 4096 Dec 31 11:56 appdata_ocpxb13p7l9l
-rwxr-x---+  1 www-data root    0 Aug 19  2022 audit.log
drwxr-s---+  7 www-data root   91 Dec 10 19:28 christelle
drwxr-s---+  2 www-data root   27 Mar  2 10:23 files_external
-rwxr-x---+  1 www-data root    0 Mar 23 10:44 fingerprint.update
-rwxr-x---+  1 www-data root    0 Aug 21  2022 flow.log
drwxr-s---+  2 www-data root    6 Aug 19  2022 gpxpod
-rwxr-x---+  1 www-data root    0 Mar  2 10:23 index.html
-rwxr-x---+  1 www-data root    0 Aug 19  2022 nextcloud.log
-rwxr-x---+  1 www-data root    0 Mar 23 10:44 skip.update
drwxr-s---+  7 www-data root   91 Aug 20  2022 sylvain
drwxr-s---+  3 www-data root 4096 Mar 16 14:03 tmp

It’s the folder specified in my docker compose :

NEXTCLOUD_DATADIR=/mnt/appdata/nextcloud

Here what I’ve tried as it’s showed in the log , as root on the host:

chown -R 33:0 /mnt/appdata/nextcloud/
chmod -R 750 /mnt/appdata/nextcloud/

Any idea ?

Hi, is the data residing on some kind of FUSE mount? And can you share the output of ls -la /mnt/appdata ?

Hi, yes indeed I’m running Proxmox with portainer on LXC. It was all running well before my mistake.

~# ls -la /mnt/appdata  
total 20
drwxr-x---   4 root     root 4096 Mar 21 10:38 .
drwxr-x---  11 root     root 4096 Mar 21 11:15 ..
drwxr-x---   2 root     root 4096 Mar 21 10:38 config.yml
drwxr-s---+  9 www-data root 4096 Mar 23 11:18 nextcloud

Please run sudo chmod +r /mnt && sudo chmod +r /mnt/appdata and restart AIO and check if that makes things work again.

The result is the same after the command and a restart.
I’ve got a recent backup, do you think it would solve this problem if I clear /mnt/appdata/nextcloud/ and restore my backup ?

What is the output of ls -la /mnt/appdata now?

Here it is :

~# ls -la /mnt/appdata
total 20
drwxr-xr--   4 root     root 4096 Mar 21 10:38 .
drwxr-xr--  11 root     root 4096 Mar 21 11:15 ..
drwxr-x---   2 root     root 4096 Mar 21 10:38 config.yml
drwxr-s---+  9 www-data root 4096 Mar 23 11:18 nextcloud

Okay, looks good in general. Did you already restarted the containers from the AIO interface?

I did restart from the AIO interface and even restared the VM. The logs still show this :

rm: cannot remove '/mnt/ncdata/this-is-a-test-file': Permission denied
Configuring Redis as session handler...
Setting php max children...
stat: cannot stat '/mnt/ncdata': Permission denied
The www-data user doesn't seem to have access rights in the datadir.
Most likely are the files located on a drive that does not follow linux permissions.
Please adjust the permissions like mentioned below.
The found permissions are:
(userID:groupID permissions)
but they should be:
33:0 750
(userID:groupID permissions)

Okay, and you said you are not using a Fuse mount as datadir?

I’m new to Proxmox but I had to enable FUSE on this VM to be able to restore my backup which is not on the root drive (another physical drive) but mounted the same way as the datadir.

How is it mounted exactly on the host? E.g. via /etc/fstab?

Exactly. Via /etc/fstab

PARTUUID=4ce0d341-40cc-428b-92d6-3f0d8f473a68   /mnt/data   xfs   defaults   0   2

I’ve got no problem accessing it on the host or the VM.

Can you post the output of sudo docker inspect nextcloud-aio-nextcloud ?

Here is the ouput :

Looks good. Sorry, I am out of ideas now.

Thank you for your time. I will start again with a fresh VM and restore my backup.