mailcow / mailcow-dockerized

mailcow: dockerized - 🐮 + 🐋 = 💕
https://mailcow.email
GNU General Public License v3.0
8.75k stars 1.17k forks source link

MySQL table space not persistent #4126

Closed ip6li closed 3 years ago

ip6li commented 3 years ago

Environment:

After cloning plain vanilla Mailcow and installing according to documentation I got and endless loop of following messages:

dovecot-mailcow_1    | 2021-06-06T10:38:24.610722902Z Waiting for database to come up...
ejabberd-mailcow_1   | 2021-06-06T10:38:24.790498126Z Waiting for PHP on port 9001...
rspamd-mailcow_1     | 2021-06-06T10:38:25.130051145Z Waiting for PHP on port 9001...
php-fpm-mailcow_1    | 2021-06-06T10:38:25.814074377Z Waiting for SQL...
postfix-mailcow_1    | 2021-06-06T10:38:26.104750350Z Waiting for database to come up...
sogo-mailcow_1       | 2021-06-06T10:38:26.106318553Z Waiting for database to come up...
watchdog-mailcow_1   | 2021-06-06T10:38:26.611143284Z Waiting for SQL...
dovecot-mailcow_1    | 2021-06-06T10:38:26.615400641Z Waiting for database to come up...
ejabberd-mailcow_1   | 2021-06-06T10:38:27.794342281Z Waiting for PHP on port 9001...
php-fpm-mailcow_1    | 2021-06-06T10:38:27.826450744Z Waiting for SQL...
sogo-mailcow_1       | 2021-06-06T10:38:28.116478618Z Waiting for database to come up...
postfix-mailcow_1    | 2021-06-06T10:38:28.117531531Z Waiting for database to come up...
rspamd-mailcow_1     | 2021-06-06T10:38:28.134046066Z Waiting for PHP on port 9001...
watchdog-mailcow_1   | 2021-06-06T10:38:28.621235766Z Waiting for SQL...
dovecot-mailcow_1    | 2021-06-06T10:38:28.623504652Z Waiting for database to come up...
php-fpm-mailcow_1    | 2021-06-06T10:38:29.838470698Z Waiting for SQL...
sogo-mailcow_1       | 2021-06-06T10:38:30.128806115Z Waiting for database to come up...
postfix-mailcow_1    | 2021-06-06T10:38:30.130332227Z Waiting for database to come up...
watchdog-mailcow_1   | 2021-06-06T10:38:30.625657107Z Waiting for SQL...

Login to mysql with mysql command using username/password from mailcow.conf failed.

Investigation of that problem revealed, that there is no persistent mysql tablespace.

Workaround: modifying mysql-mailcow volumes from - mysql-vol-1:/var/lib/mysql/:Z to - ./data/mysql-vol-1:/var/lib/mysql/:Z,cached solved problem and mysql tables becomes persistent.

After that workaround and docker-compose down && docker-compose up -d && docker-compose logs -ft a fresh database with credentials from mailcow.conf was created and no more problems occured.

andryyy commented 3 years ago

The problem is you started mailcow with a different mailcow.conf at some point. Running down and up -d will not deinstall mailcow and start a fresh copy. You had a mailcow MySQL volume bootstrapped that didn't match. :)