Project

General

Profile

Actions

Bug #4379

closed

Foreign key constraint error on deleting a class

Added by Ollie Lawson about 10 years ago. Updated almost 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Database
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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

Capture.PNG View Capture.PNG 30.3 KB Ollie Lawson, 02/18/2014 03:00 PM
foreman_class_removal_error.jpg View foreman_class_removal_error.jpg 138 KB Bryce Camp, 02/21/2014 04:53 PM

Related issues 4 (0 open4 closed)

Has duplicate Foreman - Bug #5225: Deleting a puppet-class: Mysql2::Error: Cannot delete or update a parent row: a foreign key constraint failsDuplicate04/17/2014Actions
Has duplicate Foreman - Bug #5213: Error during delete a puppet classDuplicate04/16/2014Actions
Has duplicate Foreman - Bug #6045: deleting a class failsDuplicate06/03/2014Actions
Has duplicate Foreman - Bug #7255: unable to delete puppet classDuplicate08/25/2014Actions
Actions #1

Updated by Bryce Camp about 10 years ago

I am experiencing the same issue

Actions #2

Updated by Dominic Cleal about 10 years ago

  • Category set to Database
Actions #3

Updated by Marek Hulán about 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
Actions #4

Updated by Dominic Cleal almost 10 years ago

  • Has duplicate Bug #5213: Error during delete a puppet class added
Actions #5

Updated by Eric Goedtel almost 10 years ago

Its not explicitly stated here but you can work around this by removing the module from the applicable environment directory on the puppet master Foreman is interacting with.

Actions #6

Updated by Dominic Cleal almost 10 years ago

  • Has duplicate Bug #6045: deleting a class fails added
Actions #7

Updated by Yama Kasi over 9 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 ?

Actions #8

Updated by Yama Kasi over 9 years ago

I'm on 1.5.2 at the moment.

Actions #9

Updated by Yama Kasi over 9 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)

Actions #10

Updated by Jem Sebban over 9 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.

Actions #11

Updated by Anonymous over 9 years ago

  • Has duplicate Bug #7255: unable to delete puppet class added
Actions #12

Updated by Dominic Cleal over 9 years ago

  • Bugzilla link set to 1147379
Actions #13

Updated by Tom Caspy about 9 years ago

this is quite odd, as the relation has dependent: true on it. How can we reproduce this?

Actions #14

Updated by Anonymous almost 7 years ago

  • Status changed from New to Resolved

the linked BZ got closed

Actions

Also available in: Atom PDF