Answers.Body: <p>I completely forgot to come back to this. The issue turned out to be a scheduled reminder set to go to "membership", but with no membership option selected. The where claus was in fact getting an empty array.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-20T14:27:49.947Z
Answers.LastActivityDate: 2017-12-20T14:27:49.947Z
Answers.UserDisplayName: Rachel Olivero
Body: <p>We're running Civi 4.6.16 and Drupal 7. Our schedule reminders are not sending when the job triggers, or manually through an API call. The backtrace isn't seeming that helpful, to me, but maybe it'll help someone else:</p>
  
  <pre><code>Nov 07 11:30:02  [info] $backTrace = #
  0 /www/sites/all/modules/civicrm/CRM/Core/Error.php(897): CRM_Core_Error::backtrace("backTrace", TRUE)
  1 [internal function](): CRM_Core_Error::exceptionHandler(Object(DB_Error))
  2 /www/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
  3 /www/sites/all/modules/civicrm/packages/DB.php(976): PEAR_Error-&gt;PEAR_Error("DB Error: no such field", -19, 16, (Array:2), "\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
  4 /www/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error-&gt;DB_Error(-19, 16, (Array:2), "\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
  5 /www/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR-&gt;raiseError(NULL, -19, NULL, NULL, "\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...", "DB_Error", TRUE)
  6 /www/sites/all/modules/civicrm/packages/DB/mysqli.php(929): DB_common-&gt;raiseError(-19, NULL, NULL, NULL, "1054 ** Unknown column 'Array' in 'where clause'")
  7 /www/sites/all/modules/civicrm/packages/DB/mysqli.php(403): DB_mysqli-&gt;mysqliRaiseError()
  8 /www/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysqli-&gt;simpleQuery("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
  9 /www/sites/all/modules/civicrm/packages/DB/DataObject.php(2445): DB_common-&gt;query("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
  10 /www/sites/all/modules/civicrm/packages/DB/DataObject.php(1637): DB_DataObject-&gt;_query("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
  11 /www/sites/all/modules/civicrm/CRM/Core/DAO.php(321): DB_DataObject-&gt;query("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
  12 /www/sites/all/modules/civicrm/CRM/Core/DAO.php(1180): CRM_Core_DAO-&gt;query("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...", TRUE)
  13 /www/sites/all/modules/civicrm/CRM/Core/BAO/ActionSchedule.php(1298): CRM_Core_DAO::executeQuery("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...", (Array:1))
  14 /www/sites/all/modules/civicrm/CRM/Core/BAO/ActionSchedule.php(1477): CRM_Core_BAO_ActionSchedule::buildRecipientContacts(4, "20171107113002", (Array:2))
  15 /www/sites/all/modules/civicrm/api/v3/Job.php(186): CRM_Core_BAO_ActionSchedule::processQueue(NULL, (Array:2))
  16 /www/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_send_reminder((Array:1))
  17 /www/sites/all/modules/civicrm/Civi/API/Kernel.php(96): Civi\API\Provider\MagicFunctionProvider-&gt;invoke((Array:9))
  18 /www/sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel-&gt;run("Job", "send_reminder", (Array:1), NULL)
  19 /www/sites/all/modules/civicrm/CRM/Core/JobManager.php(131): civicrm_api("Job", "send_reminder", (Array:1))
  20 /www/sites/all/modules/civicrm/CRM/Core/JobManager.php(83): CRM_Core_JobManager-&gt;executeJob(Object(CRM_Core_ScheduledJob))
  21 /www/sites/all/modules/civicrm/api/v3/Job.php(99): CRM_Core_JobManager-&gt;execute(FALSE)
  22 /www/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_execute((Array:2))
  23 /www/sites/all/modules/civicrm/Civi/API/Kernel.php(96): Civi\API\Provider\MagicFunctionProvider-&gt;invoke((Array:9))
  24 /www/sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel-&gt;run("Job", "execute", (Array:2), NULL)
  25 /www/sites/all/modules/civicrm/bin/cli.class.php(111): civicrm_api("Job", "execute", (Array:2))
  26 /www/sites/all/modules/civicrm/bin/cli.php(32): civicrm_cli-&gt;callApi()
  27 {main}
  
  
  Nov 07 11:45:02  [info] $backTrace = #0 /www/sites/all/modules/civicrm/CRM/Core/Error.php(897): CRM_Core_Error::backtrace("backTrace", TRUE)
  #1 [internal function](): CRM_Core_Error::exceptionHandler(Object(DB_Error))
  #2 /www/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
  #3 /www/sites/all/modules/civicrm/packages/DB.php(976): PEAR_Error-&gt;PEAR_Error("DB Error: no such field", -19, 16, (Array:2), "\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
  #4 /www/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error-&gt;DB_Error(-19, 16, (Array:2), "\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
  #5 /www/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR-&gt;raiseError(NULL, -19, NULL, NULL, "\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...", "DB_Error", TRUE)
  #6 /www/sites/all/modules/civicrm/packages/DB/mysqli.php(929): DB_common-&gt;raiseError(-19, NULL, NULL, NULL, "1054 ** Unknown column 'Array' in 'where clause'")
  #7 /www/sites/all/modules/civicrm/packages/DB/mysqli.php(403): DB_mysqli-&gt;mysqliRaiseError()
  #8 /www/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysqli-&gt;simpleQuery("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
  #9 /www/sites/all/modules/civicrm/packages/DB/DataObject.php(2445): DB_common-&gt;query("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
  #10 /www/sites/all/modules/civicrm/packages/DB/DataObject.php(1637): DB_DataObject-&gt;_query("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
  #11 /www/sites/all/modules/civicrm/CRM/Core/DAO.php(321): DB_DataObject-&gt;query("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
  #12 /www/sites/all/modules/civicrm/CRM/Core/DAO.php(1180): CRM_Core_DAO-&gt;query("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...", TRUE)
  #13 /www/sites/all/modules/civicrm/CRM/Core/BAO/ActionSchedule.php(1298): CRM_Core_DAO::executeQuery("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...", (Array:1))
  #14 /www/sites/all/modules/civicrm/CRM/Core/BAO/ActionSchedule.php(1477): CRM_Core_BAO_ActionSchedule::buildRecipientContacts(4, "20171107114502", (Array:2))
  #15 /www/sites/all/modules/civicrm/api/v3/Job.php(186): CRM_Core_BAO_ActionSchedule::processQueue(NULL, (Array:2))
  #16 /www/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_send_reminder((Array:1))
  #17 /www/sites/all/modules/civicrm/Civi/API/Kernel.php(96): Civi\API\Provider\MagicFunctionProvider-&gt;invoke((Array:9))
  #18 /www/sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel-&gt;run("Job", "send_reminder", (Array:1), NULL)
  #19 /www/sites/all/modules/civicrm/CRM/Core/JobManager.php(131): civicrm_api("Job", "send_reminder", (Array:1))
  #20 /www/sites/all/modules/civicrm/CRM/Core/JobManager.php(83): CRM_Core_JobManager-&gt;executeJob(Object(CRM_Core_ScheduledJob))
  #21 /www/sites/all/modules/civicrm/api/v3/Job.php(99): CRM_Core_JobManager-&gt;execute(FALSE)
  #22 /www/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_execute((Array:2))
  #23 /www/sites/all/modules/civicrm/Civi/API/Kernel.php(96): Civi\API\Provider\MagicFunctionProvider-&gt;invoke((Array:9))
  #24 /www/sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel-&gt;run("Job", "execute", (Array:2), NULL)
  #25 /www/sites/all/modules/civicrm/bin/cli.class.php(111): civicrm_api("Job", "execute", (Array:2))
  #26 /www/sites/all/modules/civicrm/bin/cli.php(32): civicrm_cli-&gt;callApi()
  #27 {main}
  </code></pre>
  
  <p>I appreciate any pointers.</p>
  
  <p>Thanks,
  Rachel</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-08T15:13:30.033Z
Comments.Text: Can you put define('CIVICRM_DEBUG_LOG_QUERY', 1); in your civicrm.settings.php to see the full query where it's failing? As described at https://docs.civicrm.org/dev/en/latest/tools/debugging/
Comments.UserDisplayName: Demerit
Tags: <api><scheduled-reminders><scheduled-job>
Title: Scheduled Job send_reminder failing with "No such field"
ThreadText: # Scheduled Job send_reminder failing with "No such field"
  
  (Asked by: username_0 on 2017-11-07)
  
  We're running Civi 4.6.16 and Drupal 7. Our schedule reminders are not sending when the job triggers, or manually through an API call. The backtrace isn't seeming that helpful, to me, but maybe it'll help someone else:
  
  ```
  Nov 07 11:30:02  [info] $backTrace = #
  0 /www/sites/all/modules/civicrm/CRM/Core/Error.php(897): CRM_Core_Error::backtrace("backTrace", TRUE)
  1 [internal function](): CRM_Core_Error::exceptionHandler(Object(DB_Error))
  2 /www/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
  3 /www/sites/all/modules/civicrm/packages/DB.php(976): PEAR_Error->PEAR_Error("DB Error: no such field", -19, 16, (Array:2), "\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
  4 /www/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-19, 16, (Array:2), "\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
  5 /www/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -19, NULL, NULL, "\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...", "DB_Error", TRUE)
  6 /www/sites/all/modules/civicrm/packages/DB/mysqli.php(929): DB_common->raiseError(-19, NULL, NULL, NULL, "1054 ** Unknown column 'Array' in 'where clause'")
  7 /www/sites/all/modules/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
  8 /www/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
  9 /www/sites/all/modules/civicrm/packages/DB/DataObject.php(2445): DB_common->query("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
  10 /www/sites/all/modules/civicrm/packages/DB/DataObject.php(1637): DB_DataObject->_query("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
  11 /www/sites/all/modules/civicrm/CRM/Core/DAO.php(321): DB_DataObject->query("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
  12 /www/sites/all/modules/civicrm/CRM/Core/DAO.php(1180): CRM_Core_DAO->query("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...", TRUE)
  13 /www/sites/all/modules/civicrm/CRM/Core/BAO/ActionSchedule.php(1298): CRM_Core_DAO::executeQuery("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...", (Array:1))
  14 /www/sites/all/modules/civicrm/CRM/Core/BAO/ActionSchedule.php(1477): CRM_Core_BAO_ActionSchedule::buildRecipientContacts(4, "20171107113002", (Array:2))
  15 /www/sites/all/modules/civicrm/api/v3/Job.php(186): CRM_Core_BAO_ActionSchedule::processQueue(NULL, (Array:2))
  16 /www/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_send_reminder((Array:1))
  17 /www/sites/all/modules/civicrm/Civi/API/Kernel.php(96): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
  18 /www/sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel->run("Job", "send_reminder", (Array:1), NULL)
  19 /www/sites/all/modules/civicrm/CRM/Core/JobManager.php(131): civicrm_api("Job", "send_reminder", (Array:1))
  20 /www/sites/all/modules/civicrm/CRM/Core/JobManager.php(83): CRM_Core_JobManager->executeJob(Object(CRM_Core_ScheduledJob))
  21 /www/sites/all/modules/civicrm/api/v3/Job.php(99): CRM_Core_JobManager->execute(FALSE)
  22 /www/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_execute((Array:2))
  23 /www/sites/all/modules/civicrm/Civi/API/Kernel.php(96): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
  24 /www/sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel->run("Job", "execute", (Array:2), NULL)
  25 /www/sites/all/modules/civicrm/bin/cli.class.php(111): civicrm_api("Job", "execute", (Array:2))
  26 /www/sites/all/modules/civicrm/bin/cli.php(32): civicrm_cli->callApi()
  27 {main}
  
  Nov 07 11:45:02  [info] $backTrace = #0 /www/sites/all/modules/civicrm/CRM/Core/Error.php(897): CRM_Core_Error::backtrace("backTrace", TRUE)
  #1 [internal function](): CRM_Core_Error::exceptionHandler(Object(DB_Error))
  #2 /www/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
  #3 /www/sites/all/modules/civicrm/packages/DB.php(976): PEAR_Error->PEAR_Error("DB Error: no such field", -19, 16, (Array:2), "\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
  #4 /www/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-19, 16, (Array:2), "\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
  #5 /www/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -19, NULL, NULL, "\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...", "DB_Error", TRUE)
  #6 /www/sites/all/modules/civicrm/packages/DB/mysqli.php(929): DB_common->raiseError(-19, NULL, NULL, NULL, "1054 ** Unknown column 'Array' in 'where clause'")
  #7 /www/sites/all/modules/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
  #8 /www/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
  #9 /www/sites/all/modules/civicrm/packages/DB/DataObject.php(2445): DB_common->query("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
  #10 /www/sites/all/modules/civicrm/packages/DB/DataObject.php(1637): DB_DataObject->_query("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
  #11 /www/sites/all/modules/civicrm/CRM/Core/DAO.php(321): DB_DataObject->query("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...")
  #12 /www/sites/all/modules/civicrm/CRM/Core/DAO.php(1180): CRM_Core_DAO->query("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...", TRUE)
  #13 /www/sites/all/modules/civicrm/CRM/Core/BAO/ActionSchedule.php(1298): CRM_Core_DAO::executeQuery("\nINSERT INTO civicrm_action_log (reference_date, contact_id, entity_id, enti...", (Array:1))
  #14 /www/sites/all/modules/civicrm/CRM/Core/BAO/ActionSchedule.php(1477): CRM_Core_BAO_ActionSchedule::buildRecipientContacts(4, "20171107114502", (Array:2))
  #15 /www/sites/all/modules/civicrm/api/v3/Job.php(186): CRM_Core_BAO_ActionSchedule::processQueue(NULL, (Array:2))
  #16 /www/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_send_reminder((Array:1))
  #17 /www/sites/all/modules/civicrm/Civi/API/Kernel.php(96): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
  #18 /www/sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel->run("Job", "send_reminder", (Array:1), NULL)
  #19 /www/sites/all/modules/civicrm/CRM/Core/JobManager.php(131): civicrm_api("Job", "send_reminder", (Array:1))
  #20 /www/sites/all/modules/civicrm/CRM/Core/JobManager.php(83): CRM_Core_JobManager->executeJob(Object(CRM_Core_ScheduledJob))
  #21 /www/sites/all/modules/civicrm/api/v3/Job.php(99): CRM_Core_JobManager->execute(FALSE)
  #22 /www/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_execute((Array:2))
  #23 /www/sites/all/modules/civicrm/Civi/API/Kernel.php(96): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
  #24 /www/sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel->run("Job", "execute", (Array:2), NULL)
  #25 /www/sites/all/modules/civicrm/bin/cli.class.php(111): civicrm_api("Job", "execute", (Array:2))
  #26 /www/sites/all/modules/civicrm/bin/cli.php(32): civicrm_cli->callApi()
  #27 {main}
  
  ```
  
  I appreciate any pointers.
  
  Thanks,
  username_0
  
  **Tags:** api, scheduled-reminders, scheduled-job
  
  > **Comments:**
  > **username_1**: Can you put define('CIVICRM_DEBUG_LOG_QUERY', 1); in your civicrm.settings.php to see the full query where it's failing? As described at https://docs.civicrm.org/dev/en/latest/tools/debugging/  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-12-20. Score: 1
  
  I completely forgot to come back to this. The issue turned out to be a scheduled reminder set to go to "membership", but with no membership option selected. The where claus was in fact getting an empty array.
  
  
  ---
  
  