I have been running for a while an instance of a Bitnami docker image for mariadb. It has been working perfectly for some time but suddently, a couple of days back, it started to fail. Initially the only thing I could see is the docker container restarting every so often without the database being avaiable at any time.
In order to debug the problem, I modified the docker-compose file to override the entrypoint of the maridadb image to something that wold keep the container running so that I could log into it and debug. Doing so I was able to start the mariadb container and then open a session into it.
Once inside the container, I tried executing the run.sh and setup.sh scripts located in /opt/bitnami/scripts/mariadb/,but both of them failed when trying to run mysqld.
The command executed by the scripts in order to start mariadb:
/opt/bitnami/mariadb/sbin/mysqld --defaults-file=/opt/bitnami/mariadb/conf/my.cnf --basedir=/opt/bitnami/mariadb --datadir=/bitnami/mariadb/data --socket=/opt/bitnami/mariadb/tmp/mysql.sock --bind-address=127.0.0.1 --user=mysql --skip-slave-start
And the error I get when tring to execute the above command is:
bash: /opt/bitnami/mariadb/sbin/mysqld: cannot execute binary file: Exec format error
I have tried deleting the image and puling it again and still the problem persists. What could it be that is not allowing mysqld to run ??
The docker-compose file I use to start the containers is shown bellow. The commented "entrypoint" line is what I used to start thecontainer for debuging.
version: '2'
services:
mariadb:
image: docker.io/bitnami/mariadb:10.6
user: root
#entrypoint: tail -f /dev/null
environment:
# ALLOW_EMPTY_PASSWORD is recommended only for development.
- MARIADB_ROOT_PASSWORD=xxxxxxxxxx
- ALLOW_EMPTY_PASSWORD=no
- MARIADB_USER=finquescrm
- MARIADB_DATABASE=xxxxxxxx
- MARIADB_PASSWORD=xxxxxxxx
volumes:
- 'mariadb_data:/bitnami/mariadb'
- ./sharedfolder:/sharedfolder
restart: always
suitecrm:
image: docker.io/bitnami/suitecrm:7.12.5-debian-10-r79
user: root
ports:
- '80:8080'
- '443:8443'
environment:
- SUITECRM_DATABASE_HOST=mariadb
- SUITECRM_DATABASE_PORT_NUMBER=3306
- SUITECRM_DATABASE_USER=xxxxxxxx
- SUITECRM_DATABASE_NAME=xxxxxxxx
- SUITECRM_DATABASE_PASSWORD=xxxxxxxxxx
# ALLOW_EMPTY_PASSWORD is recommended only for development.
- MARIADB_ROOT_PASSWORD=xxxxxxxxxxxxxx
- ALLOW_EMPTY_PASSWORD=no
volumes:
- 'suitecrm_data:/bitnami/suitecrm'
- ./sharedfolder:/sharedfolder
depends_on:
- mariadb
restart: always
volumes:
mariadb_data:
driver: local
suitecrm_data:
driver: local
Addendum:
This is what I get from executing the docker compose:
After that I just keep getting timeout errors and restarts:
NOTE: Added 9-jan-2023 I have tried starting the cuitecrm and mariadb instances in another computer running docker. I first did a clear install with the docker compose file and the database started without any issues. After that I transfered the persisted data from the volumes in the computer that is failing to the new computer. I transfered both the suitecrm files and the mariadb files ... After doing so, the problem reproduces.. the problem seems to be then in the persisted data .... How can I try to have mariadb recover the database?
it has been a while, and fogot about this question which I finally solved. Not really sure what was going on but the issue got solved by deleting both the container and the related image and executing the docker compose again to recreate them.
After that it just worked again.