Mautic Community Forums

Adding points to contact on email open throw SQL error

Hi guys,



Just went live on Mautic with a first campaign sent to 75K contacts.



Before sending the campaign, I set up the action of adding 1 point to a contact that would open the email (under Points > Manage Actions). After sending the campaign, I have checked my logs and saw a bunch of SQL errors looking like this :

Code:
mautic.CRITICAL: Uncaught PHP Exception DoctrineDBALExceptionUniqueConstraintViolationException: "An exception occurred while executing 'INSERT INTO campaign_lead_event_log (rotation, date_triggered, is_scheduled, trigger_date, system_triggered, metadata, channel, channel_id, non_action_path_taken, event_id, lead_id, campaign_id, ip_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [1, "2017-11-16 10:07:11", 0, null, 0, "a:0:{}", "email", 51, 0, 28, 26809, 8, 6]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '28-26809-1' for key 'campaign_rotation'" at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 66 {"exception":"[object] (Doctrine\DBAL\Exception\UniqueConstraintViolationException(code: 0): An exception occurred while executing 'INSERT INTO campaign_lead_event_log (rotation, date_triggered, is_scheduled, trigger_date, system_triggered, metadata, channel, channel_id, non_action_path_taken, event_id, lead_id, campaign_id, ip_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [1, "2017-11-16 10:07:11", 0, null, 0, "a:0:{}", "email", 51, 0, 28, 26809, 8, 6]:nnSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '28-26809-1' for key 'campaign_rotation' at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:66, Doctrine\DBAL\Driver\PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '28-26809-1' for key 'campaign_rotation' at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:107, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '28-26809-1' for key 'campaign_rotation' at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:105)"}

I think these errors are due to contacts opening the email twice.

How does that sound to you ? Is there something I can do to prevent these errors ?

Thanking you in advance,
Cheers !
.

Hi guys,

Just went live on Mautic with a first campaign sent to 75K contacts.

Before sending the campaign, I set up the action of adding 1 point to a contact that would open the email (under Points > Manage Actions). After sending the campaign, I have checked my logs and saw a bunch of SQL errors looking like this :

mautic.CRITICAL: Uncaught PHP Exception DoctrineDBALExceptionUniqueConstraintViolationException: "An exception occurred while executing 'INSERT INTO campaign_lead_event_log (rotation, date_triggered, is_scheduled, trigger_date, system_triggered, metadata, channel, channel_id, non_action_path_taken, event_id, lead_id, campaign_id, ip_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [1, "2017-11-16 10:07:11", 0, null, 0, "a:0:{}", "email", 51, 0, 28, 26809, 8, 6]:  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '28-26809-1' for key 'campaign_rotation'" at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 66 {"exception":"[object] (Doctrine\DBAL\Exception\UniqueConstraintViolationException(code: 0): An exception occurred while executing 'INSERT INTO campaign_lead_event_log (rotation, date_triggered, is_scheduled, trigger_date, system_triggered, metadata, channel, channel_id, non_action_path_taken, event_id, lead_id, campaign_id, ip_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [1, "2017-11-16 10:07:11", 0, null, 0, "a:0:{}", "email", 51, 0, 28, 26809, 8, 6]:nnSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '28-26809-1' for key 'campaign_rotation' at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:66, Doctrine\DBAL\Driver\PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '28-26809-1' for key 'campaign_rotation' at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:107, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '28-26809-1' for key 'campaign_rotation' at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:105)"}

I think these errors are due to contacts opening the email twice.

How does that sound to you ? Is there something I can do to prevent these errors ?

Thanking you in advance,
Cheers !
.