I am using Mautic 3.2.1
My PHP version is : 7.3.27
My Database type and version is: MariaDB version 10.3.24-MariaDB-cll-lve
My problem is:
When I go into a Contact’s History tab and try to cancel a future Campaign event, it gives a popup saying “This event was scheduled for DATE but has been cancelled.” But when I refresh the page, it is still scheduled.
This is a sample error from the log:
[2021-03-19 05:35:01] mautic.ERROR: CAMPAIGN: An exception occurred while executing ‘REPLACE INTO maut2_campaign_lead_event_failed_log( log_id, date_added, reason) SELECT id, :dateAdded as date_added, :message as reason from maut2_campaign_lead_event_log WHERE is_scheduled = 1 AND lead_id = :contactId AND campaign_id = :campaignId AND rotation = :rotation’: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘:dateAdded as date_added, :message as reason from maut2_campaign_lead_event_l…’ at line 2
I have tried searching on this forum and google, but I am not understanding how to fix the problem.
I need more assistance in how I need to correct the issue. I do not understand what I need to do to fix the SQL syntax error.
Can someone provide me more detailed steps of what I need to do to correct the problem?
Rebuilding contacts for campaign 1
0 total contact(s) to be added in batches of 300
3 total contact(s) to be removed in batches of 300
1/3 [=========>------------------] 33%
and then it goes back to the # line
I do have the cron job set up to do the campaigns updates
I am seeing the same error in the logs when I run the command manually as gets output every time the mautic:campaigns:update command gets run (at 5, 20, 35, 50 minutes):
[2021-03-20 17:35:03] mautic.ERROR: CAMPAIGN: An exception occurred while executing ‘REPLACE INTO maut2_campaign_lead_event_failed_log( log_id, date_added, reason) SELECT id, :dateAdded as date_added, :message as reason from maut2_campaign_lead_event_log WHERE is_scheduled = 1 AND lead_id = :contactId AND campaign_id = :campaignId AND rotation = :rotation’: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘:dateAdded as date_added, :message as reason from maut2_campaign_lead_event_l…’ at line 2
[2021-03-20 17:41:06] mautic.ERROR: CAMPAIGN: An exception occurred while executing ‘REPLACE INTO maut2_campaign_lead_event_failed_log( log_id, date_added, reason) SELECT id, :dateAdded as date_added, :message as reason from maut2_campaign_lead_event_log WHERE is_scheduled = 1 AND lead_id = :contactId AND campaign_id = :campaignId AND rotation = :rotation’: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘:dateAdded as date_added, :message as reason from maut2_campaign_lead_event_l…’ at line 2
Worth mentioning that when I bumped up the PHP version that runs the cron job the error went away. For anyone that might stumble on this in the future.