Body: <p>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.</p>
  <pre><code> [error] $Fatal Error Details = Array
  (
      [callback] =&gt; Array
          (
              [0] =&gt; CRM_Core_Error
              [1] =&gt; exceptionHandler
          )
  
   
  
      [code] =&gt; -2
      [message] =&gt; DB Error: syntax error
      [mode] =&gt; 16
      [debug_info] =&gt; 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] =&gt; DB_Error
      [user_info] =&gt; 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] =&gt; [db_error: message=&quot;DB Error: syntax error&quot; code=-2 mode=callback callback=CRM_Core_Error::exceptionHandler prefix=&quot;&quot; info=&quot;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]&quot;]
  )
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-11-25T21:00:35.910Z
Comments.Text: 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.
Comments.UserDisplayName: Parvez Saleh
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-11-29T22:33:48.177Z
Comments.Text: 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.
Comments.UserDisplayName: Josh
Tags: <drupal>
Title: Error during event registration in DMZ - Drupal CIVICRM
ThreadText: # Error during event registration in DMZ - Drupal CIVICRM
  
  (Asked by: username_0 on 2020-11-25)
  
  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]"]
  )
  
  ```
  
  **Tags:** drupal
  
  > **Comments:**
  > **username_1**: 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.  
  > **username_2**: 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.  
  
  ---
  
  ## 0 answers
  
  