0

We are getting the following message in the error logs when users attempt to register for an event. It works fine in our internal domain, but when we cloned the server into our DMZ, we get the following error in our CIVICRM log. We are running Civicrm 7.x-5.22.1 as a drupal 7 module on PHP 7.3.14 under IIS on Windows Server 2012 R2 with MySQL backend (version 5.X) on a seperate server.

 [error] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => exceptionHandler
        )

 

    [code] => -2
    [message] => DB Error: syntax error
    [mode] => 16
    [debug_info] => SELECT `p`.*
            FROM `civicrm_participant` `p`
            INNER JOIN `civicrm_event` `e` ON `e`.`id` = `p`.`event_id`
            LEFT JOIN `civirule_rule_log` `rule_log` ON `rule_log`.entity_table = 'civicrm_participant' AND `rule_log`.entity_id = p.id AND `rule_log`.`contact_id` = `p`.`contact_id` AND DATE(`rule_log`.`log_date`) = DATE(NOW())  AND `rule_log`.`rule_id` = %3
            WHERE DATE(`e`.`end_date`) = CURDATE()
            AND `rule_log`.`id` IS NULL
            AND `e`.`event_type_id` = 7
            AND `p`.`contact_id` NOT IN (
              SELECT `rule_log2`.`contact_id`
              FROM `civirule_rule_log` `rule_log2`
              WHERE `rule_log2`.`rule_id` = %3 AND DATE(`rule_log2`.`log_date`) = DATE(NOW()) and `rule_log2`.`entity_table` IS NULL AND `rule_log2`.`entity_id` IS NULL
            ) [nativecode=1064 ** 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 '%3
            WHERE DATE(`e`.`end_date`) = CURDATE()
            AND `rule_log`' at line 4]
    [type] => DB_Error
    [user_info] => SELECT `p`.*
            FROM `civicrm_participant` `p`
            INNER JOIN `civicrm_event` `e` ON `e`.`id` = `p`.`event_id`
            LEFT JOIN `civirule_rule_log` `rule_log` ON `rule_log`.entity_table = 'civicrm_participant' AND `rule_log`.entity_id = p.id AND `rule_log`.`contact_id` = `p`.`contact_id` AND DATE(`rule_log`.`log_date`) = DATE(NOW())  AND `rule_log`.`rule_id` = %3
            WHERE DATE(`e`.`end_date`) = CURDATE()
            AND `rule_log`.`id` IS NULL
            AND `e`.`event_type_id` = 7
            AND `p`.`contact_id` NOT IN (
              SELECT `rule_log2`.`contact_id`
              FROM `civirule_rule_log` `rule_log2`
              WHERE `rule_log2`.`rule_id` = %3 AND DATE(`rule_log2`.`log_date`) = DATE(NOW()) and `rule_log2`.`entity_table` IS NULL AND `rule_log2`.`entity_id` IS NULL
            ) [nativecode=1064 ** 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 '%3
            WHERE DATE(`e`.`end_date`) = CURDATE()
            AND `rule_log`' at line 4]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="SELECT `p`.*
            FROM `civicrm_participant` `p`
            INNER JOIN `civicrm_event` `e` ON `e`.`id` = `p`.`event_id`
            LEFT JOIN `civirule_rule_log` `rule_log` ON `rule_log`.entity_table = 'civicrm_participant' AND `rule_log`.entity_id = p.id AND `rule_log`.`contact_id` = `p`.`contact_id` AND DATE(`rule_log`.`log_date`) = DATE(NOW())  AND `rule_log`.`rule_id` = %3
            WHERE DATE(`e`.`end_date`) = CURDATE()
            AND `rule_log`.`id` IS NULL
            AND `e`.`event_type_id` = 7
            AND `p`.`contact_id` NOT IN (
              SELECT `rule_log2`.`contact_id`
              FROM `civirule_rule_log` `rule_log2`
              WHERE `rule_log2`.`rule_id` = %3 AND DATE(`rule_log2`.`log_date`) = DATE(NOW()) and `rule_log2`.`entity_table` IS NULL AND `rule_log2`.`entity_id` IS NULL
            ) [nativecode=1064 ** 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 '%3
            WHERE DATE(`e`.`end_date`) = CURDATE()
            AND `rule_log`' at line 4]"]
)
  • Looks like its a CiviRule failing. I would turn off the rules in the DMZ and see if it works. If it does work then my suspicion is you've got some paths wrong/changed or some character conversion thats occurred. Its worth understanding a bit more about the cloning process but lets see if switching off rules for the event gets you to a place where it works. – Parvez Saleh Nov 25 '20 at 21:00
  • I would also make sure that your database came over cleanly. Any time I hear new issue with database after migration that is one of the first things I go to. Check things like your encoding. – Josh Nov 29 '20 at 22:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.