nextclouddb not accepting configured passwords?

  • I have just done a fresh install of OMV5 and I am in the process of setting up Nextcloud via Docker. I have followed this guide https://forum.openmediavault.o…g-omv-and-docker-compose/and I have the containers set up and working. The problems began when I opened Nextcloud for the first time and tried to configure the database:

    Error while trying to create admin user: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [1045] Access denied for user 'root'@'nextcloud.nextcloud_default' (using password: YES) 

    Now I did the initial install with these settings in docker-compose.yml:

          - PUID=1001 #change PUID if needed
          - PGID=100  #change PGID if needed
          - MYSQL_ROOT_PASSWORD=mypasshere

    But it did not work. I then tried to run mysql -u root -p inside the container as per these instructions RE: Nextcloud with Letsencrypt using OMV and docker-compose - Q&A but it just kept saying "ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)" even though the password was most definitely correct. I verified the password in the container settings and it was correct.

    I googled some more and found this thread RE: Nextcloud with Letsencrypt using OMV and docker-compose - Q&A which has a post saying to set up mariadb with these parameters:

    - MYSQL_DATABASE=nextcloud
    - MYSQL_USER=nextcloud
    - MYSQL_PASSWORD=secretpassword

    So I changed those in docker-compose.yml, (in order to rule out locale issues I tested this with just secretpassword) ran docker-compose up -d but I am still having the same problem with the Nextcloud setup and I still can't access the database via CLI.:

    root@39142896bec1:/# mysql -u nextcloud -p
    ERROR 1045 (28000): Access denied for user 'nextcloud'@'localhost' (using password: YES)

    This is not making any sense, it seems that for some reason the user settings for mariadb are being ignored and I therefore can't access the database. There are no errors in the nextclouddb container logs and the config looks ok:

    What on earth could be the problem? :D

    • Official Post

    Just tried in a VM as described in the guide. It worked liked described.

    Can you post your docker-compose and what you entered in the initial nextcloud welcome screen?

    from guide:

    • Database user --> "root"
    • Database password --> password which has been specified in the docker-compose file with MYSQL_ROOT_PASSWORD
    • Database name --> "nextcloud"
    • localhost host --> "nextclouddb"

    This is the docker-compose I used (without swag)

  • Here is my docker-compose:

    And here is what I enter in the Nextcloud welcome screen:

  • Eh I noticed just now that my OMV OS drive was 100% full, which was probably causing the issue with accessing the database. And yes I used "passwordedited" as password.

    /var/lib/docker/overlay2 was for some reason taking in excess of 27 gigabytes even though this is a fresh OMV install and so far I have only installed the Nextcloud and Swag containers. I have no idea why it was taking up so much space.

    In any case, I did a docker system prune --all which cleared all the extra stuff, after which I stopped and removed the running containers and deleted the appdata -folder.

    ...and that finally did the trick, now I was able to finish the Nextcloud install :). Thank you for the assistance!

  • jackster

    Added the Label resolved
    • Official Post

    You probably need to address that before moving to far it is very likely to happen again. It's advisable to setup docker to store your containers on one of your storage drives (which I'm assuming are much larger). The path can be set on the omv-extras/docker tab.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!