RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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 1862415 - unexpected 'displayName' after a consumer has been deleted on the server side; expected a graceful GoneException
Summary: unexpected 'displayName' after a consumer has been deleted on the server side...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: subscription-manager
Version: 8.3
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: 8.3
Assignee: Jiri Hnidek
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
: 1866280 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-31 11:49 UTC by John Sefler
Modified: 2020-11-04 01:40 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-04 01:39:41 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin subscription-manager pull 2313 0 None closed 1862415: Print proper message, when consumer is deleted; ENT-2709 2020-11-02 16:30:55 UTC
Red Hat Product Errata RHBA-2020:4460 0 None None None 2020-11-04 01:40:01 UTC

Description John Sefler 2020-07-31 11:49:12 UTC
Description of problem:
  When a consumer has been deleted at the server, the expected message on the client should come from a GoneException "Unit 6ab68937-3918-487f-837e-cf6e87650b9f has been deleted".  Instead we are getting a 'displayName'.


Version-Release number of selected component (if applicable):
[root@hpe-dl380pgen8-02-vm-11 ~]# rpm -q subscription-manager
subscription-manager-1.27.11-1.el8.x86_64


How reproducible:


Steps to Reproduce:
[root@hpe-dl380pgen8-02-vm-11 ~]# subscription-manager register --auto-attach --serverurl=subscription.rhsm.stage.redhat.com
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: stage_auto_testuser
Password: 
CACHED_SYSPURPOSE: /var/lib/rhsm/cache/syspurpose.json
The system has been registered with ID: e1ba85c0-20c5-444d-89b5-e57dabaa3a15
The registered system name is: hpe-dl380pgen8-02-vm-11.hpe2.lab.eng.bos.redhat.com
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64 Beta
Status:       Subscribed

[root@hpe-dl380pgen8-02-vm-11 ~]# curl --stderr /dev/null --insecure --user stage_auto_testuser:REDACTED --request DELETE https://candlepin.corp.stage.redhat.com/candlepin/consumers/e1ba85c0-20c5-444d-89b5-e57dabaa3a15
[root@hpe-dl380pgen8-02-vm-11 ~]# 
[root@hpe-dl380pgen8-02-vm-11 ~]# sleep 60
[root@hpe-dl380pgen8-02-vm-11 ~]# 
[root@hpe-dl380pgen8-02-vm-11 ~]# subscription-manager identity
'displayName'
[root@hpe-dl380pgen8-02-vm-11 ~]# 


Actual results:
  'displayName'

Expected results:
  Unit 6ab68937-3918-487f-837e-cf6e87650b9f has been deleted

Additional info:

[root@hpe-dl380pgen8-02-vm-11 ~]# tail -20 /var/log/rhsm/rhsm.log 
2020-07-31 07:39:12,443 [DEBUG] subscription-manager:452514:MainThread @connection.py:265 - Connection built: host=subscription.rhsm.stage.redhat.com port=443 handler=/subscription auth=identity_cert ca_dir=/etc/rhsm/ca/ insecure=False
2020-07-31 07:39:12,443 [DEBUG] subscription-manager:452514:MainThread @connection.py:169 - Environment variable NO_PROXY= will be used
2020-07-31 07:39:12,443 [DEBUG] subscription-manager:452514:MainThread @connection.py:265 - Connection built: host=subscription.rhsm.stage.redhat.com port=443 handler=/subscription auth=none
2020-07-31 07:39:12,533 [DEBUG] subscription-manager:452514:MainThread @managercli.py:367 - Consumer Identity name=hpe-dl380pgen8-02-vm-11.hpe2.lab.eng.bos.redhat.com uuid=e1ba85c0-20c5-444d-89b5-e57dabaa3a15
2020-07-31 07:39:12,534 [DEBUG] subscription-manager:452514:MainThread @cache.py:881 - Trying to read CurrentOwnerCache from cache file /var/lib/rhsm/cache/current_owner.json
2020-07-31 07:39:12,535 [DEBUG] subscription-manager:452514:MainThread @cache.py:887 - Identity of system has changed. The cache file: /var/lib/rhsm/cache/current_owner.json is obsolete
2020-07-31 07:39:12,535 [DEBUG] subscription-manager:452514:MainThread @cache.py:897 - Getting data from server for <class 'subscription_manager.cache.CurrentOwnerCache'>
2020-07-31 07:39:12,535 [DEBUG] subscription-manager:452514:MainThread @connection.py:685 - Making request: GET /subscription/consumers/e1ba85c0-20c5-444d-89b5-e57dabaa3a15/owner
2020-07-31 07:39:12,536 [DEBUG] subscription-manager:452514:MainThread @connection.py:570 - Loaded CA certificates from /etc/rhsm/ca/: redhat-entitlement-authority.pem, redhat-uep.pem
2020-07-31 07:39:13,025 [DEBUG] subscription-manager:452514:MainThread @connection.py:779 - Response time: 0.4092395305633545, Smoothed response time: 0.4092395305633545
2020-07-31 07:39:13,025 [DEBUG] subscription-manager:452514:MainThread @connection.py:756 - Response: status=410, requestUuid=222aa111-e0ae-4b8e-9047-858d3979639e, request="GET /subscription/consumers/e1ba85c0-20c5-444d-89b5-e57dabaa3a15/owner"
2020-07-31 07:39:13,026 [WARNING] subscription-manager:452514:MainThread @cache.py:901 - Unable to get data for <class 'subscription_manager.cache.CurrentOwnerCache'> using REST API: HTTP error (410 - Gone): Unit e1ba85c0-20c5-444d-89b5-e57dabaa3a15 has been deleted
2020-07-31 07:39:13,026 [DEBUG] subscription-manager:452514:MainThread @cache.py:902 - Deleting cache file: /var/lib/rhsm/cache/current_owner.json
2020-07-31 07:39:13,027 [DEBUG] subscription-manager:452514:MainThread @cache.py:93 - Deleting cache: /var/lib/rhsm/cache/current_owner.json
2020-07-31 07:39:13,027 [ERROR] subscription-manager:452514:MainThread @managercli.py:218 - Error: Unable to generate a new identity for the system
2020-07-31 07:39:13,027 [ERROR] subscription-manager:452514:MainThread @managercli.py:219 - 'displayName'
Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 1103, in _do_command
    ownername = owner['displayName']
KeyError: 'displayName'

Comment 1 Shwetha Kallesh 2020-08-05 10:15:13 UTC
*** Bug 1866280 has been marked as a duplicate of this bug. ***

Comment 4 John Sefler 2020-08-31 15:53:05 UTC
Verifying Version...

[root@ibm-x3650m4-01-vm-06 ~]# rpm -q subscription-manager
subscription-manager-1.27.15-1.el8.x86_64
[root@ibm-x3650m4-01-vm-06 ~]# rpm -q subscription-manager --changelog | grep 1862415
- 1862415: Print proper message, when consumer is deleted; ENT-2709
[root@ibm-x3650m4-01-vm-06 ~]# 


[root@ibm-x3650m4-01-vm-06 ~]# subscription-manager register --auto-attach --serverurl=subscription.rhsm.stage.redhat.com
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: stage_auto_testuser
Password: 
The system has been registered with ID: 0b9adffd-066d-4e4a-91c9-3f55113f4190
The registered system name is: ibm-x3650m4-01-vm-06.ibm2.lab.eng.bos.redhat.com
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64 High Touch Beta
Status:       Subscribed

[root@ibm-x3650m4-01-vm-06 ~]# curl --stderr /dev/null --insecure --user stage_auto_testuser:REDACTED --request DELETE  https://candlepin.corp.stage.redhat.com/candlepin/consumers/0b9adffd-066d-4e4a-91c9-3f55113f4190
[root@ibm-x3650m4-01-vm-06 ~]# 
[root@ibm-x3650m4-01-vm-06 ~]# 
[root@ibm-x3650m4-01-vm-06 ~]# sleep 60
[root@ibm-x3650m4-01-vm-06 ~]# 
[root@ibm-x3650m4-01-vm-06 ~]# subscription-manager identity
Consumer profile "0b9adffd-066d-4e4a-91c9-3f55113f4190" has been deleted from the server. You can use command clean or unregister to remove local profile.
[root@ibm-x3650m4-01-vm-06 ~]# 
[root@ibm-x3650m4-01-vm-06 ~]# tail -n2 /var/log/rhsm/rhsm.log
2020-08-31 11:07:57,641 [WARNING] subscription-manager:15463:MainThread @cache.py:901 - Unable to get data for <class 'subscription_manager.cache.CurrentOwnerCache'> using REST API: HTTP error (410 - Gone): Unit 0b9adffd-066d-4e4a-91c9-3f55113f4190 has been deleted
2020-08-31 11:07:57,641 [CRITICAL] subscription-manager:15463:MainThread @managercli.py:559 - Consumer profile "0b9adffd-066d-4e4a-91c9-3f55113f4190" has been deleted from the server.
[root@ibm-x3650m4-01-vm-06 ~]# 

VERIFIED:  A graceful message is now presented to the user with instructions how to proceed....


[root@ibm-x3650m4-01-vm-06 ~]# subscription-manager identity
Consumer profile "0b9adffd-066d-4e4a-91c9-3f55113f4190" has been deleted from the server. You can use command clean or unregister to remove local profile.
[root@ibm-x3650m4-01-vm-06 ~]# 
[root@ibm-x3650m4-01-vm-06 ~]# subscription-manager unregister
Unregistering from: subscription.rhsm.stage.redhat.com:443/subscription
System has been unregistered.
[root@ibm-x3650m4-01-vm-06 ~]# 
[root@ibm-x3650m4-01-vm-06 ~]# subscription-manager identity
This system is not yet registered. Try 'subscription-manager register --help' for more information.
[root@ibm-x3650m4-01-vm-06 ~]# 

VERIFIED: The instruction to unregister also removes the local profile gracefully.

Comment 7 errata-xmlrpc 2020-11-04 01:39: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 (subscription-manager bug fix and enhancement update), 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/RHBA-2020:4460


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