Bug 1645144

Summary: Unable to delete virt-who configuration from satellite.
Product: Red Hat Satellite Reporter: Suraj Patil <supatil>
Component: Virt-who Configure PluginAssignee: Marek Hulan <mhulan>
Status: CLOSED ERRATA QA Contact: Perry Gagne <pgagne>
Severity: high Docs Contact: satellite-doc-list
Priority: high    
Version: 6.4CC: ajambhul, ajoseph, akarimi, apitanga, avroy, brant.evans, dhjoshi, dsynk, egolov, gscarbor, hshukla, janarula, kuhuang, mhulan, ptrivedi, rajukuma, rbertolj, richard.zuber, sadas, saydas, smane, smutkule, vdeshpan
Target Milestone: 6.5.0Keywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: tfm-rubygem-foreman_virt_who_configure-0.3.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-14 12:38:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1589736    

Description Suraj Patil 2018-11-01 13:41:13 UTC
Description of problem:

Getting below error while deleting the virt-who configuration from satellite.

--------------------------------------------------------------------

ActiveRecord::InvalidForeignKey: PG::ForeignKeyViolation: ERROR: update or delete on table "users" violates foreign key constraint "fk_rails_51975e21a8" on table "notification_recipients"
DETAIL: Key (id)=(11) is still referenced from table "notification_recipients".
: DELETE FROM "users" WHERE "users"."id" = $1

--------------------------------------------------------------------

This error occurred because when we delete virt-who configuration it tries to delete the virt_who_reporter user and satellite is unable to delete this user because there is user-id referenced in the notification_recipients table.


Actual results:
Unable to delete virt-who configuration.

Expected results:
Virt-who configuration should get deleted.

Comment 6 Marek Hulan 2018-12-19 14:47:13 UTC
It could be caused by existing audit records for a virt-who configuration. Potentially fixed by BZ 1589736

Comment 7 Marek Hulan 2018-12-19 14:48:49 UTC
Oh I see now you're able to reproduce this even with the linked BZ. So try to see if you can still delete the configuration after you update it. There might be some issue with audit. Also let me know what's you virt_who_configure plugin version you tested with.

Comment 9 Marek Hulan 2019-01-15 12:29:42 UTC
Created redmine issue https://projects.theforeman.org/issues/25863 from this bug

Comment 10 Bryan Kearney 2019-01-15 13:09:20 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25863 has been resolved.

Comment 11 Bryan Kearney 2019-01-15 13:10:31 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25863 has been resolved.

Comment 12 Bryan Kearney 2019-01-15 13:11:25 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25863 has been resolved.

Comment 13 Bryan Kearney 2019-01-15 13:12:10 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25863 has been resolved.

Comment 14 Bryan Kearney 2019-01-15 13:13:11 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25863 has been resolved.

Comment 15 Bryan Kearney 2019-01-15 13:14:11 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25863 has been resolved.

Comment 16 Bryan Kearney 2019-01-15 13:15:05 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25863 has been resolved.

Comment 17 Bryan Kearney 2019-01-15 13:16:03 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25863 has been resolved.

Comment 18 Bryan Kearney 2019-01-15 13:18:10 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25863 has been resolved.

Comment 19 Perry Gagne 2019-01-24 15:41:07 UTC
Verified fix in 6.5 snap 12. 

Created/deployed a virt-who config, and waited for hypervisor reports to come in. 

Was able to delete the config.

Comment 31 errata-xmlrpc 2019-05-14 12:38:32 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