# Cancel Event not completing - MariaDB error in SQL syntax date\_added

**URL:** <https://forum.mautic.org/t/cancel-event-not-completing-mariadb-error-in-sql-syntax-date-added/18639>\
**Category:** Product Support\
**Created:** [March 19, 2021, 8:11pm UTC](https://forum.mautic.org/t/cancel-event-not-completing-mariadb-error-in-sql-syntax-date-added/18639 "2021-03-19T20:11:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sj136](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sj136/32/1309_2.png) [@sj136](https://forum.mautic.org/u/sj136)\
**Post date:** [March 19, 2021, 8:11pm UTC](https://forum.mautic.org/t/cancel-event-not-completing-mariadb-error-in-sql-syntax-date-added/18639/1 "2021-03-19T20:11:12Z")

</div>

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?

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)\
**Post date:** [March 20, 2021, 4:03pm UTC](https://forum.mautic.org/t/cancel-event-not-completing-mariadb-error-in-sql-syntax-date-added/18639/2 "2021-03-20T16:03:30Z")

</div>

run **mautic:campaigns:update**

---

<div class="post-metadata">

**Author:** ![sj136](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sj136/32/1309_2.png) [@sj136](https://forum.mautic.org/u/sj136)\
**Post date:** [March 20, 2021, 10:10pm UTC](https://forum.mautic.org/t/cancel-event-not-completing-mariadb-error-in-sql-syntax-date-added/18639/3 "2021-03-20T22:10:47Z")

</div>

@EJL thank you for your reply.

When I run the command in SSH this is the output on the screen:

/usr/local/bin/php bin/console mautic:campaigns:update

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

```
    5,20,35,50	*	*	*	*	/usr/local/bin/php /home/NAME/public_html/DOMAINDIRECTORY/bin/console mautic:campaigns:update >/dev/null 2>&1

```

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

.

So I am still stuck as to how to fix it.

Can you provide any additional suggestions?

---

<div class="post-metadata">

**Author:** ![sj136](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sj136/32/1309_2.png) [@sj136](https://forum.mautic.org/u/sj136)\
**Post date:** [March 20, 2021, 10:18pm UTC](https://forum.mautic.org/t/cancel-event-not-completing-mariadb-error-in-sql-syntax-date-added/18639/4 "2021-03-20T22:18:59Z")

</div>

I do not seem to have any errors with the other cron jobs I have set for mautic, because I am not seeing any entries in the log for those commands:

0,15,30,45 \* \* \* \* `/usr/local/bin/php /home/NAME/public_html/DOMAINDIRECTORY/bin/console mautic:segments:update >/dev/null 2>&1`

10,25,40,55 \* \* \* \* `/usr/local/bin/php /home/NAME/public_html/DOMAINDIRECTORY/bin/console mautic:campaigns:trigger >/dev/null 2>&1`

\*/15 2 10 \* \* `/usr/local/bin/php /home/NAME/public_html/DOMAINDIRECTORY/bin/console mautic:iplookup:download >/dev/null 2>&1`

---

<div class="post-metadata">

**Author:** ![t0ny3003](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/t0ny3003/32/6384_2.png) [@t0ny3003](https://forum.mautic.org/u/t0ny3003)\
**Post date:** [December 4, 2021, 9:01am UTC](https://forum.mautic.org/t/cancel-event-not-completing-mariadb-error-in-sql-syntax-date-added/18639/6 "2021-12-04T09:01:57Z")

</div>

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.
