Hi,
I had a similar error when trying to modify the installed nextcloud app from using the default “ixVolume (Dataset created automatically by the system)” directories to a custom “Host Path” directory.
error:
chmod: changing permissions of ‘/var/lib/postgresql/data’: Operation not permitted
I discovered that the permissions on the default directory was different than the permissions on the target directories. It even had the group for the pgData (postgres database directory) owned by a user that does not exist on my system, “docker”.
When I copied the files over, using the archive flag (-a), which retains the permissions on the directories and files being copied over, this worked.
I opened the Shell in “System Settings” and ran the following commands, some of which are specific to how I set up my hard drives and “Datasets”. These, you may need to change to reflect your datasets and directories.
#switch from the admin user to the root user, to be able to run subsequent commands
sudo -i
#change to the directory where I want all of the nextcloud stuff installed to.
cd /mnt/pool1/app/nextcloud
#change the permissions of this directory to be read/write/execute by all users, to eliminate permissions issues. For me, no other user will have shell access to this trueNas, so this is not a security concern for me.
chmod go+rwx *
#show a listing of the directories and default permissions on the default install
ls -al /mnt/pool1/ix-applications/releases/nextcloud/volumes/ix_volumes
#copy over the data while preserving permissions for all of the directories.
cp -ra /mnt/pool1/ix-applications/releases/nextcloud/volumes/ix_volumes/* .
I hope this helps someone else.
The one config that I still don’t understand, is the directory for:
Nextcloud data directory*: /var/www/html/data
I have no such directory when logging in as root, on the “System Settings” shell. It’s almost as this is a default placeholder directory, or a default that’s not used/not relevant for trueNas scale Dragonfish-24.04.2.3, or maybe something else that I don’t understand.
I recently saw a reply on another thread that specifying an ACL (access control list) of 999:999 for these host paths should work, when installing from scratch, but I have not tried that out.