Migrations failing on newly initialized database
Describe the bug When using a fresh setup of version 3.8.2 the DB migrations that should be applied when the web container is starting, fail to apply Currently I am trying with an external MySQL server (schema was initialized with the two .sql queries before starting the stack) but the same did occur when using the MySQL container.
The container exists after unsuccessfully tring to migrate for several times.
web-1 | 2024/07/28 19:58:26 Waiting for: tcp://mysql1.redacted.de:3306
web-1 | 2024/07/28 19:58:26 Waiting for: tcp://mda:143
web-1 | 2024/07/28 19:58:26 Waiting for: tcp://mta:25
web-1 | 2024/07/28 19:58:26 Waiting for: tcp://filter:11334
web-1 | 2024/07/28 19:58:26 Waiting for: file:///media/dkim/
web-1 | 2024/07/28 19:58:26 Problem with dial: dial tcp 172.20.0.4:11334: getsockopt: connection refused. Sleeping 1s
web-1 | 2024/07/28 19:58:26 Connected to tcp://mysql1.redacted.de:3306
web-1 | 2024/07/28 19:58:26 Problem with dial: dial tcp 172.20.0.7:143: getsockopt: connection refused. Sleeping 1s
web-1 | 2024/07/28 19:58:27 Problem with dial: dial tcp 172.20.0.6:25: getsockopt: connection refused. Sleeping 1s
web-1 | 2024/07/28 19:58:27 File file:///media/dkim/ had been generated
web-1 | 2024/07/28 19:58:27 Connected to tcp://filter:11334
web-1 | 2024/07/28 19:58:27 Problem with dial: dial tcp 172.20.0.7:143: getsockopt: connection refused. Sleeping 1s
web-1 | 2024/07/28 19:58:28 Problem with dial: dial tcp 172.20.0.6:25: getsockopt: connection refuseda. Sleeping 1s
web-1 | 2024/07/28 19:58:28 Connected to tcp://mda:143
web-1 | 2024/07/28 19:58:29 Problem with dial: dial tcp 172.20.0.6:25: getsockopt: connection refused. Sleeping 1s
web-1 | 2024/07/28 19:58:30 Connected to tcp://mta:25
web-1 | [notice] Migrating up to DoctrineMigrations\Version20190610121554
web-1 | [error] Migration DoctrineMigrations\Version20180320164351 failed during Pre-Checks. Error: "An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mail01.virtual_users' doesn't exist"
web-1 | [critical] Error thrown while running command "doctrine:migrations:migrate -n". Message: "An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mail01.virtual_users' doesn't exist"
web-1 |
web-1 | In ExceptionConverter.php line 40:
web-1 |
web-1 | An exception occurred while executing a query: SQLSTATE[42S02]: Base table
web-1 | or view not found: 1146 Table 'mail01.virtual_users' doesn't exist
web-1 |
web-1 |
web-1 | In Exception.php line 28:
web-1 |
web-1 | SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mail01.virtual_u
web-1 | sers' doesn't exist
web-1 |
web-1 |
web-1 | In Connection.php line 57:
web-1 |
web-1 | SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mail01.virtual_u
web-1 | sers' doesn't exist
web-1 |
web-1 |
web-1 | doctrine:migrations:migrate [--write-sql [WRITE-SQL]] [--dry-run] [--query-time] [--allow-no-migration] [--all-or-nothing [ALL-OR-NOTHING]] [--configuration CONFIGURATION] [--em EM] [--conn CONN] [--] [<version>]
web-1 |
web-1 | 2024/07/28 19:58:30 Waiting for: tcp://mysql1.redacted.de:3306
web-1 | 2024/07/28 19:58:30 Waiting for: tcp://mda:143
web-1 | 2024/07/28 19:58:30 Waiting for: tcp://mta:25
web-1 | 2024/07/28 19:58:30 Waiting for: tcp://filter:11334
web-1 | 2024/07/28 19:58:30 Waiting for: file:///media/dkim/
web-1 | 2024/07/28 19:58:30 Connected to tcp://filter:11334
web-1 | 2024/07/28 19:58:30 Connected to tcp://mysql1.redacted.de:3306
web-1 | 2024/07/28 19:58:30 Connected to tcp://mta:25
web-1 | 2024/07/28 19:58:30 Connected to tcp://mda:143
web-1 | 2024/07/28 19:58:31 File file:///media/dkim/ had been generated
web-1 | [notice] Migrating up to DoctrineMigrations\Version20190610121554
web-1 | [error] Migration DoctrineMigrations\Version20180320164351 failed during Pre-Checks. Error: "An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mail01.virtual_users' doesn't exist"
web-1 | [critical] Error thrown while running command "doctrine:migrations:migrate -n". Message: "An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mail01.virtual_users' doesn't exist"
web-1 |
web-1 | In ExceptionConverter.php line 40:
web-1 |
web-1 | An exception occurred while executing a query: SQLSTATE[42S02]: Base table
web-1 | or view not found: 1146 Table 'mail01.virtual_users' doesn't exist
web-1 |
web-1 |
web-1 | In Exception.php line 28:
web-1 |
web-1 | SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mail01.virtual_u
web-1 | sers' doesn't exist
web-1 |
web-1 |
web-1 | In Connection.php line 57:
web-1 |
web-1 | SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mail01.virtual_u
web-1 | sers' doesn't exist
web-1 |
web-1 |
web-1 | doctrine:migrations:migrate [--write-sql [WRITE-SQL]] [--dry-run] [--query-time] [--allow-no-migration] [--all-or-nothing [ALL-OR-NOTHING]] [--configuration CONFIGURATION] [--em EM] [--conn CONN] [--] [<version>]
web-1 |
web-1 | 2024/07/28 19:58:32 Waiting for: tcp://mysql1.redacted.de:3306
[...]
edit: Just tried with the 3.7.1 version by checking out the 3.7.1 release and setting all tags in the docker-compose.yml to v.3.7.1 and it works without issues, so it does seem to be something with the 3.8.x versions
Version 3.8.5 was released a few minutes ago. It contains a refreshed base dump that don't need to migrated anymore. Would you like to test if it works for you?
https://github.com/jeboehm/docker-mailserver/releases/tag/v3.8.5