DB error when deleting a CiviRule
Aug 21 15:03:53 [info] $Fatal Error Details = Array ( [callback] => Array ( [0] => CRM_Core_Error [1] => handle )
[code] => -3
[message] => DB Error: constraint violation
[mode] => 16
[debug_info] => DELETE FROM civirule_rule WHERE ( civirule_rule.id = 1 ) [nativecode=1451 ** Cannot delete or update a parent row: a foreign key constraint fails (`civirules_civicrm`.`civirule_rule_action`, CONSTRAINT `fk_ra_rule` FOREIGN KEY (`rule_id`) REFERENCES `civirule_rule` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION)]
[type] => DB_Error
[user_info] => DELETE FROM civirule_rule WHERE ( civirule_rule.id = 1 ) [nativecode=1451 ** Cannot delete or update a parent row: a foreign key constraint fails (`civirules_civicrm`.`civirule_rule_action`, CONSTRAINT `fk_ra_rule` FOREIGN KEY (`rule_id`) REFERENCES `civirule_rule` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION)]
[to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="DELETE FROM civirule_rule WHERE ( civirule_rule.id = 1 ) [nativecode=1451 ** Cannot delete or update a parent row: a foreign key constraint fails (`civirules_civicrm`.`civirule_rule_action`, CONSTRAINT `fk_ra_rule` FOREIGN KEY (`rule_id`) REFERENCES `civirule_rule` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION)]"]
)
Aug 21 15:03:53 [info] $backTrace = #0 /var/www/html/civirulesdev/sites/all/modules/civicrm/CRM/Core/Error.php(236): CRM_Core_Error::backtrace("backTrace", TRUE) #1 (closed) /var/www/html/civirulesdev/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::handle(Object(DB_Error)) #2 (closed) /var/www/html/civirulesdev/sites/all/modules/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: constraint violation", -3, 16, (Array:2), "DELETE FROM civirule_rule WHERE ( civirule_rule.id = 1 ) [nativecode=1451 ...") #3 (closed) /var/www/html/civirulesdev/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-3, 16, (Array:2), "DELETE FROM civirule_rule WHERE ( civirule_rule.id = 1 ) [nativecode=1451 ...") #4 (closed) /var/www/html/civirulesdev/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -3, 16, (Array:2), "DELETE FROM civirule_rule WHERE ( civirule_rule.id = 1 ) [nativecode=1451 ...", "DB_Error", TRUE) #5 (closed) /var/www/html/civirulesdev/sites/all/modules/civicrm/packages/DB/common.php(1907): PEAR->__call("raiseError", (Array:7)) #6 (closed) /var/www/html/civirulesdev/sites/all/modules/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-3, NULL, NULL, "DELETE FROM civirule_rule WHERE ( civirule_rule.id = 1 ) [nativecode=1451 ...", "1451 ** Cannot delete or update a parent row: a foreign key constraint fails ...") #7 (closed) /var/www/html/civirulesdev/sites/all/modules/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError() #8 (closed) /var/www/html/civirulesdev/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("DELETE FROM civirule_rule WHERE ( civirule_rule.id = 1 ) ") #9 (closed) /var/www/html/civirulesdev/sites/all/modules/civicrm/packages/DB/DataObject.php(2415): DB_common->query("DELETE FROM civirule_rule WHERE ( civirule_rule.id = 1 ) ") #10 (closed) /var/www/html/civirulesdev/sites/all/modules/civicrm/packages/DB/DataObject.php(1429): DB_DataObject->_query("DELETE FROM civirule_rule WHERE ( civirule_rule.id = 1 ) ") #11 (closed) /var/www/html/civirulesdev/sites/all/modules/civicrm/CRM/Core/DAO.php(617): DB_DataObject->delete(FALSE) #12 (closed) /var/www/html/civirulesdev/sites/default/files/civicrm/ext/civirules/CRM/Civirules/BAO/Rule.php(110): CRM_Core_DAO->delete() #13 (closed) /var/www/html/civirulesdev/sites/default/files/civicrm/ext/civirules/CRM/Civirules/Form/RuleDelete.php(41): CRM_Civirules_BAO_Rule::deleteWithId("1") #14 (closed) /var/www/html/civirulesdev/sites/all/modules/civicrm/CRM/Core/Form.php(495): CRM_Civirules_Form_RuleDelete->postProcess() #15 (closed) /var/www/html/civirulesdev/sites/all/modules/civicrm/CRM/Core/StateMachine.php(160): CRM_Core_Form->mainProcess() #16 (closed) /var/www/html/civirulesdev/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine->perform(Object(CRM_Civirules_Form_RuleDelete), "next", "Next") #17 (closed) /var/www/html/civirulesdev/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Civirules_Form_RuleDelete), "next") #18 (closed) /var/www/html/civirulesdev/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Civirules_Form_RuleDelete), "next") #19 (closed) /var/www/html/civirulesdev/sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("next") #20 (closed) /var/www/html/civirulesdev/sites/all/modules/civicrm/CRM/Utils/Wrapper.php(114): CRM_Core_Controller->run() #21 (closed) /var/www/html/civirulesdev/sites/all/modules/civicrm/CRM/Core/Invoke.php(284): CRM_Utils_Wrapper->run("CRM_Civirules_Form_RuleDelete", "RuleDelete", (Array:0)) #22 (closed) /var/www/html/civirulesdev/sites/all/modules/civicrm/CRM/Core/Invoke.php(85): CRM_Core_Invoke::runItem((Array:13)) #23 (closed) /var/www/html/civirulesdev/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4)) #24 (closed) /var/www/html/civirulesdev/sites/all/modules/civicrm/drupal/civicrm.module(444): CRM_Core_Invoke::invoke((Array:4)) #25 (closed) /var/www/html/civirulesdev/includes/menu.inc(527): civicrm_invoke("civirule", "form", "ruledelete") #26 (closed) /var/www/html/civirulesdev/index.php(21): menu_execute_active_handler() #27 (closed) {main}