My nextcloudpi on docker (raspberry pi4) worked well until a few hours ago (i thought). I used the desktop client to sync a folder, backed it up on the server and hat no issues so far. I could upload files from my phone with no problem as well and acces them in the synced folder.
When opening the browser interface on another computer and trying to download a folder, it came an error message which i can not reproduce, because now nothing is working…
However, I looked up the error message and found some things about permissions, so I typed the command: sudo chown -R www-data:www-data /media/storage/nextcloud
to make sure everything is correctly set up. This is the folder where the data from the container is mapped to.
I restarted the container and nothing worked after that. My desktop client does not connect
500 Internal Server Error
nor can i open up the web browser of nextcloud or nextcloudpi settings.
I rebooted the raspberry and restarted the container a few times, giving me the following docker container log:
Starting PHP-fpm
Starting Apache
Starting mariaDB
2020-04-21 7:50:03 0 [Note] mysqld (mysqld 10.3.22-MariaDB-0+deb10u1) starting as process 187
drwxr-xr-x gives the owner all folder permissions, if i didn’t get this wrong.
I chmod the permissions to the following sudo chmod 755 /media/storage/nextcloud/*
still notworking.
i don’t think, that root needs to own some folders to make ncp work, or am I wrong on this?
Even though also changed the owner, with the same result.
Did you run NC under docker container? Then user should be that being used by docker, not www-data.
If you execute:
ps -aux | grep docker
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
docker1 3702 0.2 1.9 2194492 276664 ? Ssl Apr17 13:28 blabla
I suppose you will see a lot of services runned by user docker and root. Then check docker1 user (from above) Group:
groups docker1
docker1 : docker someothergroup
You see that user docker1 belongs to the group docker and someothergroup. Now you have to set permissions to NC folder as for docker, e.g. for this example:
I do not know your docker setup. Do you have any configuration for docker environment? You could set user there, then it should be synced with permissions.
I have no special setup for docker. I run it as root on my raspberry and i am not quite sure what you mean with setting the environment. Can you explain it a bit further?
All folders are now owned by user www-data and group www-data.
In my dockersetup the owner and group of the database folder are: systemd-resolve:systemd-network .
Its hard to tell what it should be from this point of view, what I normally would do in this case is just start a new docker container with different names, volumes and ports and then compare the permissions.