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 6
Classification: Red Hat
Component: Virt-who Configure Plugin
Version: 6.3.1
Hardware: All
OS: All
unspecified
high vote
Target Milestone: Released
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: 2019-10-07 17:13 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


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:1222 None None None 2019-05-14 12:37:30 UTC
Foreman Issue Tracker 23878 None None None 2018-06-11 10:58:04 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.