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 »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Mail summary report error
Pages: [1]

Author Topic: Mail summary report error  (Read 748 times)

robinhood

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 6
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.56
  • PHP version: 5.3.5
Mail summary report error
January 04, 2015, 05:19:39 pm
The mail summary report is now producing an error, whereas until recently it was fine.  The error is copied below. Any theories?

Quote
Sorry but we are not able to provide this at the moment.
DB Error: constraint violation

Return to home page.



Jan 04 14:00:08  [info] $backTrace = #0 /home/user/web/sites/all/modules/civicrm/CRM/Core/Error.php(239): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2 /home/user/web/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 /home/user/web/sites/all/modules/civicrm/packages/DB.php(975): PEAR_Error->PEAR_Error("DB Error: constraint violation", -3, 16, (Array:2), "\n                  INSERT INTO civicrm_dashboard_contact ( dashboard_id, con...")
#4 /home/user/web/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-3, 16, (Array:2), "\n                  INSERT INTO civicrm_dashboard_contact ( dashboard_id, con...")
#5 /home/user/web/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -3, NULL, NULL, "\n                  INSERT INTO civicrm_dashboard_contact ( dashboard_id, con...", "DB_Error", TRUE)
#6 /home/user/web/sites/all/modules/civicrm/packages/DB/mysqli.php(929): DB_common->raiseError(-3, NULL, NULL, NULL, "1452 ** Cannot add or update a child row: a foreign key constraint fails (`yf...")
#7 /home/user/web/sites/all/modules/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#8 /home/user/web/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("\n                  INSERT INTO civicrm_dashboard_contact ( dashboard_id, con...")
#9 /home/user/web/sites/all/modules/civicrm/packages/DB/DataObject.php(2442): DB_common->query("\n                  INSERT INTO civicrm_dashboard_contact ( dashboard_id, con...")
#10 /home/user/web/sites/all/modules/civicrm/packages/DB/DataObject.php(1634): DB_DataObject->_query("\n                  INSERT INTO civicrm_dashboard_contact ( dashboard_id, con...")
#11 /home/user/web/sites/all/modules/civicrm/CRM/Core/DAO.php(325): DB_DataObject->query("\n                  INSERT INTO civicrm_dashboard_contact ( dashboard_id, con...")
#12 /home/user/web/sites/all/modules/civicrm/CRM/Core/DAO.php(1116): CRM_Core_DAO->query("\n                  INSERT INTO civicrm_dashboard_contact ( dashboard_id, con...", TRUE)
#13 /home/user/web/sites/all/modules/civicrm/CRM/Core/BAO/Dashboard.php(516): CRM_Core_DAO::executeQuery("\n                  INSERT INTO civicrm_dashboard_contact ( dashboard_id, con...")
#14 /home/user/web/sites/all/modules/civicrm/CRM/Core/BAO/Dashboard.php(450): CRM_Core_BAO_Dashboard::addContactDashlet(Object(CRM_Core_DAO_Dashboard))
#15 /home/user/web/sites/all/modules/civicrm/CRM/Report/BAO/ReportInstance.php(220): CRM_Core_BAO_Dashboard::addDashlet((Array:7))
#16 /home/user/web/sites/all/modules/civicrm/CRM/Report/Form/Instance.php(307): CRM_Report_BAO_ReportInstance::create((Array:37))
#17 /home/user/web/sites/all/modules/civicrm/CRM/Report/Form.php(2799): CRM_Report_Form_Instance::postProcess(Object(CRM_Report_Form_Mailing_Summary))
#18 /home/user/web/sites/all/modules/civicrm/CRM/Report/Form/Mailing/Summary.php(442): CRM_Report_Form->endPostProcess((Array:0))
#19 /home/user/web/sites/all/modules/civicrm/CRM/Core/Form.php(328): CRM_Report_Form_Mailing_Summary->postProcess()
#20 /home/user/web/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Submit.php(73): CRM_Core_Form->mainProcess()
#21 /home/user/web/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Submit->perform(Object(CRM_Report_Form_Mailing_Summary), "submit")
#22 /home/user/web/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Report_Form_Mailing_Summary), "submit")
#23 /home/user/web/sites/all/modules/civicrm/CRM/Core/Controller.php(356): HTML_QuickForm_Page->handle("submit")
#24 /home/user/web/sites/all/modules/civicrm/CRM/Utils/Wrapper.php(117): CRM_Core_Controller->run()
#25 /home/user/web/sites/all/modules/civicrm/CRM/Report/Page/Instance.php(103): CRM_Utils_Wrapper->run("CRM_Report_Form_Mailing_Summary", NULL, NULL)
#26 /home/user/web/sites/all/modules/civicrm/CRM/Core/Invoke.php(331): CRM_Report_Page_Instance->run((Array:4), NULL)
#27 /home/user/web/sites/all/modules/civicrm/CRM/Core/Invoke.php(75): CRM_Core_Invoke::runItem((Array:14))
#28 /home/user/web/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4))
#29 /home/user/web/sites/all/modules/civicrm/drupal/civicrm.module(457): CRM_Core_Invoke::invoke((Array:4))
#30 [internal function](): civicrm_invoke("report", "instance", "26")
#31 /home/user/web/includes/menu.inc(517): call_user_func_array("civicrm_invoke", (Array:3))
#32 /home/user/web/index.php(21): menu_execute_active_handler()
#33 {main}

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Mail summary report error
January 05, 2015, 09:10:40 am

can you check your CiviCRM.*.log files to see which constraint is being violated. I suspect the contact id constraint, but you might want to double check and make sure

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

robinhood

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 6
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.56
  • PHP version: 5.3.5
Re: Mail summary report error
January 05, 2015, 05:27:28 pm
Yes it is a contact_id in the civicrm_dashboard_contact table.  And indeed, when the "available for dashboard" setting is turned off, then the report works.  I don't understand how this data can get scrambled as it seems pretty straightforward.    ???

Quote
Jan 04 14:00:08  [info] $Fatal Error Details = Array
(
    [callback] => Array
        (
           
  • => CRM_Core_Error
  • [1] => handle
            )
       
[code ] => -3
    [message] => DB Error: constraint violation
    [mode] => 16
    [debug_info] =>
                  INSERT INTO civicrm_dashboard_contact ( dashboard_id, contact_id )
                  VALUES  ( 7, 104 ), ( 7, 5022 ), ( 7, 5487 ), ( 7, 7006 ), ( 7, 7610 ), ( 7, 8708 ), ( 7, 9122 ), ( 7, 10599 ), ( 7, 11268 ), ( 7, 11321 ), ( 7, 12123 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`website`.`civicrm_dashboard_contact`, CONSTRAINT `FK_civicrm_dashboard_contact_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
    [type] => DB_Error
    [user_info] =>
                  INSERT INTO civicrm_dashboard_contact ( dashboard_id, contact_id )
                  VALUES  ( 7, 104 ), ( 7, 5022 ), ( 7, 5487 ), ( 7, 7006 ), ( 7, 7610 ), ( 7, 8708 ), ( 7, 9122 ), ( 7, 10599 ), ( 7, 11268 ), ( 7, 11321 ), ( 7, 12123 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`website`.`civicrm_dashboard_contact`, CONSTRAINT `FK_civicrm_dashboard_contact_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
    [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="
                  INSERT INTO civicrm_dashboard_contact ( dashboard_id, contact_id )
                  VALUES  ( 7, 104 ), ( 7, 5022 ), ( 7, 5487 ), ( 7, 7006 ), ( 7, 7610 ), ( 7, 8708 ), ( 7, 9122 ), ( 7, 10599 ), ( 7, 11268 ), ( 7, 11321 ), ( 7, 12123 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`website`.`civicrm_dashboard_contact`, CONSTRAINT `FK_civicrm_dashboard_contact_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]"]
)

robinhood

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 6
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.56
  • PHP version: 5.3.5
Re: Mail summary report error
January 10, 2015, 09:01:51 am
I spent a while poking at this but have not been able to find the cause.  With the "available for dashboard" setting, the report tries to insert records with deleted contact_ids into the dashboard_contact table. 

robinhood

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 6
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.56
  • PHP version: 5.3.5
Re: Mail summary report error
January 15, 2015, 04:38:26 am
And, I tried out the mailing summary report on the demo site - it works.  Any suggestions about how to resolve this?


Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Mail summary report error

This forum was archived on 2017-11-26.