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 1400719 - AttributeError: 'ContentConnection' object has no attribute 'proxy_host'
Summary: AttributeError: 'ContentConnection' object has no attribute 'proxy_host'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager
Version: 6.9
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: William Poteat
QA Contact: John Sefler
URL:
Whiteboard:
: 1409004 (view as bug list)
Depends On:
Blocks: 1306058 1401884
TreeView+ depends on / blocked
 
Reported: 2016-12-01 22:59 UTC by John Sefler
Modified: 2017-03-21 10:57 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-21 10:57:40 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin python-rhsm pull 194 0 None None None 2016-12-08 23:14:08 UTC
Red Hat Bugzilla 1409004 1 None None None 2021-01-20 06:05:38 UTC
Red Hat Product Errata RHSA-2017:0698 0 normal SHIPPED_LIVE Moderate: subscription-manager security, bug fix, and enhancement update 2017-03-21 12:39:12 UTC

Internal Links: 1409004

Description John Sefler 2016-12-01 22:59:47 UTC
Description of problem:
When attempting to list available releases after attaching a RHEL subscription, this traceback is thrown when using a proxy, but works fine when not using a proxy.

[root@jsefler-rhel6 ~]# tail -f /var/log/rhsm/rhsm.log
2016-12-01 17:35:53,369 [DEBUG] subscription-manager:11858:MainThread @connection.py:309 - Loading CA certificate: '/etc/pki/entitlement/1595989299943042860.pem'
2016-12-01 17:35:53,370 [DEBUG] subscription-manager:11858:MainThread @connection.py:281 - Using proxy: auto-services.usersys.redhat.com:3128
2016-12-01 17:35:53,370 [ERROR] subscription-manager:11858:MainThread @managercli.py:177 - exception caught in subscription-manager
2016-12-01 17:35:53,370 [ERROR] subscription-manager:11858:MainThread @managercli.py:178 - 'ContentConnection' object has no attribute 'proxy_host'
Traceback (most recent call last):
  File "/usr/sbin/subscription-manager", line 81, in <module>
    sys.exit(abs(main() or 0))
  File "/usr/sbin/subscription-manager", line 72, in main
    return managercli.ManagerCLI().main()
  File "/usr/lib/python2.6/site-packages/subscription_manager/managercli.py", line 2768, in main
    return CLI.main(self)
  File "/usr/lib/python2.6/site-packages/subscription_manager/cli.py", line 160, in main
    return cmd.main()
  File "/usr/lib/python2.6/site-packages/subscription_manager/managercli.py", line 537, in main
    return_code = self._do_command()
  File "/usr/lib/python2.6/site-packages/subscription_manager/managercli.py", line 1458, in _do_command
    releases = self.release_backend.get_releases()
  File "/usr/lib/python2.6/site-packages/subscription_manager/release.py", line 48, in get_releases
    return provider.get_releases()
  File "/usr/lib/python2.6/site-packages/subscription_manager/release.py", line 125, in get_releases
    data = self.content_connection.get_versions(listing_path)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 327, in get_versions
    results = self._request("GET", handler, body="")
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 285, in _request
    conn = httplib.HTTPSConnection(self.proxy_host, self.proxy_port, context=context, timeout=self.timeout)
AttributeError: 'ContentConnection' object has no attribute 'proxy_host'




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.5-1.el6
python-rhsm: 1.18.5-1.el6


How reproducible:


Steps to Reproduce:
[root@jsefler-rhel6 ~]# subscription-manager config --server.proxy_hostname=auto-services.usersys.redhat.com --server.proxy_port=3129
[root@jsefler-rhel6 ~]# 
[root@jsefler-rhel6 ~]# subscription-manager register --auto-attach --serverurl=subscription.rhsm.stage.redhat.com
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: stage_auto_testuser1
Password: 
The system has been registered with ID: 130d5672-aa98-49e0-91c4-c41692d5c9e6 

Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

[root@jsefler-rhel6 ~]# subscription-manager release --list
'ContentConnection' object has no attribute 'proxy_host'
[root@jsefler-rhel6 ~]# 

BANG! ContentConnection' object has no attribute 'proxy_host'  That was not expected.
Realize that the proxy setting was valid and traffic successfully flowed through the proxy during the registration step.  Now when I remove the proxy confguration, you'll see that the request is successful...

 [root@jsefler-rhel6 ~]# subscription-manager config --server.proxy_hostname="" --server.proxy_port="" --server.proxy_user="" --server.proxy_password=""
[root@jsefler-rhel6 ~]# 
[root@jsefler-rhel6 ~]# subscription-manager release --list
+-------------------------------------------+
          Available Releases
+-------------------------------------------+
6.1
6.2
6.3
6.4
6.5
6.6
6.7
6.8
6Server
[root@jsefler-rhel6 ~]# 

WORKS! with no proxy, but....

[root@jsefler-rhel6 ~]# subscription-manager release --list --proxy=auto-services.usersys.redhat.com:3129
'ContentConnection' object has no attribute 'proxy_host'
[root@jsefler-rhel6 ~]# 
[root@jsefler-rhel6 ~]# subscription-manager release --list --proxy=auto-services.usersys.redhat.com:3128 --proxyuser=redhat --proxypassword=redhat
'ContentConnection' object has no attribute 'proxy_host'
[root@jsefler-rhel6 ~]# 

FAILS! with two different proxys (both auth and no-auth)




Actual results:
'ContentConnection' object has no attribute 'proxy_host'

Expected results:
+-------------------------------------------+
          Available Releases
+-------------------------------------------+
6.1
6.2
6.3
6.4
6.5
6.6
6.7
6.8
6Server


Additional info:

Comment 3 Chris Snyder 2016-12-08 23:14:09 UTC
Moving this to POST as the fix has been merged upstream.

Comment 5 Rehana 2016-12-12 11:52:13 UTC
Reproducing the failure:
=========================

# subscription-manager config --server.proxy_hostname=auto-services.usersys.redhat.com --server.proxy_port=3129

# subscription-manager register --auto-attach --serverurl=subscription.rhsm.stage.redhat.com
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: <username>
Password: 
The system has been registered with ID: 38c23c0f-46e2-47ec-be47-fb363135aaff 

Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

# subscription-manager release --list
'ContentConnection' object has no attribute 'proxy_host'
# subscription-manager release --list --proxy=auto-services.usersys.redhat.com:3128 --proxyuser=redhat --proxypassword=redhat
'ContentConnection' object has no attribute 'proxy_host'

Verifying with : 

#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 config --server.proxy_hostname=auto-services.usersys.redhat.com --server.proxy_port=3129

# subscription-manager register --auto-attach --serverurl=subscription.rhsm.stage.redhat.com
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: username
Password: 
The system has been registered with ID: ebf6c00a-c93d-41f3-a97c-7711ce9066f3 

Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

# subscription-manager release --list
+-------------------------------------------+
          Available Releases
+-------------------------------------------+
6.1
6.2
6.3
6.4
6.5
6.6
6.7
6.8
6Server
# subscription-manager release --list --proxy=auto-services.usersys.redhat.com:3128 --proxyuser=redhat --proxypassword=redhat
+-------------------------------------------+
          Available Releases
+-------------------------------------------+
6.1
6.2
6.3
6.4
6.5
6.6
6.7
6.8
6Server


# subscription-manager config --server.proxy_hostname="" --server.proxy_port="" --server.proxy_user="" --server.proxy_password=""

# subscription-manager release --list
+-------------------------------------------+
          Available Releases
+-------------------------------------------+
6.1
6.2
6.3
6.4
6.5
6.6
6.7
6.8
6Server

Observed that now release list works with auth and no-auth proxy. Also demonstrated that with no-proxy release list works as earlier. 

Marking as Verified!!

Comment 6 Kevin Howell 2017-01-03 15:40:57 UTC
*** Bug 1409004 has been marked as a duplicate of this bug. ***

Comment 8 errata-xmlrpc 2017-03-21 10:57:40 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


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