Bug 1648121 - [6.4]After unregistering hypervisor, unable to view subscriptions on activation key via Satellite WebUI
Summary: [6.4]After unregistering hypervisor, unable to view subscriptions on activati...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Activation Keys
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
high vote
Target Milestone: Released
Assignee: Samir Jha
QA Contact: Perry Gagne
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-08 21:46 UTC by wclark
Modified: 2019-10-07 17:19 UTC (History)
2 users (show)

Fixed In Version: tfm-rubygem-katello-3.10.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-14 12:38:41 UTC


Attachments (Terms of Use)
screenshot1 showing normal/expected behavior when viewing 'list/remove subscriptions' for an activation key (41.92 KB, image/png)
2018-11-08 21:50 UTC, wclark
no flags Details
screenshot2 showing the error behavior on 'list/remove subscriptions' when a single hypervisor was unregistered (13.81 KB, image/png)
2018-11-08 21:51 UTC, wclark
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:1222 None None None 2019-05-14 12:38:50 UTC
Foreman Issue Tracker 25604 None None None 2018-12-03 01:55:02 UTC

Description wclark 2018-11-08 21:46:30 UTC
Initial setup is an activation key with one or more derived entitlements attached.

[root@iridium ~]# hammer activation-key subscriptions --id 4 --organization-id 1
---|----------------------------------------------------------------------------------|----------|----------|---------------------|---------------------|----------|----------|--------
ID | NAME                                                                             | ATTACHED | QUANTITY | START DATE          | END DATE            | SUPPORT  | CONTRACT | ACCOUNT
---|----------------------------------------------------------------------------------|----------|----------|---------------------|---------------------|----------|----------|--------
9  | Red Hat Enterprise Linux for Virtual Datacenters with Smart Management, Standard |          |          | 2017/02/07 05:00:00 | 2021/12/31 23:59:59 | Standard | 11288968 | 540155 
8  | Red Hat Enterprise Linux for Virtual Datacenters with Smart Management, Standard |          |          | 2017/02/07 05:00:00 | 2021/12/31 23:59:59 | Standard | 11288968 | 540155 
---|----------------------------------------------------------------------------------|----------|----------|---------------------|---------------------|----------|----------|--------
[root@iridium ~]# 

One the Satellite WebUI, when viewing 'list/remove subscriptions' for the activation key, this appears as in screenshot1.png.

Then the issue is reproduced by unregistering one hypervisor associated with one of the derived entitlements on the key. At this point, when viewing 'list/remove subscriptions' on the WebUI, this appears in the broken state as in screenshot2.png.

However using Hammer, I am still able to view the one remaining subscription on the key:

[root@iridium ~]# hammer activation-key subscriptions --id 4 --organization-id 1
---|----------------------------------------------------------------------------------|----------|----------|---------------------|---------------------|----------|----------|--------
ID | NAME                                                                             | ATTACHED | QUANTITY | START DATE          | END DATE            | SUPPORT  | CONTRACT | ACCOUNT
---|----------------------------------------------------------------------------------|----------|----------|---------------------|---------------------|----------|----------|--------
8  | Red Hat Enterprise Linux for Virtual Datacenters with Smart Management, Standard |          |          | 2017/02/07 05:00:00 | 2021/12/31 23:59:59 | Standard | 11288968 | 540155 
---|----------------------------------------------------------------------------------|----------|----------|---------------------|---------------------|----------|----------|--------
[root@iridium ~]# 

When I re-register the hypervisor by re-running virt-who, then attach the physical VDC subscription to the hypervisor again, then attach the derived VDC subscription to the activation key, suddenly *all* subscriptions are showing again on the activation key under 'list/remove subscriptions'.

I have verified this behavior on 6.3.1 and 6.4. It appears to be reproducible 100% of the time.

Comment 1 wclark 2018-11-08 21:48:01 UTC
Expected Behavior:

WebUI is able to show all subscriptions on the key.

Actual Behavior:

Unable to view any subscriptions on the key until the missing virtual VDC subscription is recreated and re-added to the key, at which point all subscriptions become visible again.

Comment 2 wclark 2018-11-08 21:50:45 UTC
Created attachment 1503485 [details]
screenshot1 showing normal/expected behavior when viewing 'list/remove subscriptions' for an activation key

Comment 3 wclark 2018-11-08 21:51:51 UTC
Created attachment 1503486 [details]
screenshot2 showing the error behavior on 'list/remove subscriptions' when a single hypervisor was unregistered

Comment 4 wclark 2018-11-08 22:09:57 UTC
I have reproduced the issue without unregistering the hypervisor, it's sufficient to simply remove the physical subscription from the hypervisor and then no subscriptions will be visible under 'list/remove subscriptions' for the activation key.

Additionally I'm unclear whether this is filed under the correct component. I chose WebUI since I am able to view the proper subscriptions for the key using hammer.

Checking the Candlepin database directly, I can see the single pool on the activation key:

// getting the activation key ID

[root@iridium ~]# su - postgres -c "psql -d candlepin -c 'select id,name from cp_activation_key;'"
                id                |                 name                 
----------------------------------+--------------------------------------
 8a8c54d666cfc71e0166f53e036100aa | bcc8bad4-863a-4ec9-92ff-12c195fcdd83
(1 row)

[root@iridium ~]# 

// finding all pool_ids associated with the activation key

[root@iridium ~]# su - postgres -c "psql -d candlepin -c 'select pool_id from cp_activationkey_pool where key_id = '\''8a8c54d666cfc71e0166f53e036100aa'\'';'"
             pool_id              
----------------------------------
 8a8c54d666cfc71e0166f53d5098009d
(1 row)

[root@iridium ~]#

Comment 7 Samir Jha 2018-12-03 01:54:59 UTC
Created redmine issue http://projects.theforeman.org/issues/25604 from this bug

Comment 8 Samir Jha 2018-12-07 18:26:18 UTC
An immediate fix for this would be to run `foreman rake katello:import_subscriptions`

We are working on a long term fix for this. Thanks!

Comment 9 pm-sat@redhat.com 2018-12-07 19:02:52 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25604 has been resolved.

Comment 10 Perry Gagne 2019-01-24 21:50:18 UTC
Verified fix in 6.5 snap 12

1. Configured virt-who to get hypervisors.
2. Attached VDC "physical" sub to 2 hypervisors
3. Created activation key with VDC "derived" subscription for both hypervisors and other subscriptions. 
4. Removed "physical" sub from one of the hypervisor. 

The Activation key lists the correct subs. One for the remaining hypervisor, and the custom products.

Comment 13 errata-xmlrpc 2019-05-14 12:38:41 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.