Mautic version is: 2.15.3
PHP version is: 7.1.33
OS: CentOS Linux release 7.7.1908
Apache: 2.4.41
Postfix: 2.10.1
cron jobs:
*/5 * * * * /bin/php /var/www/my.mautic.com/app/console mautic:segments:update > /dev/null 2>&1
1,6,11,16,21,26,31,36,41,46,51,56 * * * * /bin/php /var/www/my.mautic.com/app/console mautic:campaigns:rebuild > /dev/null
2,7,12,17,22,27,32,37,42,47,52,57 * * * * /bin/php /var/www/my.mautic.com/app/console mautic:campaigns:trigger
13,28,43,58 * * * * /bin/php /var/www/my.mautic.com/app/console mautic:import
* * * * * /bin/php /var/www/my.mautic.com/app/console mautic:emails:send
My problem is:
Out of 10000 contacts in my mautic system, only a bit more than 5000 are sent sent out via email.
On the mautic dashboard it shows 10000 emails have been sent by mautic, however postfix only received half of it.
Here’s a report from the postfix log:
# pflogsumm -d today /var/log/maillog
Postfix log summaries for Jan 23
Grand Totals
------------
messages
5217 received
5234 delivered
0 forwarded
71 deferred (591 deferrals)
27 bounced
2 rejected (0%)
0 reject warnings
0 held
0 discarded (0%)
75484k bytes received
69322k bytes delivered
15 senders
14 sending hosts/domains
5164 recipients
110 recipient hosts/domains
These errors are showing in the log:
[2020-01-23 08:25:47] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\UniqueConstraintViolationException: “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, “2020-01-23 08:25:47”, 0, null, 0, “a:0:{}”, “email”, 67, 0, 178, 58803, 43, 187024]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘178-58803-1’ for key ‘campaign_rotation’” at /var/www/my.mautic.com/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, “2020-01-23 08:25:47”, 0, null, 0, “a:0:{}”, “email”, 67, 0, 178, 58803, 43, 187024]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘178-58803-1’ for key ‘campaign_rotation’ at /var/www/my.mautic.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:66, Doctrine\DBAL\Driver\PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘178-58803-1’ for key ‘campaign_rotation’ at /var/www/my.mautic.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:107, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘178-58803-1’ for key ‘campaign_rotation’ at /var/www/my.mautic.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:105)"}
[2020-01-23 08:31:13] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\UniqueConstraintViolationException: “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, “2020-01-23 08:31:13”, 0, null, 0, “a:0:{}”, “email”, 67, 0, 178, 12592, 43, 92337]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘178-12592-1’ for key ‘campaign_rotation’” at /var/www/my.mautic.com/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, “2020-01-23 08:31:13”, 0, null, 0, “a:0:{}”, “email”, 67, 0, 178, 12592, 43, 92337]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘178-12592-1’ for key ‘campaign_rotation’ at /var/www/my.mautic.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:66, Doctrine\DBAL\Driver\PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘178-12592-1’ for key ‘campaign_rotation’ at /var/www/my.mautic.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:107, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘178-12592-1’ for key ‘campaign_rotation’ at /var/www/my.mautic.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:105)"}
Note those error messages in the logs are appearing regularly the whole day long (even when there’s no campaign sending out emails), so they don’t seem related to the problem
Steps I have tried to fix the problem:
trying to get output from console mautic:import and console mautic:emails:send during the next campaign (tomorrow) to help identifying the root cause of the problem
While I’m waiting for more debug info, any hint on what could cause this problem ?