# Update Failure from 3.3.3 -\> 4.4.7 (Can't create table \`mautic\`.\`oauth2\_clients\` FK constraint incorrectly formed)

**URL:** <https://forum.mautic.org/t/update-failure-from-3-3-3-4-4-7-cant-create-table-mautic-oauth2-clients-fk-constraint-incorrectly-formed/27371>\
**Category:** Mautic 4 Install/Upgrade Support\
**Created:** [March 16, 2023, 6:26pm UTC](https://forum.mautic.org/t/update-failure-from-3-3-3-4-4-7-cant-create-table-mautic-oauth2-clients-fk-constraint-incorrectly-formed/27371 "2023-03-16T18:26:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cparker](https://avatars.discourse-cdn.com/v4/letter/c/e79b87/32.png) [@cparker](https://forum.mautic.org/u/cparker)\
**Post date:** [March 16, 2023, 6:26pm UTC](https://forum.mautic.org/t/update-failure-from-3-3-3-4-4-7-cant-create-table-mautic-oauth2-clients-fk-constraint-incorrectly-formed/27371/1 "2023-03-16T18:26:02Z")

</div>

**Your software**  
_My PHP version is_ : 7.4.33  
_My MariaDB version is_ : 10.5.11  
_OS_: CentOS

**Updating/Installing Errors**  
\*I am: Installing / Updating  
_Upgrading/installing via_ : Command Line

_These errors are showing in the installer_ : An error occured while updating the database. Check log for more details.

_These errors are showing in the Mautic log_ : SQLSTATE[HY000]: General error: 1005 Can’t create table `mautic`.`oauth2_clients` (errno: 150 "Foreign key constraint is incorrectly formed")  
at mautic-2.9.2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:141)",“command”:“doctrine:migrations:migrate --quiet --no-interaction”,“message”:  
“An exception occurred while executing ‘ALTER TABLE oauth2\_clients ADD CONSTRAINT FK\_CLIENT\_ROLE FOREIGN KEY (role\_id) REFERENCES roles (id)’:\n\nSQLSTATE[HY000]:  
General error: 1005 Can’t create table `mautic`.`oauth2_clients` (errno: 150 "Foreign key constraint is incorrectly formed")”}

**Your problem**  
_My problem is_ : I cannot complete the install/update of Mautic. I have attempted clearing the cache and updating the DB schema as noted in other posts, but I still get a messed up install. At one point I was able to get the update to show as being complete, but attempting to carry out simple tasks in Mautic I realized functions were not working right. For instance, trying to create a campaign to send text messages resulted in the campaign builder failing to load.

_Steps I have tried to fix the problem_ : Clear cache via php command, and manually. updating DB Schema.

Any assistance is greatly appreciated.
