Bug 119305 - up2date --register fails in findHostByRoute if proxy has no service on port 80
Summary: up2date --register fails in findHostByRoute if proxy has no service on port 80
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: up2date
Version: 3.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Adrian Likins
QA Contact: Fanny Augustin
URL:
Whiteboard:
Keywords:
Depends On:
Blocks: up2date-rhel3-u2
TreeView+ depends on / blocked
 
Reported: 2004-03-29 10:12 UTC by Daniel Riek
Modified: 2007-11-30 22:07 UTC (History)
0 users

(edit)
Clone Of:
(edit)
Last Closed: 2004-04-05 19:45:06 UTC


Attachments (Terms of Use)

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))) 


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