Project

General

Profile

Bug #24269

Can not delete host if there are SCAP reports for that host

Added by Marek Hulán 5 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Inventory
Target version:
Difficulty:
Triaged:
No
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

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.

Associated revisions

Revision d8df3583 (diff)
Added by Marek Hulán 5 months ago

Fixes #24269 - clean all reports

History

#1 Updated by The Foreman Bot 5 months ago

  • Assignee set to Marek Hulán
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/5844 added

#2 Updated by Tomer Brisker 5 months ago

  • Target version set to 1.20.0
  • 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
  • Fixed in Releases 1.20.0 added

#3 Updated by Marek Hulán 5 months ago

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

#4 Updated by Tomer Brisker 2 months ago

  • Category set to Inventory

Also available in: Atom PDF