2

I decided to remove Civivolunteer. Administer > System Settings > Extensions. I disabled Civivolunteer and then Uninstall. Error message: "DB Error: constraint violation" The Civivolunteer extension cannot be enabled or uninstalled. What can I do?

Here is a paste of PART of the log where the error occurs

Aug 28 15:29:07 [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 `civicrm_uf_group` WHERE `name` = 'volunteer_sign_up' [nativecode=1451 ** Cannot delete or update a parent row: a foreign key constraint fails (`willycg_civicrm`.`civicrm_uf_join`, CONSTRAINT `FK_civicrm_uf_join_uf_group_id` FOREIGN KEY (`uf_group_id`) REFERENCES `civicrm_uf_group` (`id`))]
[type] => DB_Error
[user_info] => DELETE FROM `civicrm_uf_group` WHERE `name` = 'volunteer_sign_up' [nativecode=1451 ** Cannot delete or update a parent row: a foreign key constraint fails (`willycg_civicrm`.`civicrm_uf_join`, CONSTRAINT `FK_civicrm_uf_join_uf_group_id` FOREIGN KEY (`uf_group_id`) REFERENCES `civicrm_uf_group` (`id`))]
[to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="DELETE FROM `civicrm_uf_group` WHERE `name` = 'volunteer_sign_up' [nativecode=1451 ** Cannot delete or update a parent row: a foreign key constraint fails (`willycg_civicrm`.`civicrm_uf_join`, CONSTRAINT `FK_civicrm_uf_join_uf_group_id` FOREIGN KEY (`uf_group_id`) REFERENCES `civicrm_uf_group` (`id`))]"]

)

  • Can you check civicrm logs and paste the error message here? – jitendra - fuzion Aug 29 '19 at 12:43
  • 1
    Can you try deleting the volunteer sign up profile (under administer - customize... - profiles - reserved tab) manually first? – Demerit Aug 29 '19 at 23:12
  • I have added part of the error log. Should I still delete the volunteer sign up profile and try to uninstall again? – Hock Aug 29 '19 at 23:18
  • Yes the log is what made me suggest it because it mentions the profile. – Demerit Aug 29 '19 at 23:55
  • It does not give a delete option through the menus. However it does say that it is used for "CiviEvent, CiviEvent_Additional" and no mention of civivolunteer. – Hock Aug 30 '19 at 4:55
3

I had an identical experience, here's how I fixed it.

Following @Demerit's clue:

  1. Using sql:

    update civicrm_uf_group set is_reserved = 0 where name = 'volunteer_sign_up'

  2. Now remove the profile (previously, you couldn't via the web interface).

Re-do the uninstall, it now succeeds.

As per the note in the uninstall.sql file, the uninstall process is trying to use a foreign key to remove the profile indirectly, but it's failing. I suspect that profiles got more complicated and this strategy no longer works? Alternatively, perhaps when an early version of the extension gets installed it's subtly different?

Also note that this is actually the last line of the uninstall, so it mostly does uninstall.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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