ckulka / baikal-docker

Provides a ready-to-go Baikal server, incl. docker-compose.yml & Systemd service file
https://hub.docker.com/r/ckulka/baikal
MIT License
367 stars 46 forks source link

Cannot Connect to MariaDB - Has worked for years just fine #167

Closed Joshndroid closed 9 months ago

Joshndroid commented 9 months ago

Hey All,

Just wondering if anyone else has seen an issue in Baikal recently?

I have been running the docker now for years with it being a set and forget type docker. Its been awesomely stable. Today I have noticed that I was having errors and have fired up the webui to see the error

"Baïkal was not able to establish a connexion to the configured MySQL database (as configured in config/baikal.yaml)."

I have not changed anything in the baikal.yaml since setting up through the webui years ago. I have checked the mariadb docker, the baikal database is still there and i was able to login using the creditials in my baikal.yaml. I ran an internal update for mariadb just to see and it was fine (didn't fix the issue). I checked nginx proxy manager which is working as expected. I tried with 'https://' in the database URL with no difference. I can ping the maria container from the baikal docker and another pc I tried the experimental-nginx branch (to see if i have missed something due to it being updated 25 days ago), with no difference. I rebooted my router in case it was a routing/DNS issue, nil difference.

My log from baikal startup

2024/02/22 09:05:44 [notice] 1#1: using the "epoll" event method 2024/02/22 09:05:44 [notice] 1#1: nginx/1.25.3 2024/02/22 09:05:44 [notice] 1#1: built by gcc 12.2.0 (Debian 12.2.0-14) 2024/02/22 09:05:44 [notice] 1#1: OS: Linux 6.1.74-Unraid 2024/02/22 09:05:44 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 40960:40960 2024/02/22 09:05:44 [notice] 1#1: start worker processes 2024/02/22 09:05:44 [notice] 1#1: start worker process 49 2024/02/22 09:05:44 [notice] 1#1: start worker process 50 2024/02/22 09:05:44 [notice] 1#1: start worker process 51 2024/02/22 09:05:44 [notice] 1#1: start worker process 52 2024/02/22 09:05:44 [notice] 1#1: start worker process 53 2024/02/22 09:05:44 [notice] 1#1: start worker process 54 2024/02/22 09:05:44 [notice] 1#1: start worker process 55 2024/02/22 09:05:44 [notice] 1#1: start worker process 56 2024/02/22 09:05:44 [notice] 1#1: start worker process 57 2024/02/22 09:05:44 [notice] 1#1: start worker process 58 2024/02/22 09:05:44 [notice] 1#1: start worker process 59 2024/02/22 09:05:44 [notice] 1#1: start worker process 60 /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/ /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version /docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-create-baikal-database-folder.sh /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh /docker-entrypoint.sh: Launching /docker-entrypoint.d/40-disable-nginx-ipv6-if-unsupported.sh /docker-entrypoint.sh: Launching /docker-entrypoint.d/40-fix-baikal-file-permissions.sh /docker-entrypoint.sh: Launching /docker-entrypoint.d/40-php-fpm.sh /docker-entrypoint.sh: Launching /docker-entrypoint.d/50-start-msmtp.sh /docker-entrypoint.sh: Configuration complete; ready for start up

The rest is the couple of devices that have tried to connect to the baikal docker.

I am at a loss on what i can check/do from here

RobertMe commented 9 months ago

I ran into the same issue. In my case it was because of switching from docker-compose (v1 / the Python script) to docker compose (v2 / the Docker CLI plugin). After debugging it was apparent that they generate container names, and resulting from that hostnames/host aliases, differently. In my config I had baikal_db_1 (i.e.: <project name>_<service name>_1), while with Docker Compose (v2) it must be baikal-db-1 (or, for both, just the service name, so db).

So this might be the case for you as well? Or some other small difference in naming. So compare the mysql_host in the yaml to the Aliases (NetworkSettings.Networks.<...>.Aliases) reported by docker inspect <your DB container name>. And make sure that they really are identical, and not some minor differences like underscores vs dashes.

Joshndroid commented 9 months ago

I couldn't end up finding what the issue was so my only course of action was to nuke it and start again.

I went with a sqlite3 one on this occasion to save me a headache in a few years time.