New Install - Database incomplete & can't migrate

Your software
My Mautic version is:5.0.4
My PHP version is:8.1
My Database type and version is:
tried BOTH mysql 8.1 and 5.7

Your problem
My problem is:
Fresh install, the install works great, (installing on docker) as soon as I do thorough testing, which requires a reboot of the mautic container, there is a database connection issue, logs show missing tables, and columns, a list of available migrations shows a long list, but any attempt to migrate results in failures in all directions, this is with fresh installs with or without any data.
These errors are showing in the log:

[2024-06-11T14:23:58.617668+00:00] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\TableNotFoundException: “An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘marketing.plugin_integration_settings’ doesn’t exist” at /var/www/html/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php line 49 {“exception”:“[object] (Doctrine\DBAL\Exception\TableNotFoundException(code: 1146): An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘marketing.plugin_integration_settings’ doesn’t exist at /var/www/html/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:49)\n[previous exception] [object] (Doctrine\DBAL\Driver\PDO\Exception(code: 1146): SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘marketing.plugin_integration_settings’ doesn’t exist at /var/www/html/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28)\n[previous exception] [object] (PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘marketing.plugin_integration_settings’ doesn’t exist at /var/www/html/vendor/doctrine/dbal/src/Driver/PDO/Statement.php:130)”} {“hostname”:“m2-64458978f5-8bnr4”,“pid”:41}
[2024-06-11T14:23:58.691913+00:00] mautic.CRITICAL: Exception thrown when handling an exception (Mautic\CoreBundle\Exception\FileNotFoundException: blank not found! at /var/www/html/docroot/app/bundles/CoreBundle/Twig/Helper/ThemeHelper.php line 38) {“exception”:“[object] (Mautic\CoreBundle\Exception\FileNotFoundException(code: 0): blank not found! at /var/www/html/docroot/app/bundles/CoreBundle/Twig/Helper/ThemeHelper.php:38)”} {“hostname”:“m2-64458978f5-8bnr4”,“pid”:41}
[2024-06-11T14:23:58.721762+00:00] mautic.ERROR: Mautic\CoreBundle\Exception\FileNotFoundException: blank not found! - in file /var/www/html/docroot/app/bundles/CoreBundle/Twig/Helper/ThemeHelper.php - at line 38 {“hostname”:“m2-64458978f5-8bnr4”,“pid”:41}

Steps I have tried to fix the problem:

tried both versions of php, tried every way i can with migration on the database.

to help someone else in future?

run these commands on reboot of the container

php /var/www/html/bin/console doctrine:cache:clear-metadata

php /var/www/html/bin/console doctrine:cache:clear-query

php /var/www/html/bin/console doctrine:cache:clear-result

1 Like