Bug 433840

Summary: RHN yum plugin cannot connect to the IBM RHN Satellite over a HTTP Proxy
Product: Red Hat Enterprise Linux 5 Reporter: IBM Bug Proxy <bugproxy>
Component: yum-rhn-pluginAssignee: John Matthews <jmatthew>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: 5.1.zCC: cperry
Target Milestone: rc   
Target Release: ---   
Hardware: ia32e   
OS: All   
URL: ARRAY(0x8bcb40)
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-02-20 22:53:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description IBM Bug Proxy 2008-02-21 17:32:39 UTC
=Comment: #0=================================================
Christian Ambach <CAMBACH1.com> - 2008-02-20 11:39 EDT
---Problem Description---
RHN yum plugin cannot connect to the IBM RHN Satellite over a HTTP Proxy
 
Contact Information = Christian Ambach / cambach1.com
 
---uname output---
Linux host 2.6.18-53.el5 #1 SMP Wed Oct 10 16:34:02 EDT 2007 i686 i686 i386
GNU/Linux
 
Machine Type = HS20
 
---Debugger---
A debugger is not configured
 
---Steps to Reproduce---
change the up2date config to use a http proxy
my settings in /etc/sysconfig/rhn/up2date:
enableProxy=1
httpProxy=proxy:80

With that configuration all RHN related applications fail to work and the proxy
complains about a bad HTTP request:
[Wed Feb 20 17:32:47 2008] [error] [client 1.1.1.1] client sent HTTP/1.1 request
without hostname (see RFC2616 section 14.23): /

Sample command outputs:

[root@host~]# rhn_check -v
D: check_action {'action': "<?xml
version='1.0'?>\n<methodCall>\n<methodName>errata.update</methodName>\n<params>\n<param>\n<value><array><data>\n<value><int>3613</int></value>\n</data></array></value>\n</param>\n</params>\n</methodCall>\n",
'version': 2, 'id': 461385}
updating login info
logging into up2date server
successfully retrieved authentication token from up2date server
D: logininfo: {'X-RHN-Server-Id': 1000059841, 'X-RHN-Auth-Server-Time':
'1203525452.4', 'X-RHN-Auth': 'G+ckWN+zRdIPeyB3bjJUzA==', 'X-RHN-Auth-Channels':
[['rhel-i386-server-5', '20080220003217', '1', '1']], 'X-RHN-Auth-User-Id': '',
'X-RHN-Auth-Expire-Offset': '3600.0'}
D: handle_action {'action': "<?xml
version='1.0'?>\n<methodCall>\n<methodName>errata.update</methodName>\n<params>\n<param>\n<value><array><data>\n<value><int>3613</int></value>\n</data></array></value>\n</param>\n</params>\n</methodCall>\n",
'version': 2, 'id': 461385}
D: handle_action actionid = 461385, version = 2
D: do_call errata.update ([3613],)
D: Called update [['kernel-doc', 0, 0, ''], ['kernel', 0, 0, ''],
['kernel-headers', 0, 0, ''], ['kernel-devel', 0, 0, '']]
Loading "installonlyn" plugin
Loading "rhnplugin" plugin
D: Sending back response ((6,), 'Fatal error in Python code occured', {})
D: check_action {'action': "<?xml
version='1.0'?>\n<methodCall>\n<methodName>errata.update</methodName>\n<params>\n<param>\n<value><array><data>\n<value><int>3620</int></value>\n</data></array></value>\n</param>\n</params>\n</methodCall>\n",
'version': 2, 'id': 461386}
updating login info
logging into up2date server
successfully retrieved authentication token from up2date server
D: logininfo: {'X-RHN-Server-Id': 1000059841, 'X-RHN-Auth-Server-Time':
'1203525455.26', 'X-RHN-Auth': 'R4S55O+yPoSMDufifGZoEw==',
'X-RHN-Auth-Channels': [['rhel-i386-server-5', '20080220003217', '1', '1']],
'X-RHN-Auth-User-Id': '', 'X-RHN-Auth-Expire-Offset': '3600.0'}
D: handle_action {'action': "<?xml
version='1.0'?>\n<methodCall>\n<methodName>errata.update</methodName>\n<params>\n<param>\n<value><array><data>\n<value><int>3620</int></value>\n</data></array></value>\n</param>\n</params>\n</methodCall>\n",
'version': 2, 'id': 461386}
D: handle_action actionid = 461386, version = 2
D: do_call errata.update ([3620],)
D: Called update [['device-mapper-multipath', 0, 0, ''], ['kpartx', 0, 0, '']]
Loading "installonlyn" plugin
Loading "installonlyn" plugin
Loading "rhnplugin" plugin
Loading "rhnplugin" plugin
D: Sending back response ((6,), 'Fatal error in Python code occured', {})

[root@stoneblade1 ~]# yum update
Loading "security" plugin
Loading "installonlyn" plugin
Loading "rhnplugin" plugin
Setting up Update Process
Setting up repositories
Error: Cannot open/read repomd.xml file for repository: rhel-i386-server-5

 
---System Management Component Data---
Userspace tool common name: yum

System management type: BladeCenter MM

The userspace tool has the following bit modes: both

Userspace rpm: yum-rhn-plugin

Userspace tool obtained from project website: 0.5.2-5.el5_1.2
 
*Additional Instructions for Christian Ambach / cambach1.com: 
-Post a private note with access information to the machine that the bug is
occuring on.
-Attach ltrace and strace of userspace application.
-Attach screen shoot of System Managment Utility


======================================================================================================
we were able to find a solution for this problem on:

http://adumont.serveblog.net/2008/02/07/rhel5-yum-proxy-error/


which basically says  The solution is to edit
/usr/lib/python2.4/site-packages/M2Crypto/httpslib.py in the machine and add the
following line, between lines 165 and 166

 msg = msg + "Host: %s:%d\r\n" % (self._real_host, self._real_port)

The code will then look like this: 

def <em>get</em>connect_msg(self):
        """ Return an HTTP CONNECT request to send to the proxy. """
        msg = "CONNECT %s:%d HTTP/1.1\r\n" % (self._real_host, self._real_port)
        msg = msg + "Host: %s:%d\r\n" % (self._real_host, self._real_port)</b>
        if self._proxy_auth:
            msg = msg + "%s: %s\r\n" % (self._AUTH_HEADER, self._proxy_auth)
        msg = msg + "\r\n"
        return msg

I also found similar bugs on Redhat Bugzilla on :

https://bugzilla.redhat.com/show_bug.cgi?id=208852

However this errata refers to yum-rhn-plugin-0.5.2-3.el5, and our  installed version is 
yum-rhn-plugin-0.5.2-5.el5_1.2  which is newer. I also checked the Knowledge base and was able to
find asimilar error

http://kbase.redhat.com/faq/FAQ_49_10220.shtm

Redhat, we were wondering if this fix will be included in Redhat Enterprise Linux version 5.2.

Thank you.

Comment 1 IBM Bug Proxy 2008-03-12 17:32:57 UTC
------- Comment From CAMBACH1.com 2008-03-12 13:30 EDT-------
seems to be fixed in m2crypto-0.16-6.el5.2.x86_64.rpm which is part of the
RHEL5.2-Server-20080303.0-x86_64-DVD.iso

Comment 2 Clifford Perry 2009-02-20 21:54:50 UTC
Based on comment #1 - closing this out as fixed in current release.

Comment 3 RHEL Program Management 2009-02-20 22:53:11 UTC
Development Management has reviewed and declined this request.  You may appeal
this decision by reopening this request.