Project

General

Profile

Bug #11188

on deleting a capsule: Operation FAILED: ERROR: update or delete on table "smart_proxies" violates foreign key constraint "hosts_puppet_ca_proxy_id_fk" on table "hosts"

Added by Ori Rabin about 4 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Authorization
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1207972
Description of problem:

On deleting capsule from webUI, following error raised:

--
Operation FAILED: ERROR: update or delete on table "smart_proxies" violates foreign key constraint "hosts_puppet_ca_proxy_id_fk" on table "hosts
--

production.log: ================

2015-04-01 12:14:37 [I] Processing by SmartProxiesController#index as HTML
2015-04-01 12:14:37 [I] Rendered smart_proxies/index.html.erb within layouts/application (25.1ms)
2015-04-01 12:14:37 [I] Rendered common/_searchbar.html.erb (3.7ms)
2015-04-01 12:14:37 [I] Rendered home/_submenu.html.erb (3.2ms)
2015-04-01 12:14:37 [I] Rendered home/_user_dropdown.html.erb (4.3ms)
2015-04-01 12:14:37 [I] Read fragment views/tabs_and_title_records-3 (0.1ms)
2015-04-01 12:14:37 [I] Rendered home/_organization_dropdown.html.erb (4.6ms)
2015-04-01 12:14:37 [I] Rendered home/_location_dropdown.html.erb (4.0ms)
2015-04-01 12:14:37 [I] Rendered home/_org_switcher.html.erb (9.2ms)
2015-04-01 12:14:37 [I] Rendered home/_submenu.html.erb (3.9ms)
2015-04-01 12:14:37 [I] Rendered home/_submenu.html.erb (4.6ms)
2015-04-01 12:14:37 [I] Rendered home/_submenu.html.erb (2.2ms)
2015-04-01 12:14:37 [I] Rendered home/_submenu.html.erb (4.8ms)
2015-04-01 12:14:37 [I] Rendered home/_submenu.html.erb (3.5ms)
2015-04-01 12:14:37 [I] Rendered home/_submenu.html.erb (3.0ms)
2015-04-01 12:14:37 [I] Rendered home/_submenu.html.erb (4.3ms)
2015-04-01 12:14:37 [I] Write fragment views/tabs_and_title_records-3 (0.9ms)
2015-04-01 12:14:37 [I] Rendered home/_topbar.html.erb (49.6ms)
2015-04-01 12:14:37 [I] Rendered layouts/base.html.erb (51.3ms)
2015-04-01 12:14:37 [I] Completed 200 OK in 112ms (Views: 79.8ms | ActiveRecord: 7.2ms)
2015-04-01 12:14:43 [I] Processing by SmartProxiesController#destroy as HTML
2015-04-01 12:14:43 [I] Parameters: {"authenticity_token"=>"TjhkdNY1w4fqkuiURUn+FDFi9IcuBdx8s4bL8cUrI+o=", "id"=>"2-dhcp207-72-lab-eng-pnq-redhat-com"}
2015-04-01 12:14:43 [W] Operation FAILED: ERROR: update or delete on table "smart_proxies" violates foreign key constraint "hosts_puppet_ca_proxy_id_fk" on table "hosts"
DETAIL: Key (id)=(2) is still referenced from table "hosts".

2015-04-01 12:14:43 [I] Rendered common/500.html.erb within layouts/application (5.6ms)
2015-04-01 12:14:43 [I] Rendered layouts/base.html.erb (1.4ms)
2015-04-01 12:14:43 [I] Completed 500 Internal Server Error in 79ms (Views: 9.5ms | ActiveRecord: 13.2ms)

Version-Release number of selected component (if applicable):
sat6.1 beta snap8
(Satellite-6.1.0-RHEL-7-20150324.0)

How reproducible:
always

Steps to Reproduce:
1.
2.
3.

Actual results:
Operation FAILED: ERROR: update or delete on table "smart_proxies" violates foreign key constraint "hosts_puppet_ca_proxy_id_fk" on table "hosts"
DETAIL: Key (id)=(2) is still referenced from table "hosts".

Expected results:
capsule should be removed.
Additional info:


Related issues

Related to Foreman - Bug #13515: Foreman exception triggered when editing a role filter or adding a new oneClosed2016-02-02

Associated revisions

Revision 08d4fc31 (diff)
Added by Ori Rabin almost 4 years ago

Fixes #11188 - EnsureNotUsedBy checks for unscoped associations before destroying

History

#1 Updated by Ori Rabin about 4 years ago

  • Status changed from New to Assigned
  • Assignee set to Ori Rabin

#2 Updated by The Foreman Bot about 4 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2570 added
  • Pull request deleted ()

#3 Updated by Dominic Cleal almost 4 years ago

  • Category set to Authorization
  • Legacy Backlogs Release (now unused) set to 63

#4 Updated by Ori Rabin almost 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#5 Updated by Dominic Cleal over 3 years ago

  • Related to Bug #13515: Foreman exception triggered when editing a role filter or adding a new one added

Also available in: Atom PDF