# Doctrine Error

**URL:** https://forum.mautic.org/t/doctrine-error/32523
**Category:** Development
**Created:** [June 25, 2024, 1:49am UTC](https://forum.mautic.org/t/doctrine-error/32523 "2024-06-25T01:49:20Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![tobsowo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/tobsowo/32/3096_2.png) [@tobsowo](https://forum.mautic.org/u/tobsowo)
#### Post date: [June 25, 2024, 1:49am UTC](https://forum.mautic.org/t/doctrine-error/32523/1 "2024-06-25T01:49:20Z")

</div>

Please I need help with this error.

```auto
[2024-06-25T01:44:34.254235+00:00] mautic.ERROR: Doctrine\Migrations\Exception\MetadataStorageError: The metadata storage is not initialized, please run the sync-metadata-storage command to fix this issue. (uncaught exception) at /home/m.website.com/public_html/vendor/doctrine/migrations/lib/Doctrine/Migrations/Exception/MetadataStorageError.php line 18 while running console command `doctrine:migrations:version` [stack trace] #0 /home/m.website.com/public_html/vendor/doctrine/migrations/lib/Doctrine/Migrations/Metadata/Storage/TableMetadataStorage.php(221): Doctrine\Migrations\Exception\MetadataStorageError::notInitialized() #1 /home/m.website.com/public_html/vendor/doctrine/migrations/lib/Doctrine/Migrations/Metadata/Storage/TableMetadataStorage.php(122): Doctrine\Migrations\Metadata\Storage\TableMetadataStorage->checkInitialization() #2 /home/m.website.com/public_html/vendor/doctrine/migrations/lib/Doctrine/Migrations/Tools/Console/Command/VersionCommand.php(244): Doctrine\Migrations\Metadata\Storage\TableMetadataStorage->complete() #3 /home/m.website.com/public_html/vendor/doctrine/migrations/lib/Doctrine/Migrations/Tools/Console/Command/VersionCommand.php(159): Doctrine\Migrations\Tools\Console\Command\VersionCommand->mark() #4 /home/m.website.com/public_html/vendor/doctrine/migrations/lib/Doctrine/Migrations/Tools/Console/Command/VersionCommand.php(123): Doctrine\Migrations\Tools\Console\Command\VersionCommand->markVersions() #5 /home/m.website.com/public_html/vendor/symfony/console/Command/Command.php(298): Doctrine\Migrations\Tools\Console\Command\VersionCommand->execute() #6 /home/m.website.com/public_html/vendor/symfony/console/Application.php(1058): Symfony\Component\Console\Command\Command->run() #7 /home/m.website.com/public_html/vendor/symfony/framework-bundle/Console/Application.php(96): Symfony\Component\Console\Application->doRunCommand() #8 /home/m.website.com/public_html/vendor/symfony/console/Application.php(301): Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() #9 /home/m.website.com/public_html/vendor/symfony/framework-bundle/Console/Application.php(82): Symfony\Component\Console\Application->doRun() #10 /home/m.website.com/public_html/vendor/symfony/console/Application.php(171): Symfony\Bundle\FrameworkBundle\Console\Application->doRun() #11 /home/m.website.com/public_html/docroot/app/bundles/InstallBundle/Install/InstallService.php(499): Symfony\Component\Console\Application->run() #12 /home/m.website.com/public_html/docroot/app/bundles/InstallBundle/Command/InstallCommand.php(434): Mautic\InstallBundle\Install\InstallService->finalMigrationStep() #13 /home/m.website.com/public_html/docroot/app/bundles/InstallBundle/Command/InstallCommand.php(340): Mautic\InstallBundle\Command\InstallCommand->stepAction() #14 /home/m.website.com/public_html/vendor/symfony/console/Command/Command.php(298): Mautic\InstallBundle\Command\InstallCommand->execute() #15 /home/m.website.com/public_html/vendor/symfony/console/Application.php(1058): Symfony\Component\Console\Command\Command->run() #16 /home/m.website.com/public_html/vendor/symfony/framework-bundle/Console/Application.php(96): Symfony\Component\Console\Application->doRunCommand() #17 /home/m.website.com/public_html/vendor/symfony/console/Application.php(301): Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() #18 /home/m.website.com/public_html/vendor/symfony/framework-bundle/Console/Application.php(82): Symfony\Component\Console\Application->doRun() #19 /home/m.website.com/public_html/vendor/symfony/console/Application.php(171): Symfony\Bundle\FrameworkBundle\Console\Application->doRun() #20 /home/m.website.com/public_html/bin/console(16): Symfony\Component\Console\Application->run() #21 {main} [] {"hostname":"ubuntu-16gb-hel1-1","pid":90144}
[2024-06-25T01:44:34.254796+00:00] mautic.WARNING: Command `doctrine:migrations:version` exited with status code 1 [] {"hostname":"ubuntu-16gb-hel1-1","pid":90144}
[2024-06-25T01:44:34.975285+00:00] mautic.WARNING: Command `mautic:assets:generate` exited with status code 1 [] {"hostname":"ubuntu-16gb-hel1-1","pid":90189}

```

---

<div class="post-metadata">

### Author: ![alexnitsche](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/alexnitsche/32/12272_2.png) [@alexnitsche](https://forum.mautic.org/u/alexnitsche)
#### Post date: [July 5, 2024, 9:30am UTC](https://forum.mautic.org/t/doctrine-error/32523/2 "2024-07-05T09:30:38Z")

</div>

I get the same error when reinstalling in a local Docker environment.

This seems to be triggered by Doctrine when it cannot determine the version of the database server. According to this [discussion](https://github.com/doctrine/DoctrineMigrationsBundle/issues/337), this is related to MariaDB servers and can be fixed by specifying the server version in the Doctrine configuration as `mariadb-<server-version>` instead of `<server-version>`. Unfortunately, there seems to be no way to specify the server version in Mautic. The closest is the `MAUTIC_DB_SERVER_VERSION` constant in /app/AppKernel.php, but I have no idea how to set it persistently.

* * *

Environment:

Mautic 5.1.0  
Composer 2.7.1  
PHP 8.2.7  
Apache 2.4.57  
MariaDB 10.5.18

---

<div class="post-metadata">

### Author: ![alexnitsche](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/alexnitsche/32/12272_2.png) [@alexnitsche](https://forum.mautic.org/u/alexnitsche)
#### Post date: [July 5, 2024, 9:47am UTC](https://forum.mautic.org/t/doctrine-error/32523/3 "2024-07-05T09:47:46Z")

</div>

The problem specifically in Mautic might be, that the `MAUTIC_DB_SERVER_VERSION` is set to null if /config/local.php exists, probably due to the assumption that Mautic is already installed if that file exists. But in my installation process i use to prefill the local.php with some additional parameters that i cannot hand over to the installation CLI command, like e.g. `api_enabled`.

---

<div class="post-metadata">

### Author: ![alexnitsche](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/alexnitsche/32/12272_2.png) [@alexnitsche](https://forum.mautic.org/u/alexnitsche)
#### Post date: [July 5, 2024, 11:32am UTC](https://forum.mautic.org/t/doctrine-error/32523/4 "2024-07-05T11:32:31Z")

</div>

The error definitely occurs during the Mautic installation, e.g. during

```auto
php bin/console mautic:install <local-url>

```

and it is triggered regardless of whether a config/local.php exists.
