Your software
My Mautic version is: 5.2.1
My PHP version is: 8.3.15
My Database type and version is: 11.4.4
Your problem
My mautic_prod-xxx.php log file is filling up with an Integrity constraint violation. Happening at least every minute (and sometimes every ~10 seconds). Any pointers on what might be causing it, or how to track down the issue?
[2025-01-18T09:27:17.966586+00:00] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException: “An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (mauticdb
.lead_lists_leads
, CONSTRAINT FK_F5F47C7C55458D
FOREIGN KEY (lead_id
) REFERENCES leads
(id
) ON DELETE CASCADE)” at /opt/mautic/mautic/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php line 56 {“exception”:“[object] (Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException(code: 1452): An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (mauticdb
.lead_lists_leads
, CONSTRAINT FK_F5F47C7C55458D
FOREIGN KEY (lead_id
) REFERENCES leads
(id
) ON DELETE CASCADE) at /opt/mautic/mautic/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:56)\n[previous exception] [object] (Doctrine\DBAL\Driver\PDO\Exception(code: 1452): SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (mauticdb
.lead_lists_leads
, CONSTRAINT FK_F5F47C7C55458D
FOREIGN KEY (lead_id
) REFERENCES leads
(id
) ON DELETE CASCADE) at /opt/mautic/mautic/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28)\n[previous exception] [object] (PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (mauticdb
.lead_lists_leads
, CONSTRAINT FK_F5F47C7C55458D
FOREIGN KEY (lead_id
) REFERENCES leads
(id
) ON DELETE CASCADE) at /opt/mautic/mautic/vendor/doctrine/dbal/src/Driver/PDO/Statement.php:130)”} {“hostname”:“mautic”,“pid”:5997}
Regards