Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1589736 - Can not delete organization, if virt-who is configured
Summary: Can not delete organization, if virt-who is configured
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Virt-who Configure Plugin
Version: 6.3.1
Hardware: All
OS: All
unspecified
high
Target Milestone: 6.5.0
Assignee: Amit Upadhye
QA Contact: Perry Gagne
satellite-doc-list
URL:
Whiteboard:
Depends On: 1645144
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-11 09:52 UTC by Anand Agrawal
Modified: 2021-09-09 14:30 UTC (History)
3 users (show)

Fixed In Version: rubygem-foreman_virt_who_configure 0.3.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-14 12:37:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 23878 0 Normal Closed Can not delete organization, if virt-who is configured 2020-07-03 13:08:17 UTC
Red Hat Product Errata RHSA-2019:1222 0 None None None 2019-05-14 12:37:30 UTC

Description Anand Agrawal 2018-06-11 09:52:07 UTC
Description of problem:

If `Virt-who Configurations` is created on Satellite. It is not possible to delete the organization.

It throws, foreign key dependencies error as below:

PG::Error: ERROR:  update or delete on table "taxonomies" violates foreign key constraint "fk_rails_972e5a3807" on table "foreman_virt_who_configure_configs"
DETAIL:  Key (id)=(13) is still referenced from table "foreman_virt_who_configure_configs".
: DELETE FROM "taxonomies" WHERE "taxonomies"."type" IN ('Organization') AND "taxonomies"."id" = $1

Version-Release number of selected component (if applicable):
6.3.1

How reproducible:
Always

Steps to Reproduce:
1. Create any Organization. example: 'Test Org'
2. Switch to the 'Test Org'
3. GoTo Infrastructure -> Virt-who Configurations -> Create config
4. Insert mandatory field and submit.
5. Now switch to other organization to delte 'Test Org'
6. Delete the organization. Check the task, task will be in error state with the PG:ERROR

Actual results:
PG::Error: ERROR:  update or delete on table "taxonomies" violates foreign key constraint "fk_rails_972e5a3807" on table "foreman_virt_who_configure_configs"
DETAIL:  Key (id)=(13) is still referenced from table "foreman_virt_who_configure_configs".
: DELETE FROM "taxonomies" WHERE "taxonomies"."type" IN ('Organization') AND "taxonomies"."id" = $1

Expected results:

Organization should be deleted without error.

Additional info:

Comment 1 Marek Hulan 2018-06-11 10:57:27 UTC
A valid bug, but the workaround should be trivial, delete all configurations for that organization first. Note that this would also destroy the service user that virt-who uses for authentication, so it basically make virt-who instance configuration invalid. But if you're deleting the organization, I guess that's not a problem and is kind of expected.

Comment 2 Marek Hulan 2018-06-11 10:58:03 UTC
Created redmine issue http://projects.theforeman.org/issues/23878 from this bug

Comment 5 Marek Hulan 2018-06-11 12:12:05 UTC
Interesting, could you grab a production.log from a moment when user clicks the delete button? The traceback from there might be useful.

Comment 8 Perry Gagne 2019-01-24 18:59:13 UTC
Verified fix in 6.5 snap 12

Created org "VDCOrg"
Created/Deployed virt-who config
waited for hypervisor reports, etc to come in. 
Deleted VDCOrg

VDCOrg was deleted successfully.

Comment 10 errata-xmlrpc 2019-05-14 12:37:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:1222


Note You need to log in before you can comment on or make changes to this bug.