Your software
My Mautic version is: v4.4.9
My PHP version is: 7.4.33
My Database type and version is: 8.0.34
Your problem
My problem is:
These errors are showing in the log: [2023-09-12 18:51:01] mautic.ERROR: CAMPAIGN: An exception occurred while executing ‘REPLACE INTO mautic_campaign_lead_event_failed_log( log_id, date_added, reason) SELECT id, :dateAdded as date_added, :message as reason from mautic_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 MySQL server version for the right syntax to use near ':dateAdded as date_added, :message as reason from mautic_campaign_lead_event_log ’ at line 2 {“hostname”:“{server_url}”,“pid”:1633831}
Steps I have tried to fix the problem: Nothing at the moment, browsed different topics but didn’t find how to make it, but seems to be a common problem.
This code is being called when a contact is about to be removed from a campaign. Do you have some “Change membershi” event in some of your campaigns?
Are you able to batch remove contacts from a campaign in the contact list (table) view by checking a couple of contacts and selecting the change campaign membership option in the table context menu?
I recently had the same issue while updating segments on Mautic 4.4.10, PHP 8.0.30, and MySQL 8.0.35.
@escopecz I don’t understand the suggested action since I’m new to Mautic. Also, can you please explain when this could happen so I can prevent facing this issue? I prefer not to use any manual actions in the future if it’s possible.
@escopecz It’s MySQL 8.0.33. I accidentally wrote 8.0.35 earlier.
I can’t try what you suggest because this is happening in production, and I don’t know which contacts may cause the issue. I will try to replicate it on the stage server. I would appreciate it if you could explain how this could happen.
That may be the issue. As more people using mysqli are having issues and supporting this driver 100% would require a lot of work, we are removing it in
All Mautic instances will start using the pdo_mysql driver since Mautic 5.0.2 no matter what is in the configuration. For now, please change the db_driver from mysqli to pdo_mysql to test that that will solve your problem.