CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • cron job returns db "error: syntax error"
Pages: [1]

Author Topic: cron job returns db "error: syntax error"  (Read 1624 times)

mithunmukherjee

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.4.5
  • CMS version: Wordpress 3.9.1
  • MySQL version: 5.3
  • PHP version: 5.5
cron job returns db "error: syntax error"
May 29, 2014, 11:35:06 am
I am running Wordpress 3.9.1 and CiviCRM 4.4.5.
Trying to set up my first automated report via cron to mail myself a contribution report every month.
Initially, I received a permissions error in the job log under Scheduled Jobs and after referring to this thread, I gave the Wordpress anonymous user access to CiviReport. This fixed the permissions problem but now I receive a db error. The "Mail reports" Scheduled Job uses api.job.mailReport. Any help is appreciated. Thank you.

Below is an extract from the "Scheduled Jobs Log"  under Administer -- System Settings -- Scheduled Jobs -- View Job Log.

Summary
Finished execution of Mail Reports with result: Failure, Error message: DB Error: syntax error
Details

Parameters raw (from db settings):
instanceId=38
format=print

Parameters parsed (and passed to API method):
a:3:{s:7:"version";i:3;s:10:"instanceId";s:2:"38";s:6:"format";s:5:"print";}

Full message:
Finished execution of Mail Reports with result: Failure, Error message: DB Error: syntax error


Below is an extract from the CiviCRM log file under wp-content/plugins/files/civicrm/ConfigAndLog that provides more detail on the error:

May 29 13:45:02  [info] $backTrace = #0 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(770): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::exceptionHandler(Object(DB_Error))
#2 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/packages/DB.php(969): PEAR_Error->PEAR_Error("DB Error: syntax error", -2, 16, (Array:2), "CREATE TEMPORARY TABLE civireport_contribution_detail_temp2 AS SELECT contact...")
#4 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-2, 16, (Array:2), "CREATE TEMPORARY TABLE civireport_contribution_detail_temp2 AS SELECT contact...")
#5 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -2, NULL, NULL, "CREATE TEMPORARY TABLE civireport_contribution_detail_temp2 AS SELECT contact...", "DB_Error", TRUE)
#6 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(898): DB_common->raiseError(-2, NULL, NULL, NULL, "1064 ** You have an error in your SQL syntax; check the manual that correspon...")
#7 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(327): DB_mysql->mysqlRaiseError()
#8 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("CREATE TEMPORARY TABLE civireport_contribution_detail_temp2 AS SELECT contact...")
#9 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2421): DB_common->query("CREATE TEMPORARY TABLE civireport_contribution_detail_temp2 AS SELECT contact...")
#10 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1613): DB_DataObject->_query("CREATE TEMPORARY TABLE civireport_contribution_detail_temp2 AS SELECT contact...")
#11 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(160): DB_DataObject->query("CREATE TEMPORARY TABLE civireport_contribution_detail_temp2 AS SELECT contact...")
#12 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(908): CRM_Core_DAO->query("CREATE TEMPORARY TABLE civireport_contribution_detail_temp2 AS SELECT contact...", TRUE)
#13 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/CRM/Report/Form/Contribute/Detail.php(605): CRM_Core_DAO::executeQuery("CREATE TEMPORARY TABLE civireport_contribution_detail_temp2 AS SELECT contact...")
#14 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/CRM/Report/Form.php(620): CRM_Report_Form_Contribute_Detail->postProcess()
#15 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/CRM/Report/Form/Contribute/Detail.php(386): CRM_Report_Form->preProcess()
#16 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(351): CRM_Report_Form_Contribute_Detail->preProcess()
#17 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Display.php(93): CRM_Core_Form->buildForm()
#18 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Report_Form_Contribute_Detail), "display")
#19 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Report_Form_Contribute_Detail), "display")
#20 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(339): HTML_QuickForm_Page->handle("display")
#21 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/Wrapper.php(117): CRM_Core_Controller->run()
#22 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/CRM/Report/Utils/Report.php(373): CRM_Utils_Wrapper->run("CRM_Report_Form_Contribute_Detail", NULL, (Array:2))
#23 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/api/v3/Job.php(236): CRM_Report_Utils_Report::processReport((Array:3))
#24 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/api/api.php(87): civicrm_api3_job_mail_report((Array:3))
#25 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php(132): civicrm_api("Job", "mail_report", (Array:3))
#26 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php(88): CRM_Core_JobManager->executeJob(Object(CRM_Core_ScheduledJob))
#27 /home/ashraya/www/www/wp-content/plugins/civicrm/civicrm/bin/cron.php(42): CRM_Core_JobManager->execute()
#28 {main}



« Last Edit: May 29, 2014, 11:50:51 am by mithunmukherjee »

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: cron job returns db "error: syntax error"
May 29, 2014, 12:10:25 pm
Does this error happen when you execute the job manually or via cron or both?
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

mithunmukherjee

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.4.5
  • CMS version: Wordpress 3.9.1
  • MySQL version: 5.3
  • PHP version: 5.5
Re: cron job returns db "error: syntax error"
May 29, 2014, 12:56:34 pm
cron only.
Job executes fine manually.

cron script is:

#!/bin/sh
GET 'http://ashraya.server271.com/wp-content/plugins/civicrm/civicrm/bin/cron.php?name=ZZZZZZ&pass=XXXXX&key=YYYYYY


(anonymized values for  name, pass and key).
« Last Edit: May 29, 2014, 01:19:11 pm by mithunmukherjee »

Ann

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 4.4
  • CMS version: Drupal
  • MySQL version: 5.6
  • PHP version: 5.5
Re: cron job returns db "error: syntax error"
June 08, 2014, 12:26:40 am
Look like the tutorial at https://www.easycron.com/tutorials/how-to-set-up-cron-job-for-civicrm

mithunmukherjee

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.4.5
  • CMS version: Wordpress 3.9.1
  • MySQL version: 5.3
  • PHP version: 5.5
Re: cron job returns db "error: syntax error"
June 11, 2014, 01:22:35 pm
Pretty sure the cron job is set up correctly. I ran it from the browser and it executed without errors.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: cron job returns db "error: syntax error"
June 11, 2014, 02:10:32 pm
Yes, the cron job for this site is correct and I can confirm that the error only occurs when cron runs.

mithunmukherjee, since we can't test cron the demo site, we can't confirm this bug. Therefore, you might want to go ahead and post a bug report via the Issues link at the top of this page.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

mithunmukherjee

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.4.5
  • CMS version: Wordpress 3.9.1
  • MySQL version: 5.3
  • PHP version: 5.5
Re: cron job returns db "error: syntax error"
June 11, 2014, 06:34:49 pm
Thanks Hershel.

Created the following issue/request in JIRA to track this "bug":
https://issues.civicrm.org/jira/browse/CRM-14845

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • cron job returns db "error: syntax error"

This forum was archived on 2017-11-26.