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 667829 - subscription-manager traceback when proxy_hostname and proxy_port are missing from rhsm.conf
Summary: subscription-manager traceback when proxy_hostname and proxy_port are missing...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager
Version: 6.1
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: rc
: ---
Assignee: Adrian Likins
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks: Entitlement-Beta
TreeView+ depends on / blocked
 
Reported: 2011-01-06 22:36 UTC by John Sefler
Modified: 2011-05-19 13:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-19 13:38:30 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2011:0611 0 normal SHIPPED_LIVE new package: subscription-manager 2011-05-18 17:56:21 UTC

Description John Sefler 2011-01-06 22:36:58 UTC
Description of problem:
The default rhsm.conf values for proxy hostname and password are as follows:
proxy_hostname=
proxy_port=
As such, if these parameters are missing (or commented out) of the rhsm.conf file, then the subscription-manager commands should succeed as if the values were set to the defaults above (nothing).

Version-Release number of selected component (if applicable):
[root@jsefler-onprem01 ~]# rpm -q subscription-manager
subscription-manager-0.93.9-1.git.15.3545a2a.el6.x86_64




Steps to Reproduce:
[root@jsefler-onprem01 ~]# grep proxy_ /etc/rhsm/rhsm.conf
proxy_hostname=
proxy_port=
proxy_user=
proxy_password=
[root@jsefler-onprem01 ~]# subscription-manager register --username=testuser1 --password=password --force
The system with UUID 10b1e7eb-52c5-4e27-9657-e53f2f2c11f0 has been unregistered
c1d4fc1f-3cd4-4dab-929f-3dae03695931 testuser1

^^^ THAT TEST PASSES


[root@jsefler-onprem01 ~]# sed -i s/^proxy_port/#proxy_port/g /etc/rhsm/rhsm.conf; grep proxy_ /etc/rhsm/rhsm.conf
proxy_hostname=
#proxy_port=
proxy_user=
proxy_password=
[root@jsefler-onprem01 ~]# subscription-manager register --username=testuser1 --password=password --force
The system with UUID c1d4fc1f-3cd4-4dab-929f-3dae03695931 has been unregistered
162d03ea-f97d-4ae3-ab00-d49f7c7c2869 testuser1

^^^ THAT TEST PASSES


[root@jsefler-onprem01 ~]# sed -i s/^proxy_hostname/#proxy_hostname/g /etc/rhsm/rhsm.conf; grep proxy_ /etc/rhsm/rhsm.conf
#proxy_hostname=
#proxy_port=
proxy_user=
proxy_password=
[root@jsefler-onprem01 ~]# subscription-manager register --username=testuser1 --password=password --force
Network error, unable to connect to server. Please see /var/log/rhsm/rhsm.log for more information.

^^^ THAT TEST FAILS


[root@jsefler-onprem01 ~]# sed -i s/^#proxy_port/proxy_port/g /etc/rhsm/rhsm.conf; grep proxy_ /etc/rhsm/rhsm.conf
#proxy_hostname=
proxy_port=
proxy_user=
proxy_password=
[root@jsefler-onprem01 ~]# subscription-manager register --username=testuser1 --password=password --force
2b943656-6cf7-4785-8431-51c4d1c0e603 testuser1

^^^ THAT TEST PASSES




For the FAILED test:
# tail -f /var/rhsm/rhsm.log

2011-01-06 17:24:17,360 [ERROR] _do_command() @managercli.py:323 - Unable to un-register consumer: 2b943656-6cf7-4785-8431-51c4d1c0e603
2011-01-06 17:24:17,361 [ERROR] _do_command() @managercli.py:324 - [Errno -8] Servname not supported for ai_socktype
Traceback (most recent call last):
  File "/usr/share/rhsm/managercli.py", line 319, in _do_command
    managerlib.unregister(self.cp, old_uuid)
  File "/usr/share/rhsm/managerlib.py", line 573, in unregister
    uep.unregisterConsumer(consumer_uuid)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 333, in unregisterConsumer
    return self.conn.request_delete(method)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 198, in request_delete
    return self._request("DELETE", method)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 158, in _request
    headers=self.headers)
  File "/usr/lib64/python2.6/httplib.py", line 910, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib64/python2.6/httplib.py", line 947, in _send_request
    self.endheaders()
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 78, in endheaders
    httpslib.HTTPSConnection.endheaders(self)
  File "/usr/lib64/python2.6/httplib.py", line 904, in endheaders
    self._send_output()
  File "/usr/lib64/python2.6/httplib.py", line 776, in _send_output
    self.send(msg)
  File "/usr/lib64/python2.6/httplib.py", line 735, in send
    self.connect()
  File "/usr/lib64/python2.6/site-packages/M2Crypto/httpslib.py", line 169, in connect
    HTTPConnection.connect(self)
  File "/usr/lib64/python2.6/httplib.py", line 716, in connect
    self.timeout)
  File "/usr/lib64/python2.6/socket.py", line 500, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
gaierror: [Errno -8] Servname not supported for ai_socktype
2011-01-06 17:24:17,490 [ERROR] handle_exception() @managercli.py:44 - exception caught in subscription-manager
2011-01-06 17:24:17,491 [ERROR] handle_exception() @managercli.py:45 - [Errno -8] Servname not supported for ai_socktype
Traceback (most recent call last):
  File "/usr/sbin/subscription-manager", line 75, in <module>
    sys.exit(abs(main() or 0))
  File "/usr/sbin/subscription-manager", line 66, in main
    return managercli.CLI().main()
  File "/usr/share/rhsm/managercli.py", line 722, in main
    cmd.main()
  File "/usr/share/rhsm/managercli.py", line 150, in main
    self._do_command()
  File "/usr/share/rhsm/managercli.py", line 335, in _do_command
    facts=self.facts.get_facts())
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 309, in registerConsumer
    return self.conn.request_post('/consumers/', params)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 189, in request_post
    return self._request("POST", method, params)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 158, in _request
    headers=self.headers)
  File "/usr/lib64/python2.6/httplib.py", line 910, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib64/python2.6/httplib.py", line 947, in _send_request
    self.endheaders()
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 78, in endheaders
    httpslib.HTTPSConnection.endheaders(self)
  File "/usr/lib64/python2.6/httplib.py", line 904, in endheaders
    self._send_output()
  File "/usr/lib64/python2.6/httplib.py", line 776, in _send_output
    self.send(msg)
  File "/usr/lib64/python2.6/httplib.py", line 735, in send
    self.connect()
  File "/usr/lib64/python2.6/site-packages/M2Crypto/httpslib.py", line 169, in connect
    HTTPConnection.connect(self)
  File "/usr/lib64/python2.6/httplib.py", line 716, in connect
    self.timeout)
  File "/usr/lib64/python2.6/socket.py", line 500, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
gaierror: [Errno -8] Servname not supported for ai_socktype

Comment 2 Adrian Likins 2011-01-07 18:21:12 UTC
commit 3e593ca8bd4a55e0f5f369d44b7c64334a75c6cc
Author: Adrian Likins <alikins>
Date:   Fri Jan 7 13:14:46 2011 -0500

    667829: handle proxy config options being absent from rhsm.conf
    
    new config class doesn't like settings these to None, so they
    now get set to empty string

The above is in python-rhsm

Comment 3 John Sefler 2011-01-12 16:07:56 UTC
Testing version...
[root@jsefler-onprem01 ~]# rpm -q python-rhsm
python-rhsm-0.94.13-1.git.0.e2a615d.el6.noarch
[root@jsefler-onprem01 ~]# rpm -q subscription-manager
subscription-manager-0.93.11-1.git.0.91f3f0d.el6.x86_64



[root@jsefler-onprem01 ~]# grep proxy_ /etc/rhsm/rhsm.conf
proxy_hostname =
proxy_port = 
proxy_user =
proxy_password =
[root@jsefler-onprem01 ~]# subscription-manager register --username=testuser1 --password=password --force
fc7e4722-2df0-4e79-a462-e25176b230b0 testuser1

^^^ THAT TEST STILL PASSES


[root@jsefler-onprem01 ~]# sed -i s/^proxy_port/#proxy_port/g /etc/rhsm/rhsm.conf; grep proxy_ /etc/rhsm/rhsm.conf
proxy_hostname =
#proxy_port = 
proxy_user =
proxy_password =
[root@jsefler-onprem01 ~]# subscription-manager register --username=testuser1 --password=password --force
The system with UUID fc7e4722-2df0-4e79-a462-e25176b230b0 has been unregistered
dfab0a1f-29cc-4ef9-bb5c-7ac3a494dc8e testuser1

^^^ THAT TEST STILL PASSES


[root@jsefler-onprem01 ~]# sed -i s/^proxy_hostname/#proxy_hostname/g /etc/rhsm/rhsm.conf; grep proxy_ /etc/rhsm/rhsm.conf
#proxy_hostname =
#proxy_port = 
proxy_user =
proxy_password =
[root@jsefler-onprem01 ~]# subscription-manager register --username=testuser1 --password=password --force
The system with UUID dfab0a1f-29cc-4ef9-bb5c-7ac3a494dc8e has been unregistered
73a9391b-d1a5-42d9-a443-7dd699b68953 testuser1

^^^ THAT TEST NOW PASSES WITH FIX FOR THIS BUGZILLA...   VERIFIED


[root@jsefler-onprem01 ~]# sed -i s/^#proxy_port/proxy_port/g /etc/rhsm/rhsm.conf; grep proxy_ /etc/rhsm/rhsm.conf
#proxy_hostname =
proxy_port = 
proxy_user =
proxy_password =
[root@jsefler-onprem01 ~]# subscription-manager register --username=testuser1 --password=password --force
The system with UUID 73a9391b-d1a5-42d9-a443-7dd699b68953 has been unregistered
ad100cbe-5ea5-4a31-9b77-5044787a9ad1 testuser1

^^^ THAT TEST STILL PASSES


moving to VERIFIED

Comment 4 errata-xmlrpc 2011-05-19 13:38:30 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2011-0611.html


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