Project

General

Profile

Actions

Bug #3194

closed

Ugly errors when destroy actions are stopped by FKs

Added by Dominic Cleal over 10 years ago. Updated almost 10 years ago.

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

Description

Server errors aren't very helpful when an FK prevents a destroy:

PG::ForeignKeyViolation: ERROR:  update or delete on table "smart_proxies" violates foreign key constraint "subnets_dhcp_id_fk" on table "subnets" 
DETAIL:  Key (id)=(1) is still referenced from table "subnets".
: DELETE FROM "smart_proxies" WHERE "smart_proxies"."id" = $1
   (145.2ms)  ROLLBACK
Completed 500 Internal Server Error in 3385ms

Related issues 4 (0 open4 closed)

Related to Foreman - Feature #2400: Add foreign keys on database levelClosedJoseph Magen04/15/2013Actions
Related to Hammer CLI - Bug #4033: Need a clearer / user friendly message when deletion of smart proxy failsDuplicate01/16/2014Actions
Related to Foreman - Bug #4415: FK error when deleting a smart proxyDuplicate02/23/2014Actions
Is duplicate of Foreman - Bug #5788: before_destroy missing from EnsureNotUsedBy.new in SmartProxy modelClosedJoseph Magen05/19/2014Actions
Actions

Also available in: Atom PDF