0

When initiating the Send Reminder job I am getting this error:

enter image description here

I have similar issues showing up in System Status

enter image description here

How can I find out what is causing the violation?

1
  • via cv got this "error_code": -3, "debug_info": "INSERT INTO civicrm_activity_contact (activity_id , contact_id , record_type_id ) VALUES ( 202280 , 2067 , 2 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (hetclub_prod.civicrm_activity_contact, CONSTRAINT FK_civicrm_activity_contact_activity_id FOREIGN KEY (activity_id) REFERENCES civicrm_activity_fudge (id) ON DELETE CASCADE)]", "entity": "Job", "action": "send_reminder", "is_error": 1, "error_message": "DB Error: constraint violation" } Nov 28, 2023 at 10:40

2 Answers 2

1

Run below query

ALTER TABLE civicrm_activity_contact DROP FOREIGN KEY FK_civicrm_activity_contact_activity_id;

ALTER TABLE civicrm_activity_contact 
ADD CONSTRAINT `FK_civicrm_activity_contact_activity_id` FOREIGN KEY (`activity_id`) REFERENCES `civicrm_activity` (`id`) ON DELETE CASCADE;

Note: Take db backup before running query

1
  • Pradeep , you are a saviour sir. That has sorted my issue , thank you very much indeed for this Nov 28, 2023 at 13:56
2

This civicrm_activity_fudge foreign key reference doesn't seem to be a part of the default civicrm_activity_contact table structure, you may want to check why it is there and, depending on your circumstances, fix it or remove it from the table. Please do not forget to backup the whole database before making changes.

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.