Bug 1114646

Summary: 500 FK error when deleting old image in compute resource
Product: Red Hat Satellite Reporter: Bryan Kearney <bkearney>
Component: ProvisioningAssignee: jmagen <jmagen>
Status: CLOSED CURRENTRELEASE QA Contact: Corey Welton <cwelton>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.4CC: bbuckingham, cwelton, jmontleo
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/4416
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-11 12:21:05 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Bryan Kearney 2014-06-30 14:26:15 UTC
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.


<pre>
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

</pre>

Comment 1 Bryan Kearney 2014-06-30 14:26:17 UTC
Created from redmine issue http://projects.theforeman.org/issues/4416

Comment 2 Bryan Kearney 2014-06-30 14:26:22 UTC
Upstream bug assigned to jmagen

Comment 3 Bryan Kearney 2014-06-30 14:37:39 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/4416 has been closed

Comment 6 Corey Welton 2014-08-20 15:03:00 UTC
Verified in Satellite-6.0.4-RHEL-6-20140813.2 - resource can no longer be deleted if images are associated w it.

Comment 7 Bryan Kearney 2014-09-11 12:21:05 UTC
This was delivered with Satellite 6.0 which was released on 10 September 2014.