Closed djakupovic closed 5 months ago
I see a mix of Windows volumes and Linux volumes in the same compose file. On WSL2 the path to C:\
is /mnt/c/
. Can you please fix your volumes and try again ? I am using WSL2 to test most of the changes or generic nextcloud experiments and never had any issues in all variants.
EDIT: i just ran your setup without the volumes and it gave me no errors.
nextcloud-postgres | 2024-04-25 18:20:45.715 CEST [1] LOG: database system is ready to accept connections
nextcloud | New nextcloud instance
nextcloud | Initializing finished
nextcloud | => Searching for scripts (*.sh) to run, located in the folder: /docker-entrypoint-hooks.d/before-starting
nextcloud | [25-Apr-2024 16:20:47] NOTICE: fpm is running, pid 1
nextcloud | [25-Apr-2024 16:20:47] NOTICE: ready to handle connections
Edit2: You are also probably missing some configs on WSL2.
Add this to /etc/wsl.conf
[automount]
root = /mnt
options = "metadata"
Then open cmd as admin and type wsl --shutdown (or reboot your PC). Then reopen wsl, restart docker and it should be fine. You can google around how to make docker service autostart on wsl startup.
- "C:/Users/NAS/Docker/Volumes/nextcloud/postgres:/var/lib/postgresql/data"
[...] Insufficient privilege: 7 ERROR: permission denied for table oc_migrations
Can't reproduce this.
There's basically no way for the privileges to be wrong with that particular Compose file (assuming truly starting from scratch), since POSTGRES_PASSWORD is literally the PostgreSQL superuser:
https://github.com/docker-library/docs/tree/master/postgres#environment-variables
The Nextcloud installer initially creates an oc_blah*
account with less privileges for Nextcloud to use then everything else happens within that account (and that account is what gets saved in your initial config.php
).
Best guess: you started a prior postgresql container, stopped it, but didn't clear out the contents of C:/Users/NAS/Docker/Volumes/nextcloud/postgres
in between test runs. But that's just a wild guess.
There's no need to speculate though. You can check the postgresql container. It will indicate whether it's starting from scratch or not, example.
I believe the fella got his issue resolved. On WSL under Windows there's that problem with permissions on files and it just behaves a bit differently than a full Linux.
I managed to reproduce it when I answered before and the problem lies in /etc/wsl.conf
, you need to add this
options = "metadata"
as per my answer above. I'd say this issue is for closing.
Gotcha.
I had to look that up since I haven't messed with WSL2 in awhile. :-) For future reference for those that end up here:
https://learn.microsoft.com/en-us/windows/wsl/wsl-config#automount-options
And, thanks @tzerber for looking into these matters to help sort them out!
Hi,
I tried my best to find the issue, but no success. I also analyzed the Dockerfile in the Nextcloud image as well the php base image. The apache image works flawlessly. I tried nginx and caddy as web server for npm but both with same error. I tried MariaDB and Postgres with the same error. I run the docker compose on docker for windows on wsl2
Issue: I get this error after the login mask for initial installation after I enter the initial admin credentials:
If I try again I get this:
Postgres log says this:
I also logged the Postgres queries executed by Nextcloud and it hits to this error.
I also found this: https://help.nextcloud.com/t/permission-denied-for-table-oc-migrations-on-startup/185597 --> did not help and this: https://github.com/nextcloud/helm/issues/436 --> they have the same error but with the helm chart
What I also tried:
And I hit the same error
I also tried to set the permissions manually with PSQL, but still no success.
I also tried to set the ADMIN ENV variables that it creates the initial user on first start but fails on the same error
Here is the docker compose file I created:
config files, but also if not set, problem still there.
fpm-config:
nginx config: