Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
With the latest continuous integration build of RHSM, a call to the refresh module is throwing a Traceback "AttributeError: 'module' object has no attribute 'BadStatusLine'" when trying to call refresh after the registered consumer has been deleted server-side. Rather than a hitting a traceback, we should be told that "Unit {UUID} has been deleted".
Version-Release number of selected component (if applicable):
[root@jsefler-rhel6 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.9.51.20-1
subscription management rules: 5.15.1
subscription-manager: 1.18.4-1.git.10.dfae74e.el6
python-rhsm: 1.18.4-1.git.9.bd3c973.el6
How reproducible:
Is NOT happening with...
subscription-manager: 1.18.4-1.el6
python-rhsm: 1.18.4-1.el6
IS happening with...
subscription-manager: 1.18.4-1.git.10.dfae74e.el6
python-rhsm: 1.18.4-1.git.9.bd3c973.el6
Steps to Reproduce:
[root@jsefler-rhel6 ~]# subscription-manager register --username=qa --serverurl=subscription.rhsm.stage.redhat.com:443/subscription
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Password:
The system has been registered with ID: 014c80ab-fcf1-406e-96df-4d1886992902
[root@jsefler-rhel6 ~]# curl --stderr /dev/null --insecure --user qa:REDACTED --request DELETE http://candlepin.dist.stage.ext.phx2.redhat.com/candlepin/consumers/014c80ab-fcf1-406e-96df-4d1886992902
[root@jsefler-rhel6 ~]# subscription-manager identity
Unit 014c80ab-fcf1-406e-96df-4d1886992902 has been deleted
[root@jsefler-rhel6 ~]# subscription-manager refresh
'module' object has no attribute 'BadStatusLine'
[root@jsefler-rhel6 ~]# tail -f /var/log/rhsm/rhsm.log
2016-11-21 16:33:42,077 [DEBUG] subscription-manager:7910:MainThread @connection.py:490 - Making request: PUT /subscription/consumers/014c80ab-fcf1-406e-96df-4d1886992902/certificates?lazy_regen=true
2016-11-21 16:33:42,770 [INFO] subscription-manager:7910:MainThread @connection.py:525 - Response: status=410, request="PUT /subscription/consumers/014c80ab-fcf1-406e-96df-4d1886992902/certificates?lazy_regen=true"
2016-11-21 16:33:42,771 [ERROR] subscription-manager:7910:MainThread @managercli.py:177 - Unable to perform refresh due to the following exception: 'module' object has no attribute 'BadStatusLine'
2016-11-21 16:33:42,772 [ERROR] subscription-manager:7910:MainThread @managercli.py:178 - 'module' object has no attribute 'BadStatusLine'
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/subscription_manager/managercli.py", line 664, in _do_command
if not self.cp.regenEntitlementCertificates(identity.uuid, True):
File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 1290, in regenEntitlementCertificates
except (RemoteServerException, httplib.BadStatusLine, RestlibException) as e:
AttributeError: 'module' object has no attribute 'BadStatusLine'
Actual results:
'module' object has no attribute 'BadStatusLine'
Expected results:
Unit 014c80ab-fcf1-406e-96df-4d1886992902 has been deleted
Additional info:
For comparison, here is the corresponding /var/log/rhsm/rhsm.log with subscription-manager: 1.18.4-1.el6
2016-11-21 16:40:34,874 [DEBUG] subscription-manager:8809:MainThread @connection.py:577 - Making request: PUT /subscription/consumers/172c9d1a-f6c8-4a73-82c6-c4772b7a3ee0/certificates?lazy_regen=true
2016-11-21 16:40:35,561 [DEBUG] subscription-manager:8809:MainThread @connection.py:610 - Response: status=410
2016-11-21 16:40:35,562 [ERROR] subscription-manager:8809:MainThread @managercli.py:671 - Unit 172c9d1a-f6c8-4a73-82c6-c4772b7a3ee0 has been deleted
Verifying on :
# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.9.51.20-1
subscription management rules: 5.15.1
subscription-manager: 1.18.6-1.el6
python-rhsm: 1.18.6-1.el6
# subscription-manager register --username=qa --serverurl=subscription.rhsm.stage.redhat.com:443/subscription
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Password:
The system has been registered with ID: c953dc37-cd64-41fe-8cc6-eac810ea1205
# curl --stderr /dev/null --insecure --user qa:<password> --request DELETE http://candlepin.dist.stage.ext.phx2.redhat.com/candlepin/consumers/c953dc37-cd64-41fe-8cc6-eac810ea1205
# subscription-manager identity
Unit c953dc37-cd64-41fe-8cc6-eac810ea1205 has been deleted
# subscription-manager refresh
Unit c953dc37-cd64-41fe-8cc6-eac810ea1205 has been deleted
rhsm.log:
======
2016-12-12 06:59:01,428 [INFO] subscription-manager:28708:MainThread @connection.py:758 - Connection built: host=subscription.rhsm.stage.redhat.com port=443 handler=/subscription auth=none
2016-12-12 06:59:01,428 [INFO] subscription-manager:28708:MainThread @managercli.py:364 - Consumer Identity name=dhcp70-150.rhts.eng.bos.redhat.com uuid=c953dc37-cd64-41fe-8cc6-eac810ea1205
2016-12-12 06:59:02,046 [INFO] subscription-manager:28708:MainThread @connection.py:525 - Response: status=410, request="PUT /subscription/consumers/c953dc37-cd64-41fe-8cc6-eac810ea1205/certificates?lazy_regen=true"
2016-12-12 06:59:02,048 [ERROR] subscription-manager:28708:MainThread @managercli.py:672 - Unit c953dc37-cd64-41fe-8cc6-eac810ea1205 has been deleted
Observed that now " Unit c953dc37-cd64-41fe-8cc6-eac810ea1205 has been deleted" message is displayed on subscription-manager refresh command; and no error was observed on cli and rhsm.log. Hence marking as Verified!!
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://rhn.redhat.com/errata/RHSA-2017-0698.html
Description of problem: With the latest continuous integration build of RHSM, a call to the refresh module is throwing a Traceback "AttributeError: 'module' object has no attribute 'BadStatusLine'" when trying to call refresh after the registered consumer has been deleted server-side. Rather than a hitting a traceback, we should be told that "Unit {UUID} has been deleted". Version-Release number of selected component (if applicable): [root@jsefler-rhel6 ~]# subscription-manager version server type: Red Hat Subscription Management subscription management server: 0.9.51.20-1 subscription management rules: 5.15.1 subscription-manager: 1.18.4-1.git.10.dfae74e.el6 python-rhsm: 1.18.4-1.git.9.bd3c973.el6 How reproducible: Is NOT happening with... subscription-manager: 1.18.4-1.el6 python-rhsm: 1.18.4-1.el6 IS happening with... subscription-manager: 1.18.4-1.git.10.dfae74e.el6 python-rhsm: 1.18.4-1.git.9.bd3c973.el6 Steps to Reproduce: [root@jsefler-rhel6 ~]# subscription-manager register --username=qa --serverurl=subscription.rhsm.stage.redhat.com:443/subscription Registering to: subscription.rhsm.stage.redhat.com:443/subscription Password: The system has been registered with ID: 014c80ab-fcf1-406e-96df-4d1886992902 [root@jsefler-rhel6 ~]# curl --stderr /dev/null --insecure --user qa:REDACTED --request DELETE http://candlepin.dist.stage.ext.phx2.redhat.com/candlepin/consumers/014c80ab-fcf1-406e-96df-4d1886992902 [root@jsefler-rhel6 ~]# subscription-manager identity Unit 014c80ab-fcf1-406e-96df-4d1886992902 has been deleted [root@jsefler-rhel6 ~]# subscription-manager refresh 'module' object has no attribute 'BadStatusLine' [root@jsefler-rhel6 ~]# tail -f /var/log/rhsm/rhsm.log 2016-11-21 16:33:42,077 [DEBUG] subscription-manager:7910:MainThread @connection.py:490 - Making request: PUT /subscription/consumers/014c80ab-fcf1-406e-96df-4d1886992902/certificates?lazy_regen=true 2016-11-21 16:33:42,770 [INFO] subscription-manager:7910:MainThread @connection.py:525 - Response: status=410, request="PUT /subscription/consumers/014c80ab-fcf1-406e-96df-4d1886992902/certificates?lazy_regen=true" 2016-11-21 16:33:42,771 [ERROR] subscription-manager:7910:MainThread @managercli.py:177 - Unable to perform refresh due to the following exception: 'module' object has no attribute 'BadStatusLine' 2016-11-21 16:33:42,772 [ERROR] subscription-manager:7910:MainThread @managercli.py:178 - 'module' object has no attribute 'BadStatusLine' Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/subscription_manager/managercli.py", line 664, in _do_command if not self.cp.regenEntitlementCertificates(identity.uuid, True): File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 1290, in regenEntitlementCertificates except (RemoteServerException, httplib.BadStatusLine, RestlibException) as e: AttributeError: 'module' object has no attribute 'BadStatusLine' Actual results: 'module' object has no attribute 'BadStatusLine' Expected results: Unit 014c80ab-fcf1-406e-96df-4d1886992902 has been deleted Additional info: For comparison, here is the corresponding /var/log/rhsm/rhsm.log with subscription-manager: 1.18.4-1.el6 2016-11-21 16:40:34,874 [DEBUG] subscription-manager:8809:MainThread @connection.py:577 - Making request: PUT /subscription/consumers/172c9d1a-f6c8-4a73-82c6-c4772b7a3ee0/certificates?lazy_regen=true 2016-11-21 16:40:35,561 [DEBUG] subscription-manager:8809:MainThread @connection.py:610 - Response: status=410 2016-11-21 16:40:35,562 [ERROR] subscription-manager:8809:MainThread @managercli.py:671 - Unit 172c9d1a-f6c8-4a73-82c6-c4772b7a3ee0 has been deleted