Project

General

Profile

Bug #4416

500 FK error when deleting old image in compute resource

Added by Daniel Lobato Garcia about 5 years ago. Updated 11 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Compute resources
Target version:
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

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

Has duplicate Foreman - Bug #6281: Attempting to remove openstack compute resource gives FK errorDuplicate2014-06-18

Associated revisions

Revision e0d618ef (diff)
Added by Joseph Magen almost 5 years ago

fixes #6216, #4416 - avoid foreign key errors when deleting some objects in use

Revision 3d5d2c5c (diff)
Added by Joseph Magen almost 5 years ago

fixes #6216, #4416 - avoid foreign key errors when deleting some objects in use

(cherry picked from commit e0d618efa6a8c02b46000bfcb9ded5eb672a6e13)

History

#1 Updated by Dominic Cleal almost 5 years ago

  • Has duplicate Bug #6281: Attempting to remove openstack compute resource gives FK error added

#2 Updated by Joseph Magen almost 5 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 almost 5 years ago

  • Status changed from Assigned to Ready For Testing
  • Legacy Backlogs Release (now unused) set to 18

#4 Updated by Joseph Magen almost 5 years ago

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

#5 Updated by Bryan Kearney almost 5 years ago

  • Bugzilla link set to 1114646

Also available in: Atom PDF