Database Error Code: Cannot add or update a child row: a foreign key constraint fails (
earthcha_civicrmxxx_civicrm
.civicrm_group_contact
, CONSTRAINTFK_civicrm_group_contact_group_id
FOREIGN KEY (group_id
) REFERENCEScivicrm_group
(id
) ON DELETE CASCADE), 1452 Additional Details: Array ( [callback] => Array ( [0] => CRM_Core_Error [1] => handle )[code] => -3 [message] => DB Error: constraint violation [mode] => 16 [debug_info] => REPLACE INTO civicrm_group_contact ( group_id, contact_id, status ) VALUES ( 58, 2346, 'Added' ) [nativecode=1452 **
Cannot add or update a child row: a foreign key constraint fails (
earthcha_civicrm
.civicrm_group_contact
, CONSTRAINTFK_civicrm_group_contact_group_id
FOREIGN KEY (group_id
) REFERENCEScivicrm_group
(id
) ON DELETE CASCADE)] [type] => DB_Error [user_info] => REPLACE INTO civicrm_group_contact ( group_id, contact_id, status ) VALUES ( 58, 2346, 'Added' ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (earthcha_civicrm
.civicrm_group_contact
, CONSTRAINTFK_civicrm_group_contact_group_id
FOREIGN KEY (group_id
) REFERENCEScivicrm_group
(id
) ON DELETE CASCADE)] [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info=" REPLACE INTO civicrm_group_contact ( group_id, contact_id, status ) VALUES ( 58, 2346, 'Added' ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (earthcha_civicrm
.civicrm_group_contact
, CONSTRAINTFK_civicrm_group_contact_group_id
FOREIGN KEY (group_id
) REFERENCEScivicrm_group
(id
) ON DELETE CASCADE)]"] )
Here is the back trace:
public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(182): CRM_Core_Error::backtrace() #1 internal function: CRM_Core_Error::handle(Object(DB_Error)) #2 /home/earthcha/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error)) #3 /home/earthcha/public_html/wp-content/plugins/civicrm/civicrm/packages/DB.php(976): PEAR_Error->PEAR_Error("DB Error: constraint violation", -3, 16, (Array:2), "\nREPLACE INTO civicrm_group_contact ( group_id, contact_id, status )\nVALUES...") #4 /home/earthcha/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-3, 16, (Array:2), "\nREPLACE INTO civicrm_group_contact ( group_id, contact_id, status )\nVALUES...") #5 /home/earthcha/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -3, NULL, NULL, "\nREPLACE INTO civicrm_group_contact ( group_id, contact_id, status )\nVALUES...", "DB_Error", TRUE) #6 /home/earthcha/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(895): DB_common->raiseError(-3, NULL, NULL, NULL, "1452 ** Cannot add or update a child row: a foreign key constraint fails (`ea...") #7 /home/earthcha/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError() #8 /home/earthcha/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("\nREPLACE INTO civicrm_group_contact ( group_id, contact_id, status )\nVALUES...") #9 /home/earthcha/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2438): DB_common->query("\nREPLACE INTO civicrm_group_contact ( group_id, contact_id, status )\nVALUES...") #10 /home/earthcha/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1627): DB_DataObject->_query("\nREPLACE INTO civicrm_group_contact ( group_id, contact_id, status )\nVALUES...") #11 /home/earthcha/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(344): DB_DataObject->query("\nREPLACE INTO civicrm_group_contact ( group_id, contact_id, status )\nVALUES...") #12 /home/earthcha/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1278): CRM_Core_DAO->query("\nREPLACE INTO civicrm_group_contact ( group_id, contact_id, status )\nVALUES...", TRUE) #13 /home/earthcha/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/GroupContact.php(779): CRM_Core_DAO::executeQuery("\nREPLACE INTO civicrm_group_contact ( group_id, contact_id, status )\nVALUES...") #14 /home/earthcha/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/GroupContact.php(141): CRM_Contact_BAO_GroupContact::bulkAddContactsToGroup((Array:1), 58, "Admin", "Added", NULL) #15 /home/earthcha/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Contact.php(339): CRM_Contact_BAO_GroupContact::addContactsToGroup((Array:1), 58) #16 /home/earthcha/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/Form/Contact.php(993): CRM_Contact_BAO_Contact::create((Array:36), TRUE, FALSE, TRUE) #17 /home/earthcha/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(423): CRM_Contact_Form_Contact->postProcess() #18 /home/earthcha/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Upload.php(166): CRM_Core_Form->mainProcess() #19 /home/earthcha/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Upload.php(133): CRM_Core_QuickForm_Action_Upload->realPerform(Object(CRM_Contact_Form_Contact), "upload") #20 /home/earthcha/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Upload->perform(Object(CRM_Contact_Form_Contact), "upload") #21 /home/earthcha/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contact_Form_Contact), "upload") #22 /home/earthcha/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("upload") #23 /home/earthcha/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Wrapper.php(113): CRM_Core_Controller->run() #24 /home/earthcha/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(286): CRM_Utils_Wrapper->run("CRM_Contact_Form_Contact", "New Contact", (Array:1)) #25 /home/earthcha/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:13)) #26 /home/earthcha/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3)) #27 /home/earthcha/public_html/wp-content/plugins/civicrm/civicrm.php(1227): CRM_Core_Invoke::invoke((Array:3)) #28 internal function: CiviCRM_For_WordPress->invoke("") #29 /home/earthcha/public_html/wp-includes/plugin.php(525): call_user_func_array((Array:2), (Array:1)) #30 /home/earthcha/public_html/wp-admin/admin.php(236): do_action("toplevel_page_CiviCRM")