Bug #4416
500 FK error when deleting old image in compute resource
Description
After a compute resource is edited, or for some reason it no longer has an image, if Foreman had any images in the Compute Resource, deleting them will be impossible through the UI and will throw a 500 error.
Warning! Mysql2::Error: Cannot delete or update a parent row: a foreign key constraint fails (`foreman`.`hosts`, CONSTRAINT `hosts_image_id_fk` FOREIGN KEY (`image_id`) REFERENCES `images` (`id`)): DELETE FROM `images` WHERE `images`.`id` = 3
Related issues
Associated revisions
History
#1
Updated by Dominic Cleal about 8 years ago
- Has duplicate Bug #6281: Attempting to remove openstack compute resource gives FK error added
#2
Updated by Joseph Magen about 8 years ago
- Status changed from New to Assigned
- Assignee set to Joseph Magen
- Target version set to 1.8.1
https://github.com/theforeman/foreman/pull/1513, close manually after merge, since commit message is not #4416
#3
Updated by Dominic Cleal about 8 years ago
- Status changed from Assigned to Ready For Testing
- Legacy Backlogs Release (now unused) set to 18
#4
Updated by Joseph Magen about 8 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset e0d618efa6a8c02b46000bfcb9ded5eb672a6e13.
#5
Updated by Bryan Kearney about 8 years ago
- Bugzilla link set to 1114646
fixes #6216, #4416 - avoid foreign key errors when deleting some objects in use