1

I have had and solved an error before where MySQL reports "Can't update table 'civicrm_contact' in stored function/trigger because it is already used by statement which invoked this stored function/trigger". However, in those cases the error was for all transactions. I am getting the same error in my logs but only for some contacts and not others.

I am now seeing the problem when a new new contribution is made by a user of the website for a membership. These users do not have CiivCRM or Drupal admin rights.

I have tried to analyze what is different between contacts that manifest the problem and those that do not. I cannot find a trend. Other contacts that were imported at the time can have donations applied to them, there is no changed based on Financial Types or Payment Method.

The complete error message coming from the log file in ConfigandLog looks like this:

db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="INSERT INTO civicrm_contribution (contact_id , financial_type_id , payment_instrument_id , receive_date , non_deductible_amount , total_amount , fee_amount , net_amount , trxn_id , invoice_number , currency , cancel_date , cancel_reason , receipt_date , thankyou_date , source , amount_level , is_pay_later , contribution_status_id , check_number , campaign_id , tax_amount ) VALUES ( 84941 , 4 , 7 , 20230108161500 , 1 , 1 , 0 , 1 , NULL , 'INV_116130' , 'USD' , NULL , NULL , NULL , NULL , 'This is a test' , 'Contribution Amount - 1' , 0 , 1 , NULL , NULL , 0 ) [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.]"

I have rebuilt the triggers, deleted the triggers and added them back, and upgragraed CiviCRM to 5.56.2.

The database for Drupal and CiviCRM are hosting on Amazon Aurora (MySQL). I have turned on audit logs and do not see anything in the logs that help understand this issue.

Any help with figuring this out is greatly appreciated.

Thanks!

4
  • Do you have logging enabled? If so, try disabling and re-enabling that. Logging uses triggers.
    – Aidan
    Commented Jan 10, 2023 at 14:03
  • @Aidan, thank you for the idea. We are not using logging because we are in a multilingual environment. Thanks! Commented Jan 15, 2023 at 18:16
  • Ah! It's always worth mentioning that you are running mutlilingual. That makes various changes to the database schema etc and has various unique 'features'! I don't use that but I think it has some things implemented with triggers. I'd suggest updating the question to include this information in case readers don't get as far as these comments.
    – Aidan
    Commented Jan 16, 2023 at 14:17
  • barely related, but i spotted on chat a discussion about bgm having a solution for logging on multilanguage sites
    – petednz - fuzion
    Commented Jan 18, 2023 at 1:45

0

Your Answer

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

Browse other questions tagged or ask your own question.