Nextcloud, docker, can't finish wizard

Hi,
I’ve tried installation of NC in docker, but base configuration does not work for me. After creating docker containers and start up, NC can’t connect to mysql container.
I see error SQLSTATE[HY000] [2002] Connection refused , or SQLSTATE[HY000] [2006] MySQL server has gone away.

Here is base config from github page, and filled only mysql passwords:

docker compose:
    version: '2'

volumes:
  nextcloud:
  db:

services:
  db:
    image: mariadb
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    restart: always
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=root_pwd
      - MYSQL_PASSWORD=password
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  app:
    image: nextcloud
    ports:
      - 8080:80
    links:
      - db
    volumes:
      - nextcloud:/var/www/html
    restart: always

I’ve tried localhost or 127.0.0.1 as mysql host in configuration wizard, but none of them works.

db container logs:

2020-03-18 13:06:13+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.4.12+maria~bionic started.
2020-03-18 13:06:15+00:00 [Note] [Entrypoint]: Switching to dedicated user ‘mysql’
2020-03-18 13:06:15+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.4.12+maria~bionic started.
2020-03-18 13:06:16 0 [Note] mysqld (mysqld 10.4.12-MariaDB-1:10.4.12+maria~bionic) starting as process 1 …
2020-03-18 13:06:16 0 [Warning] You need to use --log-bin to make --binlog-format work.
2020-03-18 13:06:16 0 [Note] InnoDB: Using Linux native AIO
2020-03-18 13:06:16 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-03-18 13:06:16 0 [Note] InnoDB: Uses event mutexes
2020-03-18 13:06:16 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-03-18 13:06:16 0 [Note] InnoDB: Number of pools: 1
2020-03-18 13:06:16 0 [Note] InnoDB: Using SSE2 crc32 instructions
2020-03-18 13:06:16 0 [Note] mysqld: O_TMPFILE is not supported on /tmp (disabling future attempts)
2020-03-18 13:06:16 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
2020-03-18 13:06:16 0 [Note] InnoDB: Completed initialization of buffer pool
2020-03-18 13:06:16 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-03-18 13:06:16 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=61365
2020-03-18 13:06:17 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-03-18 13:06:17 0 [Note] InnoDB: Removed temporary tablespace data file: “ibtmp1”
2020-03-18 13:06:17 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-03-18 13:06:17 0 [Note] InnoDB: Setting file ‘./ibtmp1’ size to 12 MB. Physically writing the file full; Please wait …
2020-03-18 13:06:17 0 [Note] InnoDB: File ‘./ibtmp1’ size is now 12 MB.
2020-03-18 13:06:17 0 [Note] InnoDB: Waiting for purge to start
2020-03-18 13:06:17 0 [Note] InnoDB: 10.4.12 started; log sequence number 61374; transaction id 21
2020-03-18 13:06:17 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-03-18 13:06:17 0 [Note] Plugin ‘FEEDBACK’ is disabled.
2020-03-18 13:06:17 0 [Note] InnoDB: Buffer pool(s) load completed at 200318 13:06:17
2020-03-18 13:06:17 0 [Note] Server socket created on IP: ‘::’.
2020-03-18 13:06:17 0 [Warning] ‘user’ entry ‘root@6464a5b3ed7b’ ignored in --skip-name-resolve mode.
2020-03-18 13:06:17 0 [Warning] ‘user’ entry ‘@6464a5b3ed7b’ ignored in --skip-name-resolve mode.
2020-03-18 13:06:17 0 [Warning] ‘proxies_priv’ entry ‘@% root@6464a5b3ed7b’ ignored in --skip-name-resolve mode.
2020-03-18 13:06:17 0 [Note] Reading of all Master_info entries succeeded
2020-03-18 13:06:17 0 [Note] Added new Master_info ‘’ to hash table
2020-03-18 13:06:17 0 [Note] mysqld: ready for connections.
Version: ‘10.4.12-MariaDB-1:10.4.12+maria~bionic’ socket: ‘/var/run/mysqld/mysqld.sock’ port: 3306 mariadb.org binary distribution
2020-03-18 13:12:10 8 [Warning] Aborted connection 8 to db: ‘unconnected’ user: ‘unauthenticated’ host: ‘172.25.0.3’ (This connection closed normally without authentication)
2020-03-18 13:12:44 9 [Warning] Aborted connection 9 to db: ‘unconnected’ user: ‘unauthenticated’ host: ‘172.25.0.3’ (This connection closed normally without authentication)
2020-03-18 13:17:54 10 [Warning] Aborted connection 10 to db: ‘unconnected’ user: ‘unauthenticated’ host: ‘172.25.0.3’ (This connection closed normally without authentication)

Any help ? Thanks.

you should use db

tried, but with db as host I have error SQLSTATE[HY000] [2006] MySQL server has gone away

sorry, I don’t know how compose v2 works with networks.

but for v3:

version: '3'
services:
  db:
    networks:
      - nc
  app:
    networks:
      - nc

networks:
  nc:

and add your stuff…

both of them are in same network. I have even tried to add db ip (172.25.0.2) as host in wizzard, but it does not work too. I’m struggling with this issue almost 2 days.

docker network inspect nextcloud_default

[
    {
        "Name": "nextcloud_default",
        "Id": "26334f1b77e00eeb9f6dceb065fed763b3518fd48c11c9af7a0ae225568c27b5",
        "Created": "2020-03-17T20:52:45.439705171+01:00",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.25.0.0/16",
                    "Gateway": "172.25.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "82cc96082df4261552233520987fee59528e770a56157d03637b0d221b5ade50": {
                "Name": "nextcloud_app_1",
                "EndpointID": "26e2a72f9f10af1d5c4cc3d8f83b8b8ae9eea01770addcdaf835226a5f054719",
                "MacAddress": "02:42:ac:19:00:03",
                "IPv4Address": "172.25.0.3/16",
                "IPv6Address": ""
            },
            "fefeabc71c2fcd38067d3d3f0ca7e391ef2ef9841d2a100b4ee4436ef7e70f00": {
                "Name": "nextcloud_db_1",
                "EndpointID": "c151968ce7f1aebb10a82dd6cd39a86978bfc652f3f5b08ef683dae264df1205",
                "MacAddress": "02:42:ac:19:00:02",
                "IPv4Address": "172.25.0.2/16",
                "IPv6Address": ""
            }
        },
        "Options": {},
        "Labels": {}
    }
]

Update,
problem is in mariadb image 10.4+. I can connect to latest version 10.3.22

after setting mariadb version 10.3.22, Nextcloud was sucessfully installed

image

1 Like