Bug 1394351

Summary: 'module' object has no attribute 'PROXY_AUTHENTICATION_REQUIRED'
Product: Red Hat Enterprise Linux 6 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: Kevin Howell <khowell>
Status: CLOSED ERRATA QA Contact: John Sefler <jsefler>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.9CC: csnyder, khowell, redakkan, skallesh, vrjain
Target Milestone: rcKeywords: Regression, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-21 10:57:06 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:

Description John Sefler 2016-11-11 19:21:39 UTC
Description of problem:
I suspect that the attempt to fix bug 1390688 is insufficient and is causing this new traceback.  This blocks system registration. 


Version-Release number of selected component (if applicable):
[root@jsefler-rhel6server ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: Unknown
subscription management rules: Unknown
subscription-manager: 1.18.4-1.git.0.ce8212e.el6
python-rhsm: 1.18.4-1.git.2.07e5af7.el6


How reproducible:


Steps to Reproduce:
[root@jsefler-rhel6server ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: Unknown
subscription management rules: Unknown
subscription-manager: 1.18.4-1.git.0.ce8212e.el6
python-rhsm: 1.18.4-1.git.2.07e5af7.el6

[root@jsefler-rhel6server ~]# tail -f /var/log/rhsm/rhsm.log
2016-11-11 14:05:50,731 [DEBUG] subscription-manager:19698:MainThread @https.py:59 - Using m2crypto wrappers to provide httplib and ssl
2016-11-11 14:05:50,870 [DEBUG] subscription-manager:19698:MainThread @ga_loader.py:89 - ga_loader GaImporterGtk2
2016-11-11 14:05:50,875 [DEBUG] subscription-manager:19698:MainThread @plugins.py:569 - loaded plugin modules: []
2016-11-11 14:05:50,875 [DEBUG] subscription-manager:19698:MainThread @plugins.py:570 - loaded plugins: {}
2016-11-11 14:05:50,875 [DEBUG] subscription-manager:19698:MainThread @identity.py:131 - Loading consumer info from identity certificates.
2016-11-11 14:05:50,875 [DEBUG] subscription-manager:19698:MainThread @identity.py:146 - Reload of consumer identity cert /etc/pki/consumer/cert.pem raised an exception with msg: [Errno 2] No such file or directory: '/etc/pki/consumer/key.pem'
2016-11-11 14:05:50,921 [INFO] subscription-manager:19698:MainThread @managercli.py:388 - Client Versions: {'python-rhsm': '1.18.4-1.git.2.07e5af7.el6', 'subscription-manager': '1.18.4-1.git.0.ce8212e.el6'}
2016-11-11 14:05:50,922 [INFO] subscription-manager:19698:MainThread @connection.py:755 - Connection built: host=jsefler-candlepin6.usersys.redhat.com port=8443 handler=/candlepin auth=identity_cert ca_dir=/etc/rhsm/ca/ verify=False
2016-11-11 14:05:50,922 [INFO] subscription-manager:19698:MainThread @connection.py:755 - Connection built: host=jsefler-candlepin6.usersys.redhat.com port=8443 handler=/candlepin auth=none
2016-11-11 14:05:50,941 [DEBUG] subscription-manager:19698:MainThread @connection.py:445 - Loaded CA certificates from /etc/rhsm/ca/: jsefler-candlepin6.pem, timeout_listener.pem, redhat-uep.pem
2016-11-11 14:05:50,941 [DEBUG] subscription-manager:19698:MainThread @connection.py:489 - Making request: GET /candlepin/
2016-11-11 14:05:50,981 [ERROR] subscription-manager:19698:MainThread @utils.py:273 - Error while checking server version: 'module' object has no attribute 'PROXY_AUTHENTICATION_REQUIRED'
2016-11-11 14:05:50,981 [ERROR] subscription-manager:19698:MainThread @utils.py:275 - 'module' object has no attribute 'PROXY_AUTHENTICATION_REQUIRED'
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/subscription_manager/utils.py", line 253, in get_server_versions
    if cp.supports_resource("status"):
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 781, in supports_resource
    self._load_supported_resources()
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 768, in _load_supported_resources
    resources_list = self.conn.request_get("/")
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 620, in request_get
    return self._request("GET", method)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 508, in _request
    if str(e)[-3:] == str(httplib.PROXY_AUTHENTICATION_REQUIRED):
AttributeError: 'module' object has no attribute 'PROXY_AUTHENTICATION_REQUIRED'
2016-11-11 14:05:50,982 [INFO] subscription-manager:19698:MainThread @managercli.py:399 - Server Versions: {'rules-version': 'Unknown', 'candlepin': 'Unknown', 'server-type': 'This system is currently not registered.'}


Actual results:


Expected results:


Additional info:
[root@jsefler-rhel6server ~]# subscription-manager config 
[server]
   hostname = jsefler-candlepin6.usersys.redhat.com
   insecure = [0]
   port = 8443
   prefix = /candlepin
   proxy_hostname = []
   proxy_password = []
   proxy_port = []
   proxy_user = []
   server_timeout = [180]
   ssl_verify_depth = [3]

[rhsm]
   baseurl = [https://cdn.redhat.com]
   ca_cert_dir = [/etc/rhsm/ca/]
   consumercertdir = [/etc/pki/consumer]
   entitlementcertdir = [/etc/pki/entitlement]
   full_refresh_on_yum = [0]
   manage_repos = [1]
   pluginconfdir = [/etc/rhsm/pluginconf.d]
   plugindir = [/usr/share/rhsm-plugins]
   productcertdir = [/etc/pki/product]
   repo_ca_cert = /etc/rhsm/ca/redhat-uep.pem
   report_package_profile = [1]

[rhsmcertd]
   autoattachinterval = [1440]
   certcheckinterval = [240]

[logging]
   default_log_level = DEBUG

[] - Default value in use


[root@jsefler-rhel6server ~]#

Comment 3 Chris Snyder 2016-11-14 18:38:19 UTC
The fix is merged upstream. Moving to POST.

Comment 5 Rehana 2016-12-12 11:27:03 UTC
Retested on ;
python-rhsm-certificates-1.18.6-1.el6.x86_64
python-rhsm-1.18.6-1.el6.x86_64
subscription-manager-migration-1.18.6-1.el6.x86_64
subscription-manager-firstboot-1.18.6-1.el6.x86_64
subscription-manager-1.18.6-1.el6.x86_64
subscription-manager-gui-1.18.6-1.el6.x86_64
subscription-manager-migration-data-2.0.32-1.el6.noarch

Observed that now `subscription-manager version` command works and no error was observed in the rhsm.log 


# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.0.21-1
subscription management rules: 5.20
subscription-manager: 1.18.6-1.el6
python-rhsm: 1.18.6-1.el6


rhsm.log :
============

2016-12-12 06:22:09,557 [INFO] subscription-manager:28456:MainThread @managercli.py:389 - Client Versions: {'python-rhsm': '1.18.6-1.el6', 'subscription-manager': '1.18.6-1.el6'}
2016-12-12 06:22:09,557 [INFO] subscription-manager:28456:MainThread @connection.py:758 - Connection built: host=F21-candlepin.usersys.redhat.com port=8443 handler=/candlepin auth=identity_cert ca_dir=/etc/rhsm/ca/ insecure=False
2016-12-12 06:22:09,557 [INFO] subscription-manager:28456:MainThread @connection.py:758 - Connection built: host=F21-candlepin.usersys.redhat.com port=8443 handler=/candlepin auth=none
2016-12-12 06:22:11,127 [INFO] subscription-manager:28456:MainThread @connection.py:525 - Response: status=200, requestUuid=41206213-6518-49c2-8aa8-6282c2d5f54b, request="GET /candlepin/"
2016-12-12 06:22:12,425 [INFO] subscription-manager:28456:MainThread @connection.py:525 - Response: status=200, requestUuid=dca5a5a4-5b70-4dfe-b2d1-b003fbcc833b, request="GET /candlepin/status"
2016-12-12 06:22:12,428 [INFO] subscription-manager:28456:MainThread @managercli.py:400 - Server Versions: {'rules-version': '5.20', 'candlepin': '2.0.21-1', 'server-type': 'Red Hat Subscription Management'}


Above retest steps demonstrates that the issue is now resolved, hence marking as Verified!!!

Additional details on system configuration:
========================================
# subscription-manager config --list
[server]
   hostname = F21-candlepin.usersys.redhat.com
   insecure = [0]
   port = 8443
   prefix = /candlepin
   proxy_hostname = []
   proxy_password = []
   proxy_port = []
   proxy_user = []
   server_timeout = [180]
   ssl_verify_depth = [3]

[rhsm]
   baseurl = [https://cdn.redhat.com]
   ca_cert_dir = [/etc/rhsm/ca/]
   consumercertdir = [/etc/pki/consumer]
   entitlementcertdir = [/etc/pki/entitlement]
   full_refresh_on_yum = [0]
   manage_repos = [1]
   pluginconfdir = [/etc/rhsm/pluginconf.d]
   plugindir = [/usr/share/rhsm-plugins]
   productcertdir = [/etc/pki/product]
   repo_ca_cert = /etc/rhsm/ca/redhat-uep.pem
   report_package_profile = [1]

[rhsmcertd]
   autoattachinterval = [1440]
   certcheckinterval = [240]

[logging]
   default_log_level = [INFO]

[] - Default value in use

Comment 7 errata-xmlrpc 2017-03-21 10:57:06 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://rhn.redhat.com/errata/RHSA-2017-0698.html