Bug #4379
closedForeign key constraint error on deleting a class
Description
On deleting a class interface availible via the drop down menu on the nav bar the system bombs out with the following:
Warning!
ERROR: update or delete on table "puppetclasses" violates foreign key constraint "environment_classes_puppetclass_id_fk" on table "environment_classes" DETAIL: Key (id)=(8) is still referenced from table "environment_classes".
Stack Trace:
PGError
ERROR: update or delete on table "puppetclasses" violates foreign key constraint "environment_classes_puppetclass_id_fk" on table "environment_classes" DETAIL: Key (id)=(8) is still referenced from table "environment_classes".
app/controllers/puppetclasses_controller.rb:42:in `destroy'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call'
Files
Updated by Bryce Camp almost 11 years ago
I am experiencing the same issue
Updated by Marek Hulán over 10 years ago
- Has duplicate Bug #5225: Deleting a puppet-class: Mysql2::Error: Cannot delete or update a parent row: a foreign key constraint fails added
Updated by Dominic Cleal over 10 years ago
- Has duplicate Bug #5213: Error during delete a puppet class added
Updated by Dominic Cleal over 10 years ago
- Has duplicate Bug #6045: deleting a class fails added
Updated by Yama Kasi over 10 years ago
I'm also facing this problem.
Even removing the Puppet module doesn't fix this at the moment. I'm stuck with some classes that are not there but FM thinks they are (in use).
Any ideas ?
Updated by Yama Kasi over 10 years ago
OK, update... fixed. It seems that Foreman is importing "conflicting" classes form other modules with the same name (as you copy them over and edit them half)
Updated by Jem Sebban over 10 years ago
Hello,
I'm also running Centos 6.5 and have a similar issue while trying to delete classes from foreman web UI.
Puppet version is latest from puppetlabs repo - 3.6.2-1
Foreman version is 1.5.2-1, also current.
Only "exotic" aspect of my setup is I recently updated puppet from 2.7.x (EPEL) to 3.6.x (puppetlabs)
What kind of update did fix this for you Yama Kasi ? Is the UI delete button now working as expected ?
I was able to delete classes by manually removing them form their environment directory but I would like to be able to do that from the UI to ease collaboration with my colleagues.
Updated by Anonymous over 10 years ago
- Has duplicate Bug #7255: unable to delete puppet class added
Updated by Tom Caspy almost 10 years ago
this is quite odd, as the relation has dependent: true on it. How can we reproduce this?