2

I am getting the following error on screen when trying to save a membership with a contribution after upgrading to 5.13.4.

We had this problem with all contributions at first but that appears to have resolved itself.

Fatal error: Uncaught CRM_Core_Exception: [0: Transaction integrity error: Expected to find active frame thrown in /home/customer/public_html/sites/all/modules/civicrm/Civi/Core/Transaction/Manager.php on line 107

When looking in the logs I see the full backtrace before that this is listed as the [to_string].

nativecode=1442 **Can't update table 'civicrm_contact' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.

Here is the backtrace:

#1 /home/customer/public_html/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::handle(Object(DB_Error))
#2 /home/customer/public_html/sites/all/modules/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: unknown error", -1, 16, (Array:2), "INSERT INTO civicrm_contribution (contact_id , financial_type_id , contributi...")
#3 /home/customer/public_html/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-1, 16, (Array:2), "INSERT INTO civicrm_contribution (contact_id , financial_type_id , contributi...")
#4 /home/customer/public_html/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -1, 16, (Array:2), "INSERT INTO civicrm_contribution (contact_id , financial_type_id , contributi...", "DB_Error", TRUE)
#5 /home/customer/public_html/sites/all/modules/civicrm/packages/DB/common.php(1907): PEAR->__call("raiseError", (Array:7))
#6 /home/customer/public_html/sites/all/modules/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-1, NULL, NULL, "INSERT INTO civicrm_contribution (contact_id , financial_type_id , contributi...", "1442 ** Can't update table'civicrm_contact' in stored function/trigger becau...")
#7 /home/customer/public_html/sites/all/modules/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#8 /home/customer/public_html/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("INSERT INTO civicrm_contribution (contact_id , financial_type_id , contributi...")
#9 /home/customer/public_html/sites/all/modules/civicrm/packages/DB/DataObject.php(2415): DB_common->query("INSERT INTO civicrm_contribution (contact_id , financial_type_id , contributi...")
#10 /home/customer/public_html/sites/all/modules/civicrm/packages/DB/DataObject.php(1040): DB_DataObject->_query("INSERT INTO civicrm_contribution (contact_id , financial_type_id , contributi...")
#11 /home/customer/public_html/sites/all/modules/civicrm/CRM/Core/DAO.php(572): DB_DataObject->insert()
#12 /home/customer/public_html/sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php(231): CRM_Core_DAO->save()
#13 /home/customer/public_html/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(957): CRM_Contribute_BAO_Contribution::add((Array:30))
#14 /home/customer/public_html/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(1771): CRM_Contribute_Form_Contribution_Confirm::processFormContribution(Object(CRM_Contribute_Form_Contribution_Confirm), (Array:66),(Array:62), (Array:30), Object(CRM_Financial_DAO_FinancialType), TRUE, 5, NULL)
#15 /home/customer/public_html/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(1487): CRM_Contribute_Form_Contribution_Confirm->processSecondaryFinancialTransaction("69090",Object(CRM_Contribute_Form_Contribution_Confirm), (Array:62), FALSE, (Array:1), "1.000000000", "2")
#16 /home/customer/public_html/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(1392): CRM_Contribute_Form_Contribution_Confirm->postProcessMembership((Array:60), "69090",Object(CRM_Contribute_Form_Contribution_Confirm), (Array:52), (Array:0), (Array:0), (Array:13), (Array:1), FALSE, NULL, TRUE, "2", (Array:1), FALSE)
#17 /home/customer/public_html/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(2415): CRM_Contribute_Form_Contribution_Confirm->processMembership((Array:60), "69090", (Array:0), (Array:0), (Array:52), (Array:1))
#18 /home/customer/public_html/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(2290): CRM_Contribute_Form_Contribution_Confirm->doMembershipProcessing("69090", (Array:60), (Array:52), (Array:1))
#19 /home/customer/public_html/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(709): CRM_Contribute_Form_Contribution_Confirm->processFormSubmission("69090")
#20 /home/customer/public_html/sites/all/modules/civicrm/CRM/Core/Form.php(490): CRM_Contribute_Form_Contribution_Confirm->postProcess()
#21 /home/customer/public_html/sites/all/modules/civicrm/CRM/Core/StateMachine.php(160): CRM_Core_Form->mainProcess()
#22 /home/customer/public_html/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine->perform(Object(CRM_Contribute_Form_Contribution_Confirm), "next", "Next")
#23 /home/customer/public_html/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Contribute_Form_Contribution_Confirm), "next")
#24 /home/customer/public_html/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contribute_Form_Contribution_Confirm), "next")
#25 /home/customer/public_html/sites/all/modules/civicrm/CRM/Core/Controller.php(349): HTML_QuickForm_Page->handle("next")
#26 /home/customer/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(311): CRM_Core_Controller->run((Array:3), NULL)
#27 /home/customer/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(85): CRM_Core_Invoke::runItem((Array:15))
#28 /home/customer/public_html/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#29 /home/customer/public_html/sites/all/modules/civicrm/drupal/civicrm.module(444): CRM_Core_Invoke::invoke((Array:3))
#30 /home/customer/public_html/includes/menu.inc(527): civicrm_invoke("contribute", "transact")
#31 /home/customer/public_html/index.php(21): menu_execute_active_handler()
#32 {main}

There was a similar issue that was resolved for version 4.4.2 - https://issues.civicrm.org/jira/browse/CRM-13587.

I tested the site without our custom extensions enabled and they do not impact the problem. The following extensions are enabled.

  • Birthday Report
  • CiviDiscount
  • Extended Report
  • Summary Fields
  • Report Error

Any help or ideas is greatly appreciated.

Thanks, Steve

7
  • are you able to replicate this on eg demo.dmaster.civicrm.org as this would help confirm if this is a global issue or one particular to your set up. also do you have any extensions etc which may be affecting this feature?
    – petednz - fuzion
    Commented May 22, 2019 at 3:40
  • I could not reproduce this in dmaster. I did add list of the extensions we have enabled in the post. I tired to do the same transactions and they cannot be made with or without our custom extensions enabled. Thank you! Commented May 22, 2019 at 4:46
  • so even with all Extensions disabled, c_templates cleared etc etc you still cannot save a Contribution?
    – petednz - fuzion
    Commented May 22, 2019 at 7:58
  • I just checked one more time with deleting templates_c and we can save contributions but not memberships that have contributions. Commented May 22, 2019 at 16:48
  • sounding weirder. are you certain you aren't flipping between www and no www etc
    – petednz - fuzion
    Commented May 22, 2019 at 19:53

1 Answer 1

4

After reading many posts and looking through the ideas I got here I deleted the triggers for the contributions table and rebuilt the triggers (https://docs.civicrm.org/sysadmin/en/latest/troubleshooting/#trigger-rebuild) for the table. This appears to have worked like a charm.

-Steve

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.