Bug #24269
closedCan not delete host if there are SCAP reports for that host
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1402513
Description of problem:
If a host has any SCAP reports and you try to delete said host from the Hosts -> All Hosts view or by click on the host and select the delete option then you get the following error message:
error: PG::Error: ERROR: update or delete on table "hosts" violates foreign key constraint "reports_host_id_fk" on table "reports" DETAIL: Key (id)=(43) is still referenced from table "reports". : DELETE FROM "hosts" WHERE "hosts"."type" IN ('Host::Managed') AND "hosts"."id" = $1
Version-Release number of selected component (if applicable):
6.2.4
How reproducible:
Always if a host has any SCAP reports.
Steps to Reproduce:
1. attempt to delete a host that has any SCAP reports
Actual results:
Host deletion fails with cryptic message
Expected results:
The host and the SCAP reports get deleted without error. OR, an option pops up to also delete the SCAP reports or preserve them even after host has been deleted.
Updated by The Foreman Bot over 6 years ago
- Status changed from New to Ready For Testing
- Assignee set to Marek Hulán
- Pull request https://github.com/theforeman/foreman/pull/5844 added
Updated by Tomer Brisker over 6 years ago
- Subject changed from Can not delete host if there are SCAP reports for that host to Can not delete host if there are SCAP reports for that host
- Target version set to 1.20.0
- Fixed in Releases 1.20.0 added
Updated by Marek Hulán over 6 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset d8df358343326049cb580945843499a1d2a81844.