# Issue with logging in to mautic 6.0 after upgrade from 5.2.5

**URL:** <https://forum.mautic.org/t/issue-with-logging-in-to-mautic-6-0-after-upgrade-from-5-2-5/35610>\
**Category:** Mautic 6 Install/Upgrade Support\
**Created:** [May 1, 2025, 12:06pm UTC](https://forum.mautic.org/t/issue-with-logging-in-to-mautic-6-0-after-upgrade-from-5-2-5/35610 "2025-05-01T12:06:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![raramuridesign](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/raramuridesign/32/13226_2.png) [@raramuridesign](https://forum.mautic.org/u/raramuridesign)\
**Post date:** [May 1, 2025, 12:06pm UTC](https://forum.mautic.org/t/issue-with-logging-in-to-mautic-6-0-after-upgrade-from-5-2-5/35610/1 "2025-05-01T12:06:25Z")

</div>

Hi Team @silavapi

When trying to login I am getting this error, I have checked various tables to see that uuid is there. and they are. Am I missing something else ?

Matthew

`[2025-05-01T12:03:15.098596+00:00] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\InvalidFieldNameException: "An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'm1_.uuid' in 'SELECT'" at /home/mautic-ssa/webapps/j3mautic-ssa/public/go/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php line 67 {"exception":"[object] (Doctrine\\DBAL\\Exception\\InvalidFieldNameException(code: 1054): An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'm1_.uuid' in 'SELECT' at /home/mautic-ssa/webapps/j3mautic-ssa/public/go/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:67)\n[previous exception] [object] (Doctrine\\DBAL\\Driver\\PDO\\Exception(code: 1054): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'm1_.uuid' in 'SELECT' at /home/mautic-ssa/webapps/j3mautic-ssa/public/go/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28)\n[previous exception] [object] (PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'm1_.uuid' in 'SELECT' at /home/mautic-ssa/webapps/j3mautic-ssa/public/go/vendor/doctrine/dbal/src/Driver/PDO/Statement.php:130)"} {"hostname":"a-srv24-wwm-ubuntu24","pid":459222}`

---

<div class="post-metadata">

**Author:** ![raramuridesign](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/raramuridesign/32/13226_2.png) [@raramuridesign](https://forum.mautic.org/u/raramuridesign)\
**Post date:** [May 1, 2025, 12:08pm UTC](https://forum.mautic.org/t/issue-with-logging-in-to-mautic-6-0-after-upgrade-from-5-2-5/35610/2 "2025-05-01T12:08:41Z")

</div>

Just a thought, is there a migration which deals with this specifically, if yes, what is the vesion number ?

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [May 1, 2025, 1:03pm UTC](https://forum.mautic.org/t/issue-with-logging-in-to-mautic-6-0-after-upgrade-from-5-2-5/35610/3 "2025-05-01T13:03:06Z")

</div>

I searched the GitHub PRs for UUID using [this query](https://github.com/mautic/mautic/pulls?q=is%3Apr+UUID+is%3Amerged+sort%3Aupdated-desc) to find when it was introduced:

> <https://github.com/mautic/mautic/pull/14558>
>
> | Q | A
> | --------------------------------…------ | ---
> | Bug fix? (use the a.b branch) | 🔴 
> | New feature/enhancement? (use the a.x branch) | 🟢
> | Deprecations? | 🟢
> | BC breaks? (use the c.x branch) | 🔴
> | Automated tests included? | 🔴 
> | Related user documentation PR URL | mautic/user-documentation#... 
> | Related developer documentation PR URL | mautic/developer-documentation-new#... 
> | Issue(s) addressed | Fixes #... 
> 
> 
> 
> \## Description
> UUID implementation. This is necessary for global identification of entities for the campaign library:
> 
> https://github.com/mautic/mautic/pull/14504
> 
> The UUID will be used to decide whether an entity should be updated or inserted during the import of entities.
> 
> 
> 
> 
> 
> 
> 
> \---
> \### 📋 Steps to test this PR:
> 1. Run \`bin/console doctrine:migrations:migrate\` to apply the migration.
> 2. You should see in the changed entities/tables like reports, pages, emails and so on that there is new UUID column in the table with filled in hash.

There was also a PR to fix some issues:

> <https://github.com/mautic/mautic/pull/14751>
>
> Cf 583: Copy Roles via RC/GT.
> 
> 
> 
> | Q | …A
> | -------------------------------------- | ---
> | Bug fix? (use the a.b branch) | ❌ 
> | New feature/enhancement? (use the a.x branch) | ✔️
> | Deprecations? | ❌
> | BC breaks? (use the c.x branch) | ❌
> | Automated tests included? | ❌ 
> | Related user documentation PR URL | mautic/user-documentation#... 
> | Related developer documentation PR URL | mautic/developer-documentation-new#... 
> | Issue(s) addressed | Fixes #... 
> 
> 
> 
> \## Description
> 
> UUID implementation. This is necessary for global identification of entities for the campaign library:
> 
> https://github.com/mautic/mautic/pull/14504
> 
> The UUID will be used to decide whether an entity should be updated or inserted during the import of entities.
> 
> 
> 
> 
> 
> 
> \---
> \### 📋 Steps to test this PR:
> 
> 
> 1. Open this PR on Gitpod or pull down for testing locally (see docs on testing PRs \[here\](https://contribute.mautic.org/contributing-to-mautic/tester))
> 2. Run bin/console doctrine:migrations:migrate to apply the migration.
> 3. You should see in the changed entities/tables in role and permission and so on that there is new UUID column in the table with filled in hash.

Both were merged in 6.0.0.

In the first PR I found the migration:

`app/migrations/Version20210211081531.php`

Then there are two migrations in the second one:

`app/migrations/Version20210818090322.php`

`app/migrations/Version20210819201726.php`

If you’ve done an upgrade and the migrations were processed, it should have migrated your database and completed the necessary changes.

I alos [searched the issue queue for UUID](https://github.com/mautic/mautic/issues?q=is%3Aissue%20%20UUID%20) and found this issue: [Missing `uuid` field in Lead entity after updating to 6.0.0-rc · Issue #14760 · mautic/mautic · GitHub](https://github.com/mautic/mautic/issues/14760) which was fixed with the later PR:

> <https://github.com/mautic/mautic/pull/14554>
>
> | Q | A
> | --------------------------------…------ | ---
> | Bug fix? (use the a.b branch) | 🟢 
> | New feature/enhancement? (use the a.x branch) | 🔴
> | Deprecations? | 🔴
> | BC breaks? (use the c.x branch) | 🔴
> | Automated tests included? | 🟢 
> | Related user documentation PR URL |  
> | Related developer documentation PR URL |  
> | Issue(s) addressed | 
> 
> 
> 
> \## Description
> 
> This PR adds permission checks during contact and company imports.
> 
> 
> 
> 
> 
> 
> \---
> \### 📋 Steps to test this PR:
> 
> 1. Create a role that does not have permissions for editing contacts but has permissions to create contacts.
> 2. Login as a user that has the above role assigned to them.
> 3. Create a new contact import that contains rows for both inserts and updates.
> 4. Wait till the import is \`imported\`.
> 5. Any CSV rows containing updates should be ignored. 
> 6. There should be error messages like \`User '\<username\>' has insufficient permissions\` for all the rows containing updates.
> 7. Validate that permissions are checked against a user who \*\*last updated a given import\*\*.
> 8. Validate the above steps for company imports at \`/s/companies/import/new\`. The company import follows the same \`Contact Permissions\`. There are no separate \`Company Permissions\`.

Also released with 6.0.0.

---

<div class="post-metadata">

**Author:** ![raramuridesign](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/raramuridesign/32/13226_2.png) [@raramuridesign](https://forum.mautic.org/u/raramuridesign)\
**Post date:** [May 6, 2025, 12:02pm UTC](https://forum.mautic.org/t/issue-with-logging-in-to-mautic-6-0-after-upgrade-from-5-2-5/35610/4 "2025-05-06T12:02:04Z")

</div>

@silavapi Thanks for the info, I have started this again, and seen where this does not work.

Upgrading from v5.2.1 to 5.2.5 results in the migration not happening as I mentioned here, so adding in the missing field works.

> [@V6.0.0 Upgrade- Error when creating or editing forms](https://forum.mautic.org/t/v6-0-0-upgrade-error-when-creating-or-editing-forms/35381/4):
>
> @silavapi I ran this command manually on the database and it fixed the issue. Thanks for the info. ALTER TABLE form\_fields ADD COLUMN is\_read\_only TINYINT(1) DEFAULT 0; or direct cli command php bin/console doctrine:migrations:migrate “Mautic\Migrations\Version20241227065658” --env=prod

Then upgrading from 5.2.5 to 6.0.0 results in this error being shown below.  
I have no idea what **Integrity constraint violation** is, so I am adding the error here, so someone knows what to do.

```auto
[2025-05-06T11:46:29.880888+00:00] console.CRITICAL: Error thrown while running command "doctrine:migrations:migrate --quiet --no-interaction". Message: "An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 4025 CONSTRAINT `mautic_emails.headers` failed for `mautic_xxxxx`.`mautic_emails`" {"exception":"[object] (Doctrine\\DBAL\\Exception\\DriverException(code: 4025): An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 4025 CONSTRAINT `mautic_emails.headers` failed for `mautic_xxxxx`.`mautic_emails` at /home/mautic-xxxx/webapps/j3mautic/public/go/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:117)\n[previous exception] [object] (Doctrine\\DBAL\\Driver\\PDO\\Exception(code: 4025): SQLSTATE[23000]: Integrity constraint violation: 4025 CONSTRAINT `mautic_emails.headers` failed for `mautic_xxxxx`.`mautic_emails` at /home/mautic-xxxx/webapps/j3mautic/public/go/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28)\n[previous exception] [object] (PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 4025 CONSTRAINT `mautic_emails.headers` failed for `mautic_xxxxx`.`mautic_emails` at /home/mautic-xxxx/webapps/j3mautic/public/go/vendor/doctrine/dbal/src/Driver/PDO/Connection.php:71)","command":"doctrine:migrations:migrate --quiet --no-interaction","message":"An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 4025 CONSTRAINT `mautic_emails.headers` failed for `mautic_xxxxx`.`mautic_emails`"} {"hostname":"a-srv24-wwm-ubuntu24","pid":1942844}

```

Since I know this has to do with uuid field missing on certain tables, I have done a compare of the tables from a new v6.0.0 install and identified the following tables, which have the field `uuid`.

mautic\_assets  
mautic\_campaigns  
mautic\_campaign\_events  
mautic\_categories  
mautic\_dynamic\_content  
mautic\_emails  
mautic\_focus  
mautic\_forms  
mautic\_form\_actions  
mautic\_form\_fields  
mautic\_lead\_fields  
mautic\_lead\_lists  
mautic\_lead\_tags  
mautic\_messages  
mautic\_message\_channels  
mautic\_monitoring  
mautic\_pages  
mautic\_permissions  
mautic\_points  
mautic\_point\_trigger\_events  
mautic\_point\_triggers  
mautic\_push\_notifications  
mautic\_reports  
mautic\_roles  
mautic\_sms\_messages  
mautic\_stages

I am assuming the migration did not run, due to the error. So I manually ran the following command to add the `uuid` field to the tables.

```auto
ALTER TABLE mautic_assets ADD COLUMN `uuid` char(36) DEFAULT NULL;
ALTER TABLE mautic_campaigns ADD COLUMN `uuid` char(36) DEFAULT NULL;
ALTER TABLE mautic_campaign_events ADD COLUMN `uuid` char(36) DEFAULT NULL;
ALTER TABLE mautic_categories ADD COLUMN `uuid` char(36) DEFAULT NULL;
ALTER TABLE mautic_dynamic_content ADD COLUMN `uuid` char(36) DEFAULT NULL;
ALTER TABLE mautic_emails ADD COLUMN `uuid` char(36) DEFAULT NULL;
ALTER TABLE mautic_focus ADD COLUMN `uuid` char(36) DEFAULT NULL;
ALTER TABLE mautic_forms ADD COLUMN `uuid` char(36) DEFAULT NULL;
ALTER TABLE mautic_form_actions ADD COLUMN `uuid` char(36) DEFAULT NULL;
ALTER TABLE mautic_form_fields ADD COLUMN `uuid` char(36) DEFAULT NULL;
ALTER TABLE mautic_lead_fields ADD COLUMN `uuid` char(36) DEFAULT NULL;
ALTER TABLE mautic_lead_lists ADD COLUMN `uuid` char(36) DEFAULT NULL;
ALTER TABLE mautic_lead_tags ADD COLUMN `uuid` char(36) DEFAULT NULL;
ALTER TABLE mautic_messages ADD COLUMN `uuid` char(36) DEFAULT NULL;
ALTER TABLE mautic_message_channels ADD COLUMN `uuid` char(36) DEFAULT NULL;
ALTER TABLE mautic_monitoring ADD COLUMN `uuid` char(36) DEFAULT NULL;
ALTER TABLE mautic_pages ADD COLUMN `uuid` char(36) DEFAULT NULL;
ALTER TABLE mautic_permissions ADD COLUMN `uuid` char(36) DEFAULT NULL;
ALTER TABLE mautic_points ADD COLUMN `uuid` char(36) DEFAULT NULL;
ALTER TABLE mautic_point_trigger_events ADD COLUMN `uuid` char(36) DEFAULT NULL;
ALTER TABLE mautic_point_triggers ADD COLUMN `uuid` char(36) DEFAULT NULL;
ALTER TABLE mautic_push_notifications ADD COLUMN `uuid` char(36) DEFAULT NULL;
ALTER TABLE mautic_reports ADD COLUMN `uuid` char(36) DEFAULT NULL;
ALTER TABLE mautic_roles ADD COLUMN `uuid` char(36) DEFAULT NULL;
ALTER TABLE mautic_sms_messages ADD COLUMN `uuid` char(36) DEFAULT NULL;
ALTER TABLE mautic_stages ADD COLUMN `uuid` char(36) DEFAULT NULL;

```

Once this was done, I could log back into the mautic instance.  
I hope this helps anyone with the same issues.  
Matthew

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [May 6, 2025, 1:11pm UTC](https://forum.mautic.org/t/issue-with-logging-in-to-mautic-6-0-after-upgrade-from-5-2-5/35610/5 "2025-05-06T13:11:18Z")

</div>

Thanks @raramuridesign I’ll flag it up in the Mautic 6 channel to see if anyone else is coming across this issue.

To be clear, the migration was only present from the release that the PRs were merged into, ie 6.0.0. So it wouldn’t run in Mautic 5 because the UUID field was introduced in Mautic 6. So you will only be running that migration when you go from 5 → 6.

---

<div class="post-metadata">

**Author:** ![raramuridesign](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/raramuridesign/32/13226_2.png) [@raramuridesign](https://forum.mautic.org/u/raramuridesign)\
**Post date:** [May 6, 2025, 3:06pm UTC](https://forum.mautic.org/t/issue-with-logging-in-to-mautic-6-0-after-upgrade-from-5-2-5/35610/6 "2025-05-06T15:06:48Z")

</div>

@silavapi Thank you.  
I see there is a new 6 version today, and there is an improvement on migrations. I will let you know how this goes.  
Matthew

---

<div class="post-metadata">

**Author:** ![raramuridesign](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/raramuridesign/32/13226_2.png) [@raramuridesign](https://forum.mautic.org/u/raramuridesign)\
**Post date:** [May 8, 2025, 6:52am UTC](https://forum.mautic.org/t/issue-with-logging-in-to-mautic-6-0-after-upgrade-from-5-2-5/35610/7 "2025-05-08T06:52:21Z")

</div>

@silavapi So we have upgraded several mautic version to v6.0.1-

We get 2 issues, but the one which I think relates to this is the error below.  
I can see what the issue is and can confirm that this does not exist, but it would be good if these errors did not show when an upgrade was performed. It throws some doubt into the process.

**Can’t DROP INDEX `m5company_match`; check that it exists**

Full error below.  
Otherwise it all seemed to work without issues.  
Matthew

```auto
[2025-05-07T08:27:36.038863+00:00] console.CRITICAL: Error thrown while running command "doctrine:migrations:migrate --quiet --no-interaction". Message: "An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1091 **Can't DROP INDEX `m5company_match`; check that it exists"** {"exception":"[object] (Doctrine\\DBAL\\Exception\\DriverException(code: 1091): An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1091 **Can't DROP INDEX `m5company_match`;** check that it exists at /home/mautic-client/webapps/mautic/public/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:117)\n[previous exception] [object] (Doctrine\\DBAL\\Driver\\PDO\\Exception(code: 1091): SQLSTATE[42000]: Syntax error or access violation: 1091 **Can't DROP INDEX `m5company_match`; check that it exists** at /home/mautic-client/webapps/mautic/public/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28)\n[previous exception] [object] (PDOException(code: 42000): SQLSTATE[42000]: Syntax error or access violation: 1091 **Can't DROP INDEX `m5company_match`;** check that it exists at /home/mautic-client/webapps/mautic/public/vendor/doctrine/dbal/src/Driver/PDO/Connection.php:71)","command":"doctrine:migrations:migrate --quiet --no-interaction","message":"An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP INDEX `m5company_match`; check that it exists"} {"hostname":"a-xxx","pid":232815}

```

---

<div class="post-metadata">

**Author:** ![raramuridesign](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/raramuridesign/32/13226_2.png) [@raramuridesign](https://forum.mautic.org/u/raramuridesign)\
**Post date:** [May 8, 2025, 7:01am UTC](https://forum.mautic.org/t/issue-with-logging-in-to-mautic-6-0-after-upgrade-from-5-2-5/35610/8 "2025-05-08T07:01:34Z")

</div>

Same issue mentioned here  
++ [Error running migrations](https://forum.mautic.org/t/error-running-migrations/35481)  
++ [Console doctrine:schema:update --no-interaction --force](https://forum.mautic.org/t/console-doctrineupdate-no-interaction-force/35433)
