# Command \`doctrine:migrations:migrate\` exited with status code 1

**URL:** https://forum.mautic.org/t/command-doctrinemigrate-exited-with-status-code-1/23390
**Category:** Product Support
**Tags:** mautic-4
**Created:** [March 30, 2022, 4:15pm UTC](https://forum.mautic.org/t/command-doctrinemigrate-exited-with-status-code-1/23390 "2022-03-30T16:15:04Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![h1dd3n\_sn1p3r](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/h1dd3n_sn1p3r/32/7236_2.png) [@h1dd3n\_sn1p3r](https://forum.mautic.org/u/h1dd3n_sn1p3r)
#### Post date: [March 30, 2022, 4:15pm UTC](https://forum.mautic.org/t/command-doctrinemigrate-exited-with-status-code-1/23390/1 "2022-03-30T16:15:04Z")

</div>

Hi, Mautic community

My Mautic version is: 4.2.1  
My PHP version is: 7.4.28  
My Database type and version is: 10.3.34 MariaDB.

I am having an issue while upgrading the database schema. I noticed that some part of the Mautic dashboard is broken and the rest are working fine. I am having an error message while I go in some pages of the Mautic dashboard. For example: “Edit contact page”.

`The site is currently offline due to encountering an error. If the problem persists, please contact the system administrator.`

Upon checking the log, I noticed that I have an SQL error.

```auto
[2022-03-30 12:07:45] mautic.NOTICE: Doctrine\DBAL\Exception\SyntaxErrorException: An exception occurred while executing 'ALTER TABLE `xo_lead_event_log` RENAME INDEX `IDX_SEARCH` TO `xo_IDX_SEARCH`': SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INDEX `IDX_SEARCH` TO `xo_IDX_SEARCH`' at line 1 (uncaught exception) at /home/domain.com/public_html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 98 while running console command `doctrine:migrations:migrate` [] []

[2022-03-30 12:07:45] mautic.WARNING: Command `doctrine:migrations:migrate` exited with status code 1 [] []

```

I tried running `php bin/console doctrine:migration:migrate` command from SSH & also tried accessing `https://domain.com/s/update/schema` but nothing helped.

How to fix this?

Thank you.

---

<div class="post-metadata">

### Author: ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)
#### Post date: [March 30, 2022, 4:44pm UTC](https://forum.mautic.org/t/command-doctrinemigrate-exited-with-status-code-1/23390/2 "2022-03-30T16:44:09Z")

</div>

I wrote a post about migration problems, I think if you stick with the process described there you should be able to resolve the issues:

> [@MySQL error upgrading to 4.2](https://forum.mautic.org/t/mysql-error-upgrading-to-4-2/22867/6):
>
> Hi, I had to play around with migrations to get it from Mautic 3 to 4 a bit too, because in previous versions of Mautic I have not executed update process completely, while I cannot remember the specific error I have a strong suspicion that your update error also comes from the same category of problems. A general note on migrations in Mautic core: method isApplicable (or something very similar to that :)) is not really well implemented for all migrations thats why sometimes script ties to app…

---

<div class="post-metadata">

### Author: ![h1dd3n\_sn1p3r](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/h1dd3n_sn1p3r/32/7236_2.png) [@h1dd3n\_sn1p3r](https://forum.mautic.org/u/h1dd3n_sn1p3r)
#### Post date: [March 31, 2022, 8:53am UTC](https://forum.mautic.org/t/command-doctrinemigrate-exited-with-status-code-1/23390/3 "2022-03-31T08:53:31Z")

</div>

Thank you @mzagmajster

I dropped `IDX_SEARCH` index from `xo_lead_event_log` table using PHPMyAdmin tool.

Then, tried running `php bin/console doctrine:migrations:migrate` command from SSH.

**It worked.** Now DB schema has been updated successfully.

Once again thank you.
