Mautic Community Forums

Same Contact Id used by Mautic all the time

Your software
My Mautic version is: 3.3.3
My PHP version is: 7.3.28
My Database type and version is: MySQL 5.7.34

Your problem
My problem is:
Contacts are saved with the same Contact Id, thus one contact get’s overridden all the time. When I check one of my forms, it has about 10 or so different email addresses which show the same contact id. This contact id only shows up under contacts and always just has the latest email address.

These errors are showing in the log:

[2021-05-26 11:20:10] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\UniqueConstraintViolationException: 
"An exception occurred while executing 'INSERT INTO osma_point_lead_action_log (date_fired, point_id, lead_id, ip_id) VALUES (?, ?, ?, ?)' with params ["2021-05-26 11:20:10", 2, "562", 1406]:  
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2-562' for key 'PRIMARY'" 
at /home/dir/htdocs/prod/go/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 55 
{"exception":"[object] (Doctrine\\DBAL\\Exception\\UniqueConstraintViolationException(code: 0): An exception occurred while executing 
'INSERT INTO osma_point_lead_action_log (date_fired, point_id, lead_id, ip_id) VALUES (?, ?, ?, ?)' with params 
[\"2021-05-26 11:20:10\", 2, \"562\", 1406]:\n\nSQLSTATE[23000]: Integrity constraint violation: 
1062 Duplicate entry '2-562' for key 'PRIMARY' 
at /home/dir/htdocs/prod/go/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:55, 
Doctrine\\DBAL\\Driver\\PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2-562' for key 'PRIMARY' 
at /home/dir/htdocs/prod/go/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:123, PDOException(code: 23000): 
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2-562' for key 'PRIMARY' 
at /home/dir/htdocs/prod/go/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:121)"} []

The Contact id 562 was updated since then every day, but without log entries.

Steps I have tried to fix the problem:
None, as I have no idea where to start.

Is there anything I need to do with the database?

Every help is highly appreciated.

Thanks a lot and Best Regards,
Stephan

I solved the issue by deleting the contacts with the same contact id, though I just have one contact with the contact id in question…
Now everything works fine again.
No idea what caused this issue.