Problem: Die an den MySQL Server übergebene Query hat einen Syntaxfehler

Your software
My Mautic version is:4.4.7
My PHP version is:8.0.26
My Database type and version is: MySQL 5.7 - SSD

Your problem
My problem is:

Die an den MySQL Server übergebene Query hat einen Syntaxfehler der behoben werden muss. Diese Query wird durch Mautic abgesetzt:

The query passed to the MySQL server has a syntax error that needs to be fixed. This query is sent by Mautic:

[2023-04-26 23:34:02] mautic.ERROR: CAMPAIGN: An exception occurred while executing 'REPLACE INTO campaign_lead_event_failed_log( `log_id`, `date_added`, `reason`) SELECT id, :dateAdded as date_added, :message as reason from 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

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

These errors are showing in the log:
[2023-05-03 11:01:01] mautic.ERROR: CAMPAIGN: An exception occurred while executing 'REPLACE INTO campaign_lead_event_failed_log( `log_id`, `date_added`, `reason`) SELECT id, :dateAdded as date_added, :message as reason from 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 campaign_lead_event_log WHERE ' at line 2 [] {"hostname":"ovm8067","pid":2951280}
[2023-05-03 11:01:01] mautic.ERROR: CAMPAIGN: An exception occurred while executing 'REPLACE INTO campaign_lead_event_failed_log( `log_id`, `date_added`, `reason`) SELECT id, :dateAdded as date_added, :message as reason from 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 campaign_lead_event_log WHERE ' at line 2 [] {"hostname":"ovm8067","pid":2951280}


[2023-05-03 11:01:32] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\SyntaxErrorException: "An exception occurred while executing 'REPLACE INTO campaign_lead_event_failed_log( `log_id`, `date_added`, `reason`) SELECT id, :dateAdded as date_added, :message as reason from 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 campaign_lead_event_log WHERE ' at line 2" at /html/mautic_447v2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 98 {"exception":"[object] (Doctrine\\DBAL\\Exception\\SyntaxErrorException(code: 0): An exception occurred while executing 'REPLACE INTO campaign_lead_event_failed_log( `log_id`, `date_added`, `reason`)\nSELECT id, :dateAdded as date_added, :message as reason from campaign_lead_event_log\nWHERE is_scheduled = 1 AND lead_id = :contactId AND campaign_id = :campaignId AND rotation = :rotation':\n\nYou 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 campaign_lead_event_log\nWHERE ' at line 2 at /html/mautic_447v2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:98, Doctrine\\DBAL\\Driver\\Mysqli\\Exception\\ConnectionError(code: 0): 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 campaign_lead_event_log\nWHERE ' at line 2 at /html/mautic_447v2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/Exception/ConnectionError.php:21)"} {"hostname":"ovm8067","pid":2951410}
[2023-05-03 11:02:02] mautic.ERROR: CAMPAIGN: An exception occurred while executing 'REPLACE INTO campaign_lead_event_failed_log( `log_id`, `date_added`, `reason`) SELECT id, :dateAdded as date_added, :message as reason from 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 campaign_lead_event_log WHERE ' at line 2 [] {"hostname":"ovm8067","pid":2951818}
[2023-05-03 11:02:02] mautic.ERROR: CAMPAIGN: An exception occurred while executing 'REPLACE INTO campaign_lead_event_failed_log( `log_id`, `date_added`, `reason`) SELECT id, :dateAdded as date_added, :message as reason from 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 campaign_lead_event_log WHERE ' at line 2 [] {"hostname":"ovm8067","pid":2951818}


Steps I have tried to fix the problem:

Nach Formularanmeldung auf  
https://f3t-workout.de/formular-fettverbrennung-anregen

wird eine Betätigungs-Email versand.

In der Bestätigungs-Email mit Double-Opt-IN Link, 
beim Klick auf diesen Link kommt "500 Internal Server Error"
Erst beim zweiten mal klick auf den Betätigungslink wird mal weitergeleitet.

In Mautic laufen die Segmente aber durch, trotz der obigen ERROR-Meldung


*After form registration on*
*https://f3t-workout.de/formular-fettverbrennung-anregen*

*a confirmation email will be sent.*

*In the confirmation email with double opt-in link,*
*when clicking on this link comes "500 Internal Server Error"*
*Only the second time you click on the activation link, you will be forwarded.*

*In Mautic, however, the segments run through, despite the above ERROR message*