Your software
My Mautic version is: v2.16.3
My PHP version is: v7.2.33
My Database type and version is: MariaDB v10.3.25
Your problem
app/console mautic:campaigns:trigger
throws Integrity Constraint Violation for Duplicate entry for key ‘campaign_rotation’
These errors are showing in the log:
[2020-10-23 14:03:01] mautic.ERROR: CAMPAIGN: An exception occurred while executing 'INSERT INTO oacampaign_lead_event_log (rotation, date_triggered, is_scheduled, trigger_date, system_triggered, metadata_path_taken, event_id, lead_id, campaign_id, ip_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [2, "2020-10-23 14:03:01", 0, null, 1, "a:0:{}", null, null, 0, 238, 23582, 31, null]: SQLS violation: 1062 Duplicate entry '238-23582-2' for key 'oacampaign_rotation' [] []
[2020-10-23 14:03:01] mautic.ERROR: CAMPAIGN: The EntityManager is closed. [] []
[2020-10-23 14:03:02] mautic.ERROR: CAMPAIGN: The EntityManager is closed. [] []
[2020-10-23 14:03:02] mautic.ERROR: CAMPAIGN: The EntityManager is closed. [] []
[2020-10-23 14:03:02] mautic.ERROR: CAMPAIGN: The EntityManager is closed. [] []
[2020-10-23 14:03:02] mautic.ERROR: CAMPAIGN: The EntityManager is closed. [] []
[2020-10-23 14:03:02] mautic.ERROR: CAMPAIGN: The EntityManager is closed. [] []
[2020-10-23 14:08:03] mautic.ERROR: CAMPAIGN: An exception occurred while executing 'INSERT INTO oacampaign_lead_event_log (rotation, date_triggered, is_scheduled, trigger_date, system_triggered, metadata_path_taken, event_id, lead_id, campaign_id, ip_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [2, "2020-10-23 14:08:03", 0, null, 1, "a:0:{}", null, null, 0, 238, 23582, 31, null]: SQLS violation: 1062 Duplicate entry '238-23582-2' for key 'oacampaign_rotation' [] []
[2020-10-23 14:08:03] mautic.ERROR: CAMPAIGN: The EntityManager is closed. [] []
[2020-10-23 14:08:03] mautic.ERROR: CAMPAIGN: The EntityManager is closed. [] []
[2020-10-23 14:08:03] mautic.ERROR: CAMPAIGN: The EntityManager is closed. [] []
[2020-10-23 14:08:03] mautic.ERROR: CAMPAIGN: The EntityManager is closed. [] []
[2020-10-23 14:08:03] mautic.ERROR: CAMPAIGN: The EntityManager is closed. [] []
[2020-10-23 14:08:03] mautic.ERROR: CAMPAIGN: The EntityManager is closed. [] []
Steps I have tried to fix the problem:
Have tried deleting the duplicate entries manually in the database hoping the mautic:campaigns:trigger
would mark the entry as successfully inserted, however, the error just moves onto the next duplicate key.
Have tried upgrading Mautic to v3, but ran into bigger problems so I rolled back to this version. On rolling back, I downoaded a clean v2.16.3 from github & migrated my local.config to the fresh download directory. These error still fill up my logs every 5min due to cronjob firing the campaign:trigger task
Any assistance would be much appreciated.
regards,
Andrew