Nextcloud version - 28
Operating system - OMV6 and Docker/Portainer
Is this the first time you’ve seen this error? - Yes
Hi all, sorry for the long read but I was hoping to provide as much useful information and context as possible.
So after having my Nextcloud up and running for the past year or so, I have suddenly been unable to access my container due to what seem to be permission errors. Seeing the following when visiting my containers ip.
‘Configuration was not read or initialized correctly, not overwriting /var/www/html/config/config.php’
All my files appear to be correct and in the right places, including the .ocdata file and config.php. For context, the error occurred after I installed the Nextcloud Bookmarks App (3 days ago) and Pageres via Node.js (Day of issue), which required me to enable backports on my OMV6 server as well as install the npm package manager to get working properly. I am not sure if the two are connected but shortly after this process, I noticed that I was getting the above error on trying to access my NC container. According to my logs, my container also tried to upgrade itself around that time which is odd as I successfully upgraded it last week and was using it fine since.
Reading online, it seemed most likely to be a permission issue so I ran:
exec -u www-data -it nextcloud-app-1 /bin/bash and tried to run sudo chmod -R 755 /var/www/html/data/ but bumped into an output stating permission denied and chmod -R 755 /var/www/html/ which seemed to run but gave the operation denied error.
I decided to try rsyncing over a backup from around a week ago to see if this would fix the issue but I ran into the same issue after restarting my docker and pointing it to the new location.
So I thought it would just be easier to re-deploy and re-pull the image, hoping it would overwrite whatever issue had occurred, but instead I am running into this error on trying to access my container:
///
## Error
** Your data directory is invalid.Ensure there is a file called “.ocdata” in the root of the data directory.*
** Cannot write into “config” directory.This can usually be fixed by giving the web server write access to the config directory. See Introduction — Nextcloud latest Administration Manual latest documentation. Or, if you prefer to keep config.php file read only, set the option “config_is_read_only” to true in it. See Configuration Parameters — Nextcloud latest Administration Manual latest documentation*
** Cannot write into “apps” directory.This can usually be fixed by giving the web server write access to the apps directory or disabling the App Store in the config file.*
** Your data directory is not writable.Permissions can usually be fixed by giving the web server write access to the root directory. See Introduction — Nextcloud latest Administration Manual latest documentation*
///
I have also tried using occ to disable the Bookmark App in case that was the issue but am receiving this error:
///
root@redacted~# docker exec -u www-data -it nextcloud-app-1 php occ
Console has to be executed with the user that owns the file config/config.php
Current user id: 33
Owner id of config.php: 0
Try adding ‘sudo -u #0’ to the beginning of the command (without the single quotes)
If running with ‘docker exec’ try adding the option ‘-u 0’ to the docker command (without the single quotes)
*root@redacted:~# *
///
I have also tried adding PUID and PGID variables under my environment section of my Portainer stack, but this did not seem to make a difference.
Could anyone help me fix this permission issue? A lot of the information I found seems to relate to older versions of NC or alternative installs (not Docker) and I am not that familiar with user management or command line syntax. I feel like I have gotten myself a bit tangled up here tbh.
Log showing my container’s attempt to upgrade itself:
[Sun Mar 24 23:49:23.409443 2024] [mpm_prefork:notice] [pid 1] AH00170: caught SIGWINCH, shutting down gracefully
Initializing nextcloud 28.0.3.2 …
Upgrading nextcloud from 27.1.1.0 …
=> Searching for scripts (.sh) to run, located in the folder: /docker-entrypoint-hooks.d/pre-upgrade*
Nextcloud is not installed - only a limited number of commands are available
-
*
- Command “upgrade” is not defined. *
-
*
=> Searching for scripts (.sh) to run, located in the folder: /docker-entrypoint-hooks.d/before-starting*
AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using redacted… Set the ‘ServerName’ directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using redacted. Set the ‘ServerName’ directive globally to suppress this message
[Mon Mar 25 00:03:21.660939 2024] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.57 (Debian) PHP/8.2.17 configured – resuming normal operations
[Mon Mar 25 00:03:21.661083 2024] [core:notice] [pid 1] AH00094: Command line: ‘apache2 -D FOREGROUND’
redacted - redacted[25/Mar/2024:00:03:30 +0000] “POST /index.php/apps/bookmarks/public/rest/v2/lock HTTP/1.1” 503 2392 “-” “Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36”
redacted - redacted [25/Mar/2024:00:03:33 +0000] “DELETE /index.php/apps/bookmarks/public/rest/v2/lock HTTP/1.1” 503 2392 “-” “Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36”
redacted - redacted [25/Mar/2024:00:03:37 +0000] “POST /index.php/apps/bookmarks/public/rest/v2/lock HTTP/1.1” 503 2392 “-” “Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36”
redacted - redacted [25/Mar/2024:00:03:39 +0000] “GET /index.php/204 HTTP/1.1” 503 2392 “-” “Mozilla/5.0 (Linux) mirall/3.11.0git (Nextcloud, fedora-6.7.9-100.fc38.x86_64 ClientArchitecture: x86_64 OsArchitecture: x86_64)”
redacted - redacted [25/Mar/2024:00:04:30 +0000] “POST /index.php/apps/bookmarks/public/rest/v2/lock HTTP/1.1” 503 2392 “-” “Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36”