# Error Updating from Mautic 3.0 --\>3.01

**URL:** https://forum.mautic.org/t/error-updating-from-mautic-3-0-3-01/15038
**Category:** Mautic 3 - Install/Upgrade Support
**Created:** [July 1, 2020, 8:01pm UTC](https://forum.mautic.org/t/error-updating-from-mautic-3-0-3-01/15038 "2020-07-01T20:01:04Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)
#### Post date: [July 1, 2020, 8:01pm UTC](https://forum.mautic.org/t/error-updating-from-mautic-3-0-3-01/15038/1 "2020-07-01T20:01:04Z")

</div>

**Your software**  
_My PHP version is_ :7.3  
_My MariaDB version is_ 10.3  
**Updating/Installing Errors**  
_I am_ : Updating from 3.0–\> 3.01  
_Upgrading/installing via_ Command Line

_These errors are showing in the installer_ : Step 1 [-\>--------------------------] Migrating database schema…PHP Fatal error: Declaration of Mautic\Migrations\Version20200617155347::up(Doctrine\DBAL\Schema\Schema $schema) must be compatible with Mautic\CoreBundle\Doctrine\AbstractMauticMigration::up(Doctrine\DBAL\Schema\Schema $schema): void in /var/www/vhosts/Mautic-Install.com/hub.Mautic-Install.com/app/migrations/Version20200617155347.php on line 36

In Version20200617155347.php line 36:

Compile Error: Declaration of Mautic\Migrations\Version20200617155347::up(Doctrine\DBAL\Schema\Schema $schema) must be compatible with Mautic\CoreBundle\Doctrine\AbstractMauticMigrat  
ion::up(Doctrine\DBAL\Schema\Schema $schema): void

mautic:update:apply [–force] [-p|–update-package [UPDATE-PACKAGE]] [–finish] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [–ansi] [–no-ansi] [-n|–no-interaction] [-e|–env ENV] [–no-debug] [–]

_These errors are showing in the Mautic log_ : [root@howdy ~]# [root@howdy ~]# /opt/plesk/php/7.3/bin/php /var/www/vhosts/Mautic-Install.com/hub.Mautic-Install.com/bin/console mautic:update:find  
Step 1 [-\>--------------------------] Migrating database schema…PHP Fatal error: Declaration of Mautic\Migrations\Version20200617155347::up(Doctrine\DBAL\Schema\Schema $schema) must be compatible with Mautic\CoreBundle\Doctrine\AbstractMauticMigration::up(Doctrine\DBAL\Schema\Schema $schema): void in /var/www/vhosts/Mautic-Install.com/hub.Mautic-Install.com/app/migrations/Version20200617155347.php on line 36

In Version20200617155347.php line 36:

Compile Error: Declaration of Mautic\Migrations\Version20200617155347::up(Doctrine\DBAL\Schema-bash: [root@howdy: command not found  
\Schema $schema) must be compatible with Mautic\CoreBundle\Doctrine\AbstractMauticMigrat  
ion::up(Doctrine\DBAL\Schema\Schema $schema): void

mautic:update:apply [–force] [-p|–update-package [UPDATE-PACKAGE]] [–finish] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [–ansi] [–no-ansi] [-n|–no-interaction] [-e|–env ENV] [–no-debug] [–]   
[root@howdy ~]# Version 3.0.1 of Mautic is available for download. Please visit [https://github.com/mautic/mautic/releases/tag/3.0.1](https://github.com/mautic/mautic/releases/tag/3.0.1) for more information.  
-bash: Version: command not found  
[root@howdy ~]# To update, you can run ‘php bin/console mautic:update:apply’ from the command line.  
-bash: To: command not found  
[root@howdy ~]# [root@howdy ~]# /opt/plesk/php/7.3/bin/php /var/www/vhosts/Mautic-Install.com/hub.Mautic-Install.com/bin/console mautic:update:apply  
-bash: [root@howdy: command not found  
[root@howdy ~]# Are you sure you wish to update Mautic to the latest version? y  
-bash: Are: command not found  
[root@howdy ~]# Step 5 [-----\>----------------------] Clearing the cache  
-bash: Step: command not found  
[root@howdy ~]#  
[root@howdy ~]# IMPORTANT: Run the same command again with --finish. For example ‘php bin/console mautic:update:apply --finish’  
-bash: syntax error near unexpected token `newline' [root@howdy ~]# [root@howdy ~]# /opt/plesk/php/7.3/bin/php /var/www/vhosts/Mautic-Install.com/hub.Mautic-Install.com/bin/console mautic:update:apply --finish -bash: [root@howdy: command not found [root@howdy ~]# Step 1 [->--------------------------] Migrating database schema...PHP Fatal error: Declaration of Mautic\Migrations\Version20200617155347::up(Doctrine\DBAL\Schema\Schema $schema) must be compatible with Mautic\CoreBundle\Doctrine\AbstractMauticMigration::up(Doctrine\DBAL\Schema\Schema $schema): void in /var/www/vhosts/Mautic-Install.com/hub.Mautic-Install.com/app/migrations/Version20200617155347.php on line 36 -bash: syntax error near unexpected token `(’  
[root@howdy ~]#  
[root@howdy ~]# In Version20200617155347.php line 36:  
-bash: In: command not found  
[root@howdy ~]#  
[root@howdy ~]# Compile Error: Declaration of Mautic\Migrations\Version20200617155347::up(Doctrine\DBAL\Schema\Schema $schema) must be compatible with Mautic\CoreBundle\Doctrine\AbstractMauticMigrat  
-bash: syntax error near unexpected token `(' [root@howdy ~]# ion::up(Doctrine\DBAL\Schema\Schema $schema): void -bash: syntax error near unexpected token `Doctrine\DBAL\Schema\Schema’  
[root@howdy ~]#  
[root@howdy ~]#  
[root@howdy ~]# mautic:update:apply [–force] [-p|–update-package [UPDATE-PACKAGE]] [–finish] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [–ansi] [–no-ansi] [-n|–no-interaction] [-e|–env ENV] [–no-debug] [–]   
-bash: syntax error near unexpected token `newline’  
[root@howdy ~]# /opt/plesk/php/7.3/bin/php /var/www/vhosts/Mautic-Install.com/hub.Mautic-Install.com/bin/console doctrine:schema:update --force

Updating database schema…

In AbstractMySQLDriver.php line 106:

An exception occurred while executing ‘ALTER TABLE mauhu\_oauth2\_accesstokens CHANGE client\_id client\_id INT UNSIGNED NOT NULL, CHANGE user\_id user\_id INT UNSIGNED NOT NULL, CHANGE to  
ken token VARCHAR(191) NOT NULL, CHANGE scope scope VARCHAR(191) DEFAULT NULL’:

SQLSTATE[HY000]: General error: 1832 Cannot change column ‘client\_id’: used in a foreign key constraint ‘FK\_5DD8E68219EB6921’

In PDOConnection.php line 80:

SQLSTATE[HY000]: General error: 1832 Cannot change column ‘client\_id’: used in a foreign key constraint ‘FK\_5DD8E68219EB6921’

In PDOConnection.php line 75:

SQLSTATE[HY000]: General error: 1832 Cannot change column ‘client\_id’: used in a foreign key constraint ‘FK\_5DD8E68219EB6921’

doctrine:schema:update [–complete] [–dump-sql] [-f|–force] [–em [EM]] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [–ansi] [–no-ansi] [-n|–no-interaction] [-e|–env ENV] [–no-debug] [–]

[root@howdy ~]# /opt/plesk/php/7.3/bin/php /var/www/vhosts/Mautic-Install.com/hub.Mautic-Install.com/bin/console doctrine:migrations:generate  
PHP Fatal error: Declaration of Mautic\Migrations\Version20200617155347::up(Doctrine\DBAL\Schema\Schema $schema) must be compatible with Mautic\CoreBundle\Doctrine\AbstractMauticMigration::up(Doctrine\DBAL\Schema\Schema $schema): void in /var/www/vhosts/Mautic-Install.com/hub.Mautic-Install.com/app/migrations/Version20200617155347.php on line 36

In Version20200617155347.php line 36:

Compile Error: Declaration of Mautic\Migrations\Version20200617155347::up(Doctrine\DBAL\Schema\Schema $schema) must be compatible with Mautic\CoreBundle\Doctrine\AbstractMauticMigrat  
ion::up(Doctrine\DBAL\Schema\Schema $schema): void

doctrine:migrations:generate [–editor-cmd [EDITOR-CMD]] [–configuration [CONFIGURATION]] [–db-configuration [DB-CONFIGURATION]] [–db DB] [–em EM] [–shard SHARD] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [–ansi] [–no-ansi] [-n|–no-interaction] [-e|–env ENV] [–no-debug] [–]

[root@howdy ~]# /opt/plesk/php/7.3/bin/php /var/www/vhosts/Mautic-Install.com/hub.Mautic-Install.com/bin/console doctrine:migrations:migrate  
PHP Fatal error: Declaration of Mautic\Migrations\Version20200617155347::up(Doctrine\DBAL\Schema\Schema $schema) must be compatible with Mautic\CoreBundle\Doctrine\AbstractMauticMigration::up(Doctrine\DBAL\Schema\Schema $schema): void in /var/www/vhosts/Mautic-Install.com/hub.Mautic-Install.com/app/migrations/Version20200617155347.php on line 36

In Version20200617155347.php line 36:

Compile Error: Declaration of Mautic\Migrations\Version20200617155347::up(Doctrine\DBAL\Schema\Schema $schema) must be compatible with Mautic\CoreBundle\Doctrine\AbstractMauticMigrat  
ion::up(Doctrine\DBAL\Schema\Schema $schema): void

doctrine:migrations:migrate [–write-sql [WRITE-SQL]] [–dry-run] [–query-time] [–allow-no-migration] [–all-or-nothing [ALL-OR-NOTHING]] [–configuration [CONFIGURATION]] [–db-configuration [DB-CONFIGURATION]] [–db DB] [–em EM] [–shard SHARD] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [–ansi] [–no-ansi] [-n|–no-interaction] [-e|–env ENV] [–no-debug] [–] []

[root@howdy ~]# /opt/plesk/php/7.3/bin/php /var/www/vhosts/Mautic-Install.com/hub.Mautic-Install.com/bin/console doctrine:migrations:migrate  
PHP Fatal error: Declaration of Mautic\Migrations\Version20200617155347::up(Doctrine\DBAL\Schema\Schema $schema) must be compatible with Mautic\CoreBundle\Doctrine\AbstractMauticMigration::up(Doctrine\DBAL\Schema\Schema $schema): void in /var/www/vhosts/Mautic-Install.com/hub.Mautic-Install.com/app/migrations/Version20200617155347.php on line 36

In Version20200617155347.php line 36:

Compile Error: Declaration of Mautic\Migrations\Version20200617155347::up(Doctrine\DBAL\Schema\Schema $schema) must be compatible with Mautic\CoreBundle\Doctrine\AbstractMauticMigrat  
ion::up(Doctrine\DBAL\Schema\Schema $schema): void

doctrine:migrations:migrate [–write-sql [WRITE-SQL]] [–dry-run] [–query-time] [–allow-no-migration] [–all-or-nothing [ALL-OR-NOTHING]] [–configuration [CONFIGURATION]] [–db-configuration [DB-CONFIGURATION]] [–db DB] [–em EM] [–shard SHARD] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [–ansi] [–no-ansi] [-n|–no-interaction] [-e|–env ENV] [–no-debug] [–] []

_These errors are showing in the upgrade\_log.txt file (located in the root of your Mautic instance when an upgrade has been attempted - ensure you remove or redact any sensitive data such as domain names in the file path)_ :

**Your problem**  
_My problem is_ : upgrade from M3.0 to 3.01 failed- site if 500 error now

_Steps I have tried to fix the problem_ : cleared cache- google gave me this but any fixes mentioned cause more issues [https://github.com/symfony/symfony/issues/30828](https://github.com/symfony/symfony/issues/30828)

---

<div class="post-metadata">

### Author: ![dennisameling](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dennisameling/32/958_2.png) [@dennisameling](https://forum.mautic.org/u/dennisameling)
#### Post date: [July 2, 2020, 7:49am UTC](https://forum.mautic.org/t/error-updating-from-mautic-3-0-3-01/15038/2 "2020-07-02T07:49:58Z")

</div>

@EJL Can you tell us how you installed Mautic? The latest 3.0.1 version [doesn’t include](https://github.com/mautic/mautic/tree/staging/app/migrations) a migration with number `20200617155347`. Did you create this migration yourself by any chance?

---

<div class="post-metadata">

### Author: ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)
#### Post date: [July 5, 2020, 11:06pm UTC](https://forum.mautic.org/t/error-updating-from-mautic-3-0-3-01/15038/3 "2020-07-05T23:06:38Z")

</div>

this instance was originally an upgrade from 2.16.2 —\> 3.0 and then used for a few weeks and then attempted the 3.0.1 upgrade when these errors occurred.

I wouldn’t know how to create such a migration

---

<div class="post-metadata">

### Author: ![dennisameling](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dennisameling/32/958_2.png) [@dennisameling](https://forum.mautic.org/u/dennisameling)
#### Post date: [July 6, 2020, 9:00am UTC](https://forum.mautic.org/t/error-updating-from-mautic-3-0-3-01/15038/4 "2020-07-06T09:00:45Z")

</div>

Could you share the contents of `app/migrations/Version20200617155347.php` with us here? Curious to see what’s in there as I can’t find it anywhere in the Mautic repo on GitHub. If we know the contents we can decide whether it can be either deleted or what needs to be changed in order to make the migration pass 🙂

---

<div class="post-metadata">

### Author: ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)
#### Post date: [July 6, 2020, 6:57pm UTC](https://forum.mautic.org/t/error-updating-from-mautic-3-0-3-01/15038/5 "2020-07-06T18:57:48Z")

</div>

> Blockquote \<?php

declare(strict\_types=1);

/\*

- @copyright Mautic Contributors. All rights reserved.
- @author Mautic
- @link[https://mautic.org](https://mautic.org)
- @license GNU/GPLv3 [The GNU General Public License v3.0 - GNU Project - Free Software Foundation](http://www.gnu.org/licenses/gpl-3.0.html)  
\*/

namespace Mautic\Migrations;

use Doctrine\DBAL\Schema\Schema;  
use Doctrine\Migrations\Exception\SkipMigration;  
use Mautic\CoreBundle\Doctrine\AbstractMauticMigration;

final class Version20200617155347 extends AbstractMauticMigration  
{  
/\*\*  
\* @throws SkipMigrationException  
\*/  
public function preUp(Schema $schema)  
{  
$shouldRunMigration = false; // Please modify to your needs

```
    if (!$shouldRunMigration) {
        throw new SkipMigration('Schema includes this migration');
    }
}

public function up(Schema $schema)
{
    // Please modify to your needs
}

```

}

> Blockquote

Here are the rest listed- I can post contents all if you want:

 ![Screenshot (22)](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/a/ae90f62d0dd45d041d1c27b5807450f7a2979c2c.png)

---

<div class="post-metadata">

### Author: ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)
#### Post date: [July 10, 2020, 9:31pm UTC](https://forum.mautic.org/t/error-updating-from-mautic-3-0-3-01/15038/6 "2020-07-10T21:31:23Z")

</div>

@dennisameling any other info i should share? any testing recommendations?

---

<div class="post-metadata">

### Author: ![fgauttron](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/fgauttron/32/2543_2.png) [@fgauttron](https://forum.mautic.org/u/fgauttron)
#### Post date: [August 13, 2020, 10:09am UTC](https://forum.mautic.org/t/error-updating-from-mautic-3-0-3-01/15038/7 "2020-08-13T10:09:31Z")

</div>

Hello, i have the same issue.  
I updated 2.6.3 to 3.0.1 and everything went well.  
tried to update to 3.0.2 and I still have 11 migrations open. they’re the same as you in my migations folder :

-rw-r–r-- 1 www-data www-data 1179 Aug 13 11:08 Version20181111095447.php  
-rw-r–r-- 1 www-data www-data 2111 Aug 13 11:08 Version20190704154940.php  
-rw-r–r-- 1 www-data www-data 2618 Aug 13 11:08 Version20190724110039.php  
-rw-r–r-- 1 www-data www-data 1174 Aug 13 11:08 Version20191126093923.php  
-rw-r–r-- 1 www-data www-data 4105 Aug 13 11:08 Version20191219155630.php  
-rw-r–r-- 1 www-data www-data 967 Aug 13 11:08 Version20200211095409.php  
-rw-r–r-- 1 www-data www-data 872 Aug 13 11:08 Version20200212141530.php  
-rw-r–r-- 1 www-data www-data 690 Aug 13 11:08 Version20200220172041.php  
-rw-r–r-- 1 www-data www-data 791 Aug 13 11:08 Version20200227110431.php  
-rw-r–r-- 1 www-data www-data 1455 Aug 13 11:08 Version20200302164801.php  
-rw-r–r-- 1 www-data www-data 3855 Aug 13 11:08 Version20200422144300.php

And I also tried to force the update and i had this error : SQLSTATE[HY000]: General error: 1832 Cannot change column ‘client\_id’: used in a foreign key constraint ‘FK\_3A18CA5A19EB6921’

---

<div class="post-metadata">

### Author: ![devsrealm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/devsrealm/32/3669_2.png) [@devsrealm](https://forum.mautic.org/u/devsrealm)
#### Post date: [August 13, 2020, 11:58am UTC](https://forum.mautic.org/t/error-updating-from-mautic-3-0-3-01/15038/8 "2020-08-13T11:58:24Z")

</div>

> [@fgauttron](#):
>
> And I also tried to force the update and i had this error : SQLSTATE[HY000]: General error: 1832 Cannot change column ‘client\_id’: used in a foreign key constraint ‘FK\_3A18CA5A19EB6921’

This is a known bug in older version I guess, I helped someone solved this issue a few days back, could you paste the full error log?

---

<div class="post-metadata">

### Author: ![fgauttron](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/fgauttron/32/2543_2.png) [@fgauttron](https://forum.mautic.org/u/fgauttron)
#### Post date: [August 13, 2020, 12:02pm UTC](https://forum.mautic.org/t/error-updating-from-mautic-3-0-3-01/15038/9 "2020-08-13T12:02:15Z")

</div>

Hello, here is my logs file :

[2020-08-13 09:26:41] mautic.NOTICE: PHP Notice - Undefined index: path - in file /var/www/mautic/app/bundles/CoreBundle/Controller/ExceptionController.php - at line 120 {“request”:"[object] (Symfony\Component\HttpFoundation\Request: GET 35.180.9.25:80 HTTP/1.0\r\nX-Php-Ob-Level: 1\r\n\r\n)",“exception”:"[object] (Symfony\Component\Debug\Exception\FlattenException: {})",“logger”:"[object] (Symfony\Bridge\Monolog\Logger: {})",“class”:“Symfony\Component\HttpKernel\Exception\NotFoundHttpException”,“currentContent”:"",“layout”:“Error”,“code”:404,“anonymous”:true,“baseTemplate”:“MauticCoreBundle:Default:slim.html.php”,“templatePage”:false,“template”:“MauticCoreBundle:Error:404.html.php”,“templating”:"[object] (Symfony\Bundle\FrameworkBundle\Templating\DelegatingEngine: {})",“statusText”:“Not Found”,“url”:“35.180.9.25:80”,“urlParts”:{“host”:“35.180.9.25”,“port”:80}}   
[2020-08-13 09:26:41] mautic.NOTICE: PHP Notice - Undefined index: path - in file /var/www/mautic/app/bundles/CoreBundle/Controller/ExceptionController.php - at line 120 {“request”:"[object] (Symfony\Component\HttpFoundation\Request: GET 35.180.9.25:80 HTTP/1.0\r\nX-Php-Ob-Level: 1\r\n\r\n)",“exception”:"[object] (Symfony\Component\Debug\Exception\FlattenException: {})",“logger”:"[object] (Symfony\Bridge\Monolog\Logger: {})",“class”:“Symfony\Component\HttpKernel\Exception\NotFoundHttpException”,“currentContent”:"",“layout”:“Error”,“code”:404,“anonymous”:true,“baseTemplate”:“MauticCoreBundle:Default:slim.html.php”,“templatePage”:false,“template”:“MauticCoreBundle:Error:404.html.php”,“templating”:"[object] (Symfony\Bundle\FrameworkBundle\Templating\DelegatingEngine: {})",“statusText”:“Not Found”,“url”:“35.180.9.25:80”,“urlParts”:{“host”:“35.180.9.25”,“port”:80}}   
[2020-08-13 09:26:42] mautic.NOTICE: PHP Notice - Undefined index: path - in file /var/www/mautic/app/bundles/CoreBundle/Controller/ExceptionController.php - at line 120 {“request”:"[object] (Symfony\Component\HttpFoundation\Request: GET 35.180.9.25:80 HTTP/1.0\r\nX-Php-Ob-Level: 1\r\n\r\n)",“exception”:"[object] (Symfony\Component\Debug\Exception\FlattenException: {})",“logger”:"[object] (Symfony\Bridge\Monolog\Logger: {})",“class”:“Symfony\Component\HttpKernel\Exception\NotFoundHttpException”,“currentContent”:"",“layout”:“Error”,“code”:404,“anonymous”:true,“baseTemplate”:“MauticCoreBundle:Default:slim.html.php”,“templatePage”:false,“template”:“MauticCoreBundle:Error:404.html.php”,“templating”:"[object] (Symfony\Bundle\FrameworkBundle\Templating\DelegatingEngine: {})",“statusText”:“Not Found”,“url”:“35.180.9.25:80”,“urlParts”:{“host”:“35.180.9.25”,“port”:80}}   
[2020-08-13 09:26:42] mautic.NOTICE: PHP Notice - Undefined index: path - in file /var/www/mautic/app/bundles/CoreBundle/Controller/ExceptionController.php - at line 120 {“request”:"[object] (Symfony\Component\HttpFoundation\Request: GET 35.180.9.25:80 HTTP/1.0\r\nX-Php-Ob-Level: 1\r\n\r\n)",“exception”:"[object] (Symfony\Component\Debug\Exception\FlattenException: {})",“logger”:"[object] (Symfony\Bridge\Monolog\Logger: {})",“class”:“Symfony\Component\HttpKernel\Exception\NotFoundHttpException”,“currentContent”:"",“layout”:“Error”,“code”:404,“anonymous”:true,“baseTemplate”:“MauticCoreBundle:Default:slim.html.php”,“templatePage”:false,“template”:“MauticCoreBundle:Error:404.html.php”,“templating”:"[object] (Symfony\Bundle\FrameworkBundle\Templating\DelegatingEngine: {})",“statusText”:“Not Found”,“url”:“35.180.9.25:80”,“urlParts”:{“host”:“35.180.9.25”,“port”:80}}   
[2020-08-13 09:26:43] mautic.NOTICE: PHP Notice - Undefined index: path - in file /var/www/mautic/app/bundles/CoreBundle/Controller/ExceptionController.php - at line 120 {“request”:"[object] (Symfony\Component\HttpFoundation\Request: GET 35.180.9.25:80 HTTP/1.0\r\nX-Php-Ob-Level: 1\r\n\r\n)",“exception”:"[object] (Symfony\Component\Debug\Exception\FlattenException: {})",“logger”:"[object] (Symfony\Bridge\Monolog\Logger: {})",“class”:“Symfony\Component\HttpKernel\Exception\NotFoundHttpException”,“currentContent”:"",“layout”:“Error”,“code”:404,“anonymous”:true,“baseTemplate”:“MauticCoreBundle:Default:slim.html.php”,“templatePage”:false,“template”:“MauticCoreBundle:Error:404.html.php”,“templating”:"[object] (Symfony\Bundle\FrameworkBundle\Templating\DelegatingEngine: {})",“statusText”:“Not Found”,“url”:“35.180.9.25:80”,“urlParts”:{“host”:“35.180.9.25”,“port”:80}}   
[2020-08-13 09:52:15] mautic.NOTICE: PHP Notice - Undefined index: path - in file /var/www/mautic/app/bundles/CoreBundle/Controller/ExceptionController.php - at line 120 {“request”:"[object] (Symfony\Component\HttpFoundation\Request: GET [ip.ws.126.net:443](http://ip.ws.126.net:443) HTTP/1.1\r\nHost: [ip.ws.126.net:443](http://ip.ws.126.net:443)\r\nUser-Agent: Go-http-client/1.1\r\nX-Php-Ob-Level: 1\r\n\r\n)",“exception”:"[object] (Symfony\Component\Debug\Exception\FlattenException: {})",“logger”:"[object] (Symfony\Bridge\Monolog\Logger: {})",“class”:“Symfony\Component\HttpKernel\Exception\NotFoundHttpException”,“currentContent”:"",“layout”:“Error”,“code”:404,“anonymous”:true,“baseTemplate”:“MauticCoreBundle:Default:slim.html.php”,“templatePage”:false,“template”:“MauticCoreBundle:Error:404.html.php”,“templating”:"[object] (Symfony\Bundle\FrameworkBundle\Templating\DelegatingEngine: {})",“statusText”:“Not Found”,“url”:“[ip.ws.126.net:443](http://ip.ws.126.net:443)”,“urlParts”:{“host”:“[ip.ws.126.net](http://ip.ws.126.net)”,“port”:443}}   
[2020-08-13 09:52:45] mautic.NOTICE: Doctrine\DBAL\Exception\DriverException: An exception occurred while executing ‘ALTER TABLE oauth2\_accesstokens CHANGE client\_id client\_id INT UNSIGNED NOT NULL, CHANGE user\_id user\_id INT UNSIGNED NOT NULL, CHANGE token token VARCHAR(191) NOT NULL, CHANGE scope scope VARCHAR(191) DEFAULT NULL’: SQLSTATE[HY000]: General error: 1832 Cannot change column ‘client\_id’: used in a foreign key constraint ‘FK\_3A18CA5A19EB6921’ (uncaught exception) at /var/www/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 106 while running console command `doctrine:schema:update`

---

<div class="post-metadata">

### Author: ![devsrealm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/devsrealm/32/3669_2.png) [@devsrealm](https://forum.mautic.org/u/devsrealm)
#### Post date: [August 13, 2020, 12:14pm UTC](https://forum.mautic.org/t/error-updating-from-mautic-3-0-3-01/15038/10 "2020-08-13T12:14:22Z")

</div>

Could you find the table of this foreign key: **FK\_3A18CA5A19EB6921**? You can visit your PHPMyAdmin or whatever MySQL admin you use, then try dropping that foreign key constraint, chances are you’ll find another foreign key in that specific table, so you just change that to the one reported in your log and you then retry.

---

<div class="post-metadata">

### Author: ![aerendir](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/aerendir/32/1050_2.png) [@aerendir](https://forum.mautic.org/u/aerendir)
#### Post date: [February 18, 2022, 3:59pm UTC](https://forum.mautic.org/t/error-updating-from-mautic-3-0-3-01/15038/11 "2022-02-18T15:59:05Z")

</div>

Dropping the foreign key doesn’t work.

Once dropped, running a `bin/console doctrine:schema:update --force` tries to recreate the foreign key, but the query results in an error:

> An exception occurred while executing ‘ALTER TABLE \*\_oauth2\_accesstokens ADD CONSTRAINT FK\_E6019FAD19EB6921 FOREIGN KEY (client\_id) REFERENCES \*\_oauth2\_clients (id) ON DELETE CASCADE’:
> 
> SQLSTATE[HY000]: General error: 3780 Referencing column ‘client\_id’ and referenced column ‘id’ in foreign key constraint ‘FK\_E6019FAD19EB6921’ are incompatible.

So, the real issue is with the relation between `Mautic\ApiBundle\Entity\oAuth2\AccessToken::$client` and `Mautic\ApiBundle\Entity\oAuth2\$id`.

Currently, in my database, `oauth_accesstokens::client_id` is ´UNSIGNED`while`oauth2\_clients::id`is not, but I don't know if`UNSIGNED` can cause the error.

I’m investigating further…

---

<div class="post-metadata">

### Author: ![aficio](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/aficio/32/12659_2.png) [@aficio](https://forum.mautic.org/u/aficio)
#### Post date: [July 8, 2024, 1:52am UTC](https://forum.mautic.org/t/error-updating-from-mautic-3-0-3-01/15038/12 "2024-07-08T01:52:58Z")

</div>

I [made a script](https://github.com/aficiomaquinas/mautic-fix-db-ai) to handle this errors using AI. In the end I was able to solve the problem but it took hundreds of SQL queries.
