Error issues on omv docker Mariadb and Nextcloud

  • I Followed https://www.youtube.com/watch?v=PKsq7k2pwsI to install Nextcloud using docker, some errors happen when I config the Mariadb.


    when came to the step mysql -uroot -p, it resulted:


    Warning: World-writable config file '/etc/mysql/conf.d/custom.cnf' is ignored
    Enter password:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)


    I tried to chmod the file custom.cnf, but it seems no use, still 777


    I can't connect to the MariaDB. Could anyone help me to figure out and solve the problem?




    The following are the contents of the log:
    ------------------------------------
    _ ()
    | | ___ _ __
    | | / __| | | / \
    | | \__ \ | | | () |
    |_| |___/ |_| \__/



    Brought to you by linuxserver.io
    We gratefully accept donations at:
    https://www.linuxserver.io/donate/
    -------------------------------------
    GID/UID
    -------------------------------------


    User uid: 1000
    User gid: 100
    -------------------------------------


    chown: changing ownership of '/config': Operation not permitted
    [cont-init.d] 10-adduser: exited 0.
    [cont-init.d] 30-config: executing...
    [cont-init.d] 30-config: exited 0.
    [cont-init.d] 40-initialise-db: executing...
    Setting Up Initial Databases
    chown: changing ownership of '/config/log/mysql/mariadb-bin.state': Operation not permitted
    chown: changing ownership of '/config/log/mysql/mariadb-bin.000001': Operation not permitted
    chown: changing ownership of '/config/log/mysql/mariadb-bin.index': Operation not permitted
    chown: changing ownership of '/config/log/mysql': Operation not permitted
    Warning: World-writable config file '/etc/mysql/conf.d/custom.cnf' is ignored
    chown: changing ownership of '/config/databases': Operation not permitted
    Cannot change ownership of the database directories to the 'abc'
    user. Check that you have the necessary permissions and try again.
    Warning: World-writable config file '/etc/mysql/conf.d/custom.cnf' is ignored
    2019-12-11 22:00:44 0 [Note] mysqld (mysqld 10.4.10-MariaDB-1:10.4.10+maria~bionic-log) starting as process 273 ...
    2019-12-11 22:00:44 0 [Warning] Setting lower_case_table_names=2 because file system for /config/databases/ is case insensitive
    2019-12-11 22:00:44 0 [Note] InnoDB: Using Linux native AIO
    2019-12-11 22:00:44 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
    2019-12-11 22:00:44 0 [Note] InnoDB: Uses event mutexes
    2019-12-11 22:00:44 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
    2019-12-11 22:00:44 0 [Note] InnoDB: Number of pools: 1
    2019-12-11 22:00:44 0 [Note] InnoDB: Using SSE2 crc32 instructions
    2019-12-11 22:00:44 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
    2019-12-11 22:00:44 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
    2019-12-11 22:00:44 0 [Note] InnoDB: Completed initialization of buffer pool
    2019-12-11 22:00:44 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
    2019-12-11 22:00:44 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
    2019-12-11 22:00:44 0 [Note] InnoDB: Creating shared tablespace for temporary tables
    2019-12-11 22:00:44 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
    2019-12-11 22:00:45 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
    2019-12-11 22:00:45 0 [Note] InnoDB: 10.4.10 started; log sequence number 113847; transaction id 9
    2019-12-11 22:00:45 0 [Note] InnoDB: Loading buffer pool(s) from /config/databases/ib_buffer_pool
    2019-12-11 22:00:45 0 [Note] Plugin 'FEEDBACK' is disabled.
    2019-12-11 22:00:45 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
    2019-12-11 22:00:45 0 [Note] InnoDB: Buffer pool(s) load completed at 191211 22:00:45
    2019-12-11 22:00:45 6 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1017: Can't find file: './mysql/' (errno: 2 "No such file or directory")
    2019-12-11 22:00:45 0 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
    2019-12-11 22:00:45 0 [Note] Server socket created on IP: '::'.
    2019-12-11 22:00:45 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.db' doesn't exist
    2019-12-11 22:00:45 0 [ERROR] Aborting

  • Should I run the below commands with docker1 or root?


    mkdir /home/docker1
    mkdir /home/docker1/nextcloud
    cd /home/docker1/nextcloud
    nano docker-compose.yml

    as you like. Probably as docker1. Otherwise you have files in the home directory which are not accessible for the user.



    docker-compose up -d
    docker logs -f letsencrypt

    These commands have to be executed by root or a user in the docker group

  • as you like. Probably as docker1. Otherwise you have files in the home directory which are not accessible for the user.


    These commands have to be executed by root or a user in the docker group

    Is that mean I should add docker1 to docker group ? or to other groups?

  • The easiest way is too use root.

    Actually when following the youtuber , all the comands run with root or using GUI (web logined as admin). I use the PUID and PGID of my own user, but these permission errors below made me crazy!


    chown: changing ownership of '/config/log/mysql/mariadb-bin.state': Operation not permitted
    chown: changing ownership of '/config/log/mysql/mariadb-bin.000001': Operation not permitted
    chown: changing ownership of '/config/log/mysql/mariadb-bin.index': Operation not permitted
    chown: changing ownership of '/config/log/mysql': Operation not permitted
    Warning: World-writable config file '/etc/mysql/conf.d/custom.cnf' is ignored
    chown: changing ownership of '/config/databases': Operation not permitted
    Cannot change ownership of the database directories to the 'abc'
    user. Check that you have the necessary permissions and try again.
    Warning: World-writable config file '/etc/mysql/conf.d/custom.cnf' is ignored

  • I tried again following the guide,create a new user docker,add it to all the groups including group docker,make the directories,edit docker-compose.yml(I don’t have a URL domain,so I comment the Letsencrypt part),run docker-compose up -d as root.


    After all these steps,the Mariadb and Nextcloud in docker GUI appeared to be running,but I still can’t connect to the database.


    The nextcloud index page showes “Error while trying to create admin user: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000][2002]Connection refused}”


    In the logs,these are hundreds of “chown Operation not permitted”errors.


    I am very confused by the the permission errors and don’t know how to fix them.

  • exfat is not able to handle Unix file permissions and chmod won't have any effects.

    After I format the HHD to ext4, all the chown errors gone!


    when I use a directory in the system disk as data volumes, everything is alright. The nextcloud run correctly.


    When I repeat the whole install, only change the volumes of Nextcloud and Mariadb to the external disk, the first page of nextcloud comes to freeze after click "finish setup" and "504 Gateway Time-out" appears.


    I tried serval time and can't go through this step. no error in the docker app logs.


    What 's this mean? something wrong with the database or nginx?

  • Sorry I don't have an answer to this problem.

    I tried to chmod 777 the external disk, still freeze.


    Here are the contents of Nginx error logs:
    2019/12/14 00:16:58 [error] 352#352: *2 upstream timed out (110: Operation timed out) while reading response header from upstream, client: 192.168.1.15, server: _, request: "POST /index.php HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.1.6:450"
    2019/12/14 00:19:18 [error] 352#352: *2 upstream timed out (110: Operation timed out) while reading response header from upstream, client: 192.168.1.15, server: _, request: "POST /index.php HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.1.6:450"
    2019/12/14 00:21:13 [error] 352#352: *2 upstream timed out (110: Operation timed out) while reading response header from upstream, client: 192.168.1.15, server: _, request: "POST /index.php HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.1.6:450"
    2019/12/14 00:29:33 [error] 346#346: *1 upstream timed out (110: Operation timed out) while reading response header from upstream, client: 192.168.1.15, server: _, request: "POST /index.php HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.1.6:450"
    2019/12/14 00:33:01 [error] 346#346: *1 upstream timed out (110: Operation timed out) while reading response header from upstream, client: 192.168.1.15, server: _, request: "POST /index.php HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.1.6:450"


    Here are the contents of php error logs:
    [13-Dec-2019 16:14:47] NOTICE: fpm is running, pid 334
    [13-Dec-2019 16:14:47] NOTICE: ready to handle connections
    [13-Dec-2019 16:23:39] NOTICE: Terminating ...
    [13-Dec-2019 16:23:39] NOTICE: exiting, bye-bye!
    [13-Dec-2019 16:26:42] NOTICE: fpm is running, pid 328


    [13-Dec-2019 16:26:42] NOTICE: ready to handle connections

    • Offizieller Beitrag

    I have had this same problem many times before. This isn’t a scientific answer but it almost always has worked for me. Refresh the page, click the back button, clear your browser cache, etc. Try to get back to your setup page. Keep entering your setup information. Make sure you are using the correct database username and password, etc. Don’t scrap it and start over.


    Sometimes it’s just a matter of giving your database enough time to finish its install. Go make a cup of coffee.

    System Backup Typo alert: Under the Linux section the command should be sudo umount /dev/sda1 NOT sudo unmount /dev/sda1

    Backup Data Disk to Backup Disk on Same Machine: In a Scheduled Job:rsync -av --delete /srv/dev-disk-by-uuid-f8814ed9-9a5c-4e1c-8830-426968c20ea3/ /srv/dev-disk-by-uuid-e67439d5-00a3-4942-bd5f-b84ab86aa850/ Don't forget trailing slashes, and BE CAREFUL. (HT: Getting Started with OMV5)

    Equipment - Thinkserver TS140, NanoPi M4 (v.1), Odroid XU4 (Using DietPi): PiHole

  • Have freshed the page and refilled it dozens of times, even change browsers, conected from different devices... alway the “504 gateway time-out”


    Looks like something block the page from creating admin user of nextcloud, but I am not sure.

  • Sorry I don't have an answer to this problem.

    I try to use a directory in the system disk as data volumes again, this time can't go through the the first page ,the same freeze after click "finish setup" and "504 Gateway Time-out" appears.
    probably not a volume setup problem.

    I have had this same problem many times before. This isn’t a scientific answer but it almost always has worked for me. Refresh the page, click the back button, clear your browser cache, etc. Try to get back to your setup page. Keep entering your setup information. Make sure you are using the correct database username and password, etc. Don’t scrap it and start over.


    Sometimes it’s just a matter of giving your database enough time to finish its install. Go make a cup of coffee.

    I have tried all the way you mentioned, even reinstall the nextcloud and mariadb many times, can't go through the first page all the time.


    when I fill 192.168.1.6:450 in the localhost, page freeze and “504 gateway time-out”. when I fill 192.168.1.6:3306 in the localhost, shows "Error while trying to create admin user: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused"


    I can login to the database with "mysql -uroot -p" like @Techno Dad Life did in the first YouTube video, but no use.

    • Offizieller Beitrag

    I am sorry. Maybe you aren’t using the right user or need to just type admin in the first slot. But if you get a setup screen you can’t be far off.

  • Finally it works, after a lot of trials.


    My conclusion:The last slot of localhost can't be filled by IP address, the only correct should be "nextclouddb".


    Don't understand this, in my thought IP address should rightly be filled as localhost.

  • The problem is that the two guides are not compatible with another.
    When you use the docker-compose version by macom it is set that the port 3306 of the mariadb container is only accessible through dockers internal dns server. Which uses the container name as address (hence the need to use nextclouddb a database path).
    TDL exposes the mariadb port to the local network by entering 3306 - > 3306 in the ports section of the docker gui. This is why the database is reachable through ip + port.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!