Nextcloud lost connection to mariadb

Hi guys,

Im struggling with my setup lately. It worked just fine over the last period of time. After restarting my system the Nextcloud docker instance was not able to reach mariadb. At least I see an error when accessing the webpage. In the logs I was not able to find any abnormalities. When bashing into Nextcloud docker I couldn’t access data, which returns in an error not able to connect to mariadb. Which is weird because it was working fine before. I tried to overview the docker compose file which also doesn’t seem to show error. Then I checked the config file in Nextcloud where the Maria info is set. I’m kind of unsure what is causing the problem. Any help appreciated.

In case you need any more information like docker-compose and/or config output please let me know.

Best regards,
Tom

What version of Nextcloud?
What version of MariaDB?
What CPU type?
What version of docker?

And yes, please post your compose.

version: "2"
services:
  nextcloud:
    image: linuxserver/nextcloud:arm32v7-latest
    container_name: nextcloud
    environment:
      - PUID=1001
      - PGID=100
      - TZ=Europe/Berlin
      - MYSQL_PASSWORD=xxx
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=nextcloud_mariadb
    networks:
     nginx-proxy:
       ipv4_address: '172.19.0.3'
     db:
    depends_on:
      - mariadb
    volumes:
      - ./config:/config
      - /srv/dev-disk-by-label-Storage/Storage/.Nextcloud:/data
      - /srv/dev-disk-by-label-Storage/Storage:/data/files
      - ./nextcloud.log:/data/nextcloud.log
    ports:
      - 8888:80
    restart: unless-stopped
    logging:
     driver: "json-file"
     options:
      max-file: "5"
      max-size: "10m"

  mariadb:
    image: linuxserver/mariadb:arm32v7-latest
    container_name: nextcloud_mariadb
    environment:
      - PUID=1001
      - PGID=100
      - TZ=Europe/Berlin
      - MYSQL_ROOT_PASSWORD=xxx
      - MYSQL_PASSWORD=xxx
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
    networks:
     db:
    volumes:
      - ./db:/config
    restart: unless-stopped
    logging:
     driver: "json-file"
     options:
      max-file: "5"
      max-size: "10m"

networks:
    nginx-proxy:
      external:
        name: nginx-proxy
    db:

Okay so running on latest docker images. On an Odroid HC1 with ARM processor. Docker version: 20.10.3.
I’ve created an external network for nginx proxy.

Can you try image: linuxserver/mariadb:alpine and let us know if that works? The alpine tag is a temporary tag available ahead of becoming the default :latest tag (likely sometime in March).

I should have included: Make sure you backup your config and databases before updating to this new tag!

i didi but i didnt solve the problem francly. i post the config.php from nextcloud for further investigation:
<?php
$CONFIG = array (
‘memcache.local’ => ‘\OC\Memcache\APCu’,
‘datadirectory’ => ‘/data’,
‘instanceid’ => ‘ocgzya7wh87v’,
‘passwordsalt’ => ‘xxx’,
‘secret’ => ‘xxx’,
‘trusted_domains’ =>
array (
0 => ‘IP:8888’,
1 => ‘domain:433’,
),
‘dbtype’ => ‘mysql’,
‘version’ => ‘20.0.5.2’,
‘trusted_proxies’ =>
array (
0 => ‘nginx_proxy’,
1 => ‘172.19.0.2’,
),
‘overwritehost’ => ‘domain’,
‘overwrite.cli.url’ => ‘https://domain’,
‘overwriteprotocol’ => ‘https’,
‘dbname’ => ‘nextcloud’,
‘dbhost’ => ‘nextcloud_mariadb’,
‘dbport’ => ‘’,
‘dbtableprefix’ => ‘oc_’,
‘dbuser’ => ‘nextcloud’,
‘dbpassword’ => ‘xxx’,
‘installed’ => true,
‘enable_previews’ => false,
‘maintenance’ => false,
‘theme’ => ‘’,
‘loglevel’ => 0,
‘mysql.utf8mb4’ => true,

Can you post the exact error message you were seeing?

Okay so I was able to resolve the issue. It was caused by my 32bit OS system, where i needed to upgrade certain files in order to make newer docker images work. Here is the link: FAQ - LinuxServer.io

Now im running into a weird issue with my nginx proxy setup. Following its logs after gettin 502 errors i noticed: upstream files are too big. A quick web search showed increasing buffer sizes. I also tried increasing the times. Which didnt solve the problem for me. Ill post the proxy.conf input. Would be great to hear what else might solve this?

proxy_buffer_size          128k;
proxy_buffers              4 256k;
proxy_busy_buffers_size    256k;
proxy_connect_timeout 240;
proxy_headers_hash_bucket_size 128;
proxy_headers_hash_max_size 1024;
proxy_http_version 1.1;
proxy_read_timeout 240;
proxy_redirect  http://  $scheme://;
proxy_send_timeout 240;

Unfortunately I don’t know the answer to that issue. Hopefully someone else can chime in.

Okay thanks for helping anyway! I’m creating a new topic for the new problem.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.