Bug 119305

Summary: up2date --register fails in findHostByRoute if proxy has no service on port 80
Product: Red Hat Enterprise Linux 3 Reporter: Daniel Riek <riek>
Component: up2dateAssignee: Adrian Likins <alikins>
Status: CLOSED NEXTRELEASE QA Contact: Fanny Augustin <fmoquete>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-04-05 19:45:06 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:
Bug Depends On:    
Bug Blocks: 119505    

Description Daniel Riek 2004-03-29 10:12:58 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040312

Description of problem:
The findHostByRoute function in
/usr/share/rhn/up2date_client/hardware.py fails to connect to the
proxy if there is no service on port 80 due to a hardcoded "80" in
s.connect:

    if cfg['enableProxy']:
        server_port = up2dateUtils.getProxySetting()
        server = string.split(server_port, ':')[0]
    s.connect((server, 80))




Version-Release number of selected component (if applicable):
up2date-4.2.5-1

How reproducible:
Sometimes

Steps to Reproduce:
1. Configure a proxy that has no service on port 80
2. Configure Up2date to use that proxy
3. Try to register
    

Actual Results:  [steiale@redadmin steiale]$ up2date
Traceback (most recent call last):
  File "/usr/share/rhn/up2date_client/gui.py", line 752, in
onProfilePagePrepare    self.hardware = hardware.Hardware()
  File "/usr/share/rhn/up2date_client/hardware.py", line 517, in Hardware
    ret = read_network()
  File "/usr/share/rhn/up2date_client/hardware.py", line 345, in
read_network
    hostname, ipaddr = findHostByRoute()
  File "/usr/share/rhn/up2date_client/hardware.py", line 320, in
findHostByRoute    s.connect((server, 80))
socket.error: (111, 'Connection refused')

Additional info:

Comment 1 Adrian Likins 2004-03-30 23:32:11 UTC
Should be fixed in 4.2.8 or higher (aka, u3 versions)

Comment 2 Adrian Likins 2004-04-05 19:45:06 UTC
make that the u2 release (second set of updates)

Comment 3 Rick Beldin 2004-05-11 19:27:18 UTC
A possible fix to this: 

In hardware.py in function findHostByRoute() change this: 

     if cfg['enableProxy']:
         server_port = up2dateUtils.getProxySetting()
         server = string.split(server_port, ':')[0]
     s.connect((server, 80))

to this: 

  if cfg['enableProxy']:
        server_port = up2dateUtils.getProxySetting()
        server = string.split(server_port, ':')[0] 
         port = string.split(server_port, ':')[1]
    s.connect((server, int(port)))