Bug 664603 - subscription-manager subscribe/unsubscribe with proxy options is broken somewhere
Summary: subscription-manager subscribe/unsubscribe with proxy options is broken somew...
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: 2010-12-20 22:46 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:23 UTC
Target Upstream Version:


Attachments (Terms of Use)


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

Description John Sefler 2010-12-20 22:46:06 UTC
Description of problem:
The test is to verify that subscribe/unsubscribe with proxy options will override the rhsm.conf parameters.  However there is a failure somewhere and the subscribe seems to "half succeed".  Follow the reproduction steps...


Version-Release number of selected component (if applicable):
[root@jsefler-onprem02 ~]# rpm -q subscription-manager
subscription-manager-0.93.7-1.git.2.5a5df9e.el6.x86_64




Steps to Reproduce:

BEGIN BY EDITING THE proxy* PARAMETERS IN rhsm.conf TO BAD VALUES...
[root@jsefler-onprem02 ~]# grep proxy /etc/rhsm/rhsm.conf
# an http proxy server to use
proxy_hostname = XXXX
# port for http proxy server
proxy_port =  #####
# user name for authenticating to an http proxy, if needed
proxy_user = UUUUU
# password for basic http proxy auth, if needed
proxy_password = PPPP

[root@jsefler-onprem02 ~]# subscription-manager register --username=testuser1 --password=password --proxy=auto-services.usersys.redhat.com:3128 --proxyuser=redhat --proxypassword=redhat
2ea229bc-3d43-4e51-9fe9-dc61ddf3dd56 testuser1

[root@jsefler-onprem02 ~]# subscription-manager list --available --proxy=auto-services.usersys.redhat.com:3128 --proxyuser=redhat --proxypassword=redhat | grep PoolId
PoolId:            	ff8080812d047dd4012d047eb5fa01f5
PoolId:            	ff8080812d047dd4012d047eb56701d2

[root@jsefler-onprem02 ~]# rm /var/log/rhsm/rhsm.log
rm: remove regular file `/var/log/rhsm/rhsm.log'? y

[root@jsefler-onprem02 ~]# subscription-manager subscribe --pool=ff8080812d047dd4012d047eb56701d2 --proxy=auto-services.usersys.redhat.com:3128 --proxyuser=redhat --proxypassword=redhat
Network error, unable to connect to server. Please see /var/log/rhsm/rhsm.log for more information.

^^^^  I EXPECTED THAT COMMAND TO PASS WITH THE PROXY PARAMETERS SPECIFIED ON THE COMMAND LINE TO OVERRIDE THE rhsm.conf VALUES.  HERE"S THE rhsm.log...

[root@jsefler-onprem02 ~]# cat /var/log/rhsm/rhsm.log
2010-12-20 17:24:23,472 [INFO] _do_command() @managercli.py:439 - Info: Successfully subscribed the machine the Entitlement Pool ff8080812d047dd4012d047eb56701d2
2010-12-20 17:24:23,484 [ERROR] handle_exception() @managercli.py:44 - Unable to subscribe: [Errno -8] Servname not supported for ai_socktype
2010-12-20 17:24:23,484 [ERROR] handle_exception() @managercli.py:45 - [Errno -8] Servname not supported for ai_socktype
Traceback (most recent call last):
  File "/usr/share/rhsm/managercli.py", line 449, in _do_command
    result = self.certlib.update()
  File "/usr/share/rhsm/certlib.py", line 60, in update
    return action.perform()
  File "/usr/share/rhsm/certlib.py", line 132, in perform
    expected = self.getExpected(report)
  File "/usr/share/rhsm/certlib.py", line 180, in getExpected
    exp = self.getCertificateSerialsList()
  File "/usr/share/rhsm/certlib.py", line 173, in getCertificateSerialsList
    reply = self.uep.getCertificateSerials(self._getConsumerId())
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 344, in getCertificateSerials
    return self.conn.request_get(method)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 179, in request_get
    return self._request("GET", method)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 151, 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 71, 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



FOR THE FUN OF IT, LET"S TRY THE SAME SUBSCRIBE ATTEMPT...
[root@jsefler-onprem02 ~]# subscription-manager subscribe --pool=ff8080812d047dd4012d047eb56701d2 --proxy=auto-services.usersys.redhat.com:3128 --proxyuser=redhat --proxypassword=redhat
This consumer is already subscribed to the product matching pool with id 'ff8080812d047dd4012d047eb56701d2'
Network error, unable to connect to server. Please see /var/log/rhsm/rhsm.log for more information.


WHAT IS THAT? ^^^^^  HOW IS IT THAT I AM ALREADY SUBSCRIBED?  THE FIRST ATTEMPT TO SUBSCRIBE WAS A FAILURE WITH A NETWORK ERROR.

[root@jsefler-onprem02 ~]# ls /etc/pki/entitlement/
[root@jsefler-onprem02 ~]# 


IT APPEARS THAT THE SUBSCRIBE IS "HALF SUCCESSFUL".  THERE IS NO ENTITLEMENT CERT ON MY SYSTEM.



SOMETHING SIMILAR HAPPENS WITH UNSUBSCRIBE:
[root@jsefler-onprem02 ~]# subscription-manager unsubscribe --all --proxy=auto-services.usersys.redhat.com:3128 --proxyuser=redhat --proxypassword=redhat
Network error, unable to connect to server. Please see /var/log/rhsm/rhsm.log for more information.

Comment 2 Adrian Likins 2011-01-05 16:04:44 UTC
I can't reproduce this with git HEAD. I think the following commit fixed it:


commit a5b32253ed40b7a292c89dfa42f382fd4e762856
Author: Adrian Likins <alikins@redhat.com>
Date:   Tue Jan 4 10:01:10 2011 -0500

    664548: Fix for some subcommands (refresh ) not using proxy info as well
    
    Move where we create the cp/uep object for cli modules. Also gets
    rid of half a dozen unneeded uep creations on cli startup.


I try to reproduce with:

1. add bogus proxy values in /etc/rhsm/rhsm.conf
2. register with --proxy alikins.usersys.redhat.com:3128 --proxyuser redhat --proxypassword redhat
   (valid proxy options)
3. list available with above proxy options
4. subscribe --pool SOMEIDFROMAVAILABLE with above proxy options

Seemed to subscribe fine. No network errors in the logs, identity cert is installed.

Comment 3 John Sefler 2011-01-06 21:55:36 UTC
[root@jsefler-onprem01 ~]# rpm -q subscription-manager
subscription-manager-0.93.9-1.git.15.3545a2a.el6.x86_64

[root@jsefler-onprem01 ~]# vi /etc/rhsm/rhsm.conf
SET THE FOLLOWING BOGUS PROXY VALUES
[root@jsefler-onprem01 ~]# grep proxy /etc/rhsm/rhsm.conf
# an http proxy server to use
proxy_hostname=HHHHH
# port for http proxy server
proxy_port=######
# user name for authenticating to an http proxy, if needed
proxy_user=UUUUU
# password for basic http proxy auth, if needed
proxy_password=PPPPP

[root@jsefler-onprem01 ~]# subscription-manager register --username=testuser1 --password=password --proxy=auto-services.usersys.redhat.com:3128 --proxyuser=redhat --proxypassword=redhat
891cb0cc-522d-4b06-ba41-a88e2cf80bbe testuser1

[root@jsefler-onprem01 ~]# subscription-manager list --available --proxy=auto-services.usersys.redhat.com:3128 --proxyuser=redhat --proxypassword=redhat | grep PoolId
PoolId:            	ff8080812d59b3f8012d59b4f5f10145
PoolId:            	ff8080812d59b3f8012d59b4f7980184
PoolId:            	ff8080812d59b3f8012d59b4f5a30142
PoolId:            	ff8080812d59b3f8012d59b4f6c1015f
PoolId:            	ff8080812d59b3f8012d59b4f7360171
PoolId:            	ff8080812d59b3f8012d59b4f89e01b0
PoolId:            	ff8080812d59b3f8012d59b4f88701a7
PoolId:            	ff8080812d59b3f8012d59b4f6280148
PoolId:            	ff8080812d59b3f8012d59b4f560013f
PoolId:            	ff8080812d59b3f8012d59b4f6a40155
PoolId:            	ff8080812d59b3f8012d59b4f4990137
PoolId:            	ff8080812d59b3f8012d59b4f4240133
PoolId:            	ff8080812d59b3f8012d59b4f8e101c2
PoolId:            	ff8080812d59b3f8012d59b4f90b01ca
PoolId:            	ff8080812d59b3f8012d59b4f9880201
PoolId:            	ff8080812d59b3f8012d59b4fcbe0251
PoolId:            	ff8080812d59b3f8012d59b4f93a01dd
PoolId:            	ff8080812d59b3f8012d59b4f96b01f8
PoolId:            	ff8080812d59b3f8012d59b4f94a01e5
PoolId:            	ff8080812d59b3f8012d59b4f5fe0146
PoolId:            	ff8080812d59b3f8012d59b4f7550176
PoolId:            	ff8080812d59b3f8012d59b4f7b8018d
PoolId:            	ff8080812d59b3f8012d59b4f5710140
PoolId:            	ff8080812d59b3f8012d59b4f5b70143
PoolId:            	ff8080812d59b3f8012d59b4f52e013d
PoolId:            	ff8080812d59b3f8012d59b4f4800136
PoolId:            	ff8080812d59b3f8012d59b4f4df013a
PoolId:            	ff8080812d59b3f8012d59b4f51b013c
PoolId:            	ff8080812d59b3f8012d59b4fcdb0253
PoolId:            	ff8080812d59b3f8012d59b4f6340149
PoolId:            	ff8080812d59b3f8012d59b4f4550134
PoolId:            	ff8080812d59b3f8012d59b4f655014b
PoolId:            	ff8080812d59b3f8012d59b4f664014c
PoolId:            	ff8080812d59b3f8012d59b4f80b0196
PoolId:            	ff8080812d59b3f8012d59b4f4bd0139
PoolId:            	ff8080812d59b3f8012d59b4f7ef0194

[root@jsefler-onprem01 ~]# subscription-manager subscribe --pool=ff8080812d59b3f8012d59b4f7ef0194 --proxy=auto-services.usersys.redhat.com:3128 --proxyuser=redhat --proxypassword=redhat^C

[root@jsefler-onprem01 ~]# subscription-manager subscribe --pool=ff8080812d59b3f8012d59b4f90b01ca --proxy=auto-services.usersys.redhat.com:3128 --proxyuser=redhat --proxypassword=redhat

[root@jsefler-onprem01 ~]# subscription-manager list --consumed
+-------------------------------------------+
    Consumed Product Subscriptions
+-------------------------------------------+


ProductName:        	High availability (cluster suite)
ContractNumber:     	45                       
AccountNumber:      	12331131231              
SerialNumber:       	1129435050768493         
Active:             	True                     
Begins:             	2011-01-05               
Expires:            	2012-01-06               


ProductName:        	RHEL for Physical Servers SVC
ContractNumber:     	45                       
AccountNumber:      	12331131231              
SerialNumber:       	1129435050768493         
Active:             	True                     
Begins:             	2011-01-05               
Expires:            	2012-01-06               


ProductName:        	Shared Storage (GFS)     
ContractNumber:     	45                       
AccountNumber:      	12331131231              
SerialNumber:       	1129435050768493         
Active:             	True                     
Begins:             	2011-01-05               
Expires:            	2012-01-06               


ProductName:        	Smart Management (RHN Management & Provisioning)
ContractNumber:     	45                       
AccountNumber:      	12331131231              
SerialNumber:       	1129435050768493         
Active:             	True                     
Begins:             	2011-01-05               
Expires:            	2012-01-06               


ProductName:        	Large File Support (XFS) 
ContractNumber:     	45                       
AccountNumber:      	12331131231              
SerialNumber:       	1129435050768493         
Active:             	True                     
Begins:             	2011-01-05               
Expires:            	2012-01-06               


ProductName:        	Load Balancing           
ContractNumber:     	45                       
AccountNumber:      	12331131231              
SerialNumber:       	1129435050768493         
Active:             	True                     
Begins:             	2011-01-05               
Expires:            	2012-01-06               

[root@jsefler-onprem01 ~]# subscription-manager unsubscribe --serial=1129435050768493 --proxy=auto-services.usersys.redhat.com:3128 --proxyuser=redhat --proxypassword=redhat
[root@jsefler-onprem01 ~]# subscription-manager list --consumed
No Consumed subscription pools to list


THE COMMAND LINE subscription-manager subscribe/unsubscribe OPTIONS FOR PROXY ARE OVERRIDING THOSE IN rhsm.conf.
Moving to VERIFIED...

Comment 4 errata-xmlrpc 2011-05-19 13:38:23 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.