docker
docker copied to clipboard
Database keeps crashing
Hello everyone.
This project seems awesome and I wanted to install it but I keep failing whatever I try. Even following the most basic instructions from your documentation leads me to constant fails.
Here is my last try (straight from your documentation, I only modified the host port for testing on localhost) :
# Run Monica with apache backend
version: "3.9"
services:
app:
image: monica:apache
depends_on:
- db
ports:
- 8080:80
environment:
- APP_ENV=production
- DB_HOST=db
- DB_DATABASE=monica
- DB_USERNAME=monica
- DB_PASSWORD=secret
- LOG_CHANNEL=stderr
- CACHE_DRIVER=database
- SESSION_DRIVER=database
- QUEUE_DRIVER=sync
volumes:
- data:/var/www/html/storage
restart: always
db:
image: mysql:8.0
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=true
- MYSQL_DATABASE=monica
- MYSQL_USER=monica
- MYSQL_PASSWORD=secret
volumes:
- mysql:/var/lib/mysql
restart: always
volumes:
data:
name: data
mysql:
name: mysql
I do a simple docker compose up -d
in my console next to it. The database container is stuck in a crash loop (the app container seems to work but, of course, can not reach the database)
What the docker logs
gives me on this mysql container :
2023-04-01 13:50:25+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.32-1.el8 started.
2023-04-01 13:50:25+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2023-04-01 13:50:25+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.32-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2023-04-01T13:50:25.734209Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2023-04-01T13:50:25.735747Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.32) starting as process 1
2023-04-01T13:50:25.746842Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-04-01T13:50:25.849909Z 1 [ERROR] [MY-012526] [InnoDB] Upgrade is not supported after a crash or shutdown with innodb_fast_shutdown = 2. This redo log was created with MySQL 5.7.41, and it appears logically non empty. Please follow the instructions at http://dev.mysql.com/doc/refman/8.0/en/upgrading.html
2023-04-01T13:50:25.849938Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error.
2023-04-01T13:50:26.292553Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2023-04-01T13:50:26.293019Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2023-04-01T13:50:26.293073Z 0 [ERROR] [MY-010119] [Server] Aborting
2023-04-01T13:50:26.294307Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.32) MySQL Community Server - GPL.
Am I doing something wrong ? Am I missing a step ? Do I need a .env
file (I tried it too but with the same result)? Or is it a bug ?
Thank you for your wonderful work.
I'm experiencing this exact error on a Raspberry Pi 3b+ running Raspbian Lite.
I am experiencing the same issue. I think this could be the problem with connection between monica
container and db
container. I also would appreciate any help. I am using SYNOLOGY NAS with portainer.
@asbiin Can I kindly ask you if you can help us with this issue? I really would like to use Monica but still I am unable to run any docker version using the examples. Thank you in advanced
Could the problem be the mysql version? most of the examples mention mysql:5.7
I am having the same issue where the database crashes on InnoDB initialization, resulting in a loop for the database service. Although Instead of an "Upgrade not supported", I am getting this error instead:
[System] [MY-013576] [InnoDB] InnoDB initialization has started.
[ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files.
[ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error.
[ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
[ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
[ERROR] [MY-010119] [Server] Aborting
I am following the guide Running the image with docker-compose (Apache version).
Hello. Sorry, I don't know why this happens, but it's not related to monica. I also tested it, and the mysql container needs some time to startup, and indeed restart multiple times, but it eventually works.
Have you experienced the same issue with a mariadb
container? It's 100% compatible, and might solve it.
Hello. Sorry, I don't know why this happens, but it's not related to monica. I also tested it, and the mysql container needs some time to startup, and indeed restart multiple times, but it eventually works.
Thanks for the response. After some time and more digging, I found a working solution with mysql. It seems that the documentation for the docker-compose.yml may need some updates. What fixed my issue in particular was changing the volume name for the db
container from mysql
to mysqldata
Here is my docker-compose.yml
for those that want a simple working solution: mysql db, apache server, and no reverse-proxy:
services:
app:
image: monica:apache
depends_on:
- db
ports:
- *desired_port*:80
environment:
- APP_ENV=production
- APP_ENV=local
- DB_HOST=db
- DB_DATABASE=monica
- DB_USERNAME=monica
- DB_PASSWORD=secret
- LOG_CHANNEL=stderr
- CACHE_DRIVER=database
- SESSION_DRIVER=database
- QUEUE_DRIVER=sync
- APP_DISABLE_SIGNUP=false
volumes:
- data:/var/www/html/storage
restart: always
db:
image: mysql:8.0
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=true
- MYSQL_DATABASE=monica
- MYSQL_USER=monica
- MYSQL_PASSWORD=secret
volumes:
- mysqldata:/var/lib/mysql
restart: always
volumes:
data:
mysqldata:
Also, unrelated to this issue, monica was forcing https, so I found a solution to change APP_ENV
from production to local
and I have no issues running it.
Have you experienced the same issue with a
mariadb
container? It's 100% compatible, and might solve it.
I will try mariadb
in the future, as I have monica running fine, for now. Thank you, again.
Thank you @rooq Closing this one now