Bug 135111

Summary: up2date --whatprovides crashes when server connection refused (urllib2.URLError)
Product: [Fedora] Fedora Reporter: Andrew D. Stadler <stadler>
Component: up2dateAssignee: Bret McMillan <bretm>
Status: CLOSED CANTFIX QA Contact: Fanny Augustin <fmoquete>
Severity: medium Docs Contact:
Priority: medium    
Version: 5CC: mattdm
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-10-29 14:24:47 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 Andrew D. Stadler 2004-10-08 18:20:18 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3)
Gecko/20040913 Firefox/0.10

Description of problem:
today I entered the command:

  $ up2date --whatprovides=sendmail-cf

It connected to a mirror didn't work and the connection was refused. 
Instead of handling this error (as any network client should do) it
crashed ans spit out a stack trace.



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

How reproducible:
Sometimes

Steps to Reproduce:
1.  up2date --whatprovides=sendmail-cf
2.  retry a until mirror.eas.muohio.edu is selected (or any other
non-working mirror)

Actual Results:  $ up2date --whatprovides=sendmail-cf
http://fedora.redhat.com/download/up2date-mirrors/fedora-core-2
using mirror: http://mirror.eas.muohio.edu/fedora/linux/core/2/i386/os/
http://fedora.redhat.com/download/up2date-mirrors/updates-released-fc2
using mirror: http://rpmfind.net/linux/fedora/core/updates/2/i386/
Traceback (most recent call last):
  File "/usr/sbin/up2date", line 1271, in ?
    sys.exit(main() or 0)
  File "/usr/sbin/up2date", line 704, in main
    return whatprovides(cfg["depslist"])
  File "/usr/sbin/up2date", line 941, in whatprovides
    availlist = rhnPackageInfo.getAvailablePackageList()
  File "/usr/share/rhn/up2date_client/rhnPackageInfo.py", line 219, in
getAvailablePackageList
    package_list = availablePackageList(
  File "/usr/share/rhn/up2date_client/rhnPackageInfo.py", line 153, in
availablePackageList
    progressCallback = progressCallback)
  File "/usr/share/rhn/up2date_client/rpcServer.py", line 112, in doCall
    ret = apply(method, args, kwargs)
  File "/usr/share/rhn/up2date_client/repoDirector.py", line 20, in
listPackages
    return self.handlers[channel['type']].listPackages(channel,
msgCallback, progressCallback)
  File "/usr/share/rhn/up2date_client/rpmSource.py", line 226, in
listPackages
    msgCallback, progressCallback)
  File "/usr/share/rhn/up2date_client/repoBackends/yumRepo.py", line
201, in listPackages
    agent = "Up2date %s/Yum" % up2dateUtils.version())
  File "/usr/share/rhn/up2date_client/repoBackends/urlUtils.py", line
324, in fetchUrl
    endRange=end)
  File "/usr/share/rhn/up2date_client/repoBackends/urlUtils.py", line
117, in open_resource
    return opener.open(request)
  File "/usr/lib/python2.3/urllib2.py", line 326, in open
    '_open', req)
  File "/usr/lib/python2.3/urllib2.py", line 306, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.3/urllib2.py", line 901, in http_open
    return self.do_open(httplib.HTTP, req)
  File "/usr/lib/python2.3/urllib2.py", line 886, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error (111, 'Connection refused')>


Expected Results:  (1)  If the mirror was available, obviously this
should have succeeded.
(2)  If the connection was refused, *at a minimum* it should catch
this error and print a useful error message.  Simply crashing is not
reasonable behavior for a network client.
(3)  Even better, why doesn't it retry on a different mirror?

Additional info:

I often find that up2date fails when mirror.eas.muohio.edu is
selected.  Why is this non-working mirror provided to up2date?

Comment 1 Matthew Miller 2005-04-26 15:30:51 UTC
Fedora Core 2 is now maintained by the Fedora Legacy project for
security updates only. If this problem is a security issue, please
reopen and reassign to the Fedora Legacy product. If it is not a
security issue and hasn't been resolved in the current FC3 updates or
in the FC4 test release, reopen and change the version to match.

Comment 2 Andrew D. Stadler 2005-05-03 20:43:47 UTC
As of FC3/latest - up2date-4.3.47-5 - it no longer crashes, but it also no
longer seems to be functioning.  I've tried the original command

 $ up2date --whatprovides=sendmail-cf 

as well as a few others e.g.

 $ up2date --whatprovides=rpm
 $ up2date --whatprovides=up2date

And none of these seem to return anything at all.  Just a couple of server
tries, but no packages or dependencies are listed.  e.g.

$ up2date --whatprovides=up2date
http://fedora.redhat.com/download/up2date-mirrors/fedora-core-3
using mirror:
http://www.mirrorservice.org/sites/download.fedora.redhat.com/pub/fedora/linux/core/3/i386/os
http://fedora.redhat.com/download/up2date-mirrors/updates-released-fc3
using mirror: http://ftp.esat.net/pub/linux/fedora/updates/3/i386/
$



Comment 3 Matthew Miller 2006-07-10 20:45:00 UTC
Fedora Core 3 is now maintained by the Fedora Legacy project for security
updates only. If this problem is a security issue, please reopen and
reassign to the Fedora Legacy product. If it is not a security issue and
hasn't been resolved in the current FC5 updates or in the FC6 test
release, reopen and change the version to match.

Thank you!


Comment 4 Andrew D. Stadler 2006-07-11 15:45:07 UTC
I am promoting this to FC5 because now when you try the examples in comment #2, you get not response 
at all!

$ up2date --whatprovides=sendmail-cf 
$ up2date --whatprovides=rpm
$ up2date --whatprovides=up2date
<...crickets...>


Comment 5 Matthew Miller 2006-07-11 16:22:03 UTC
There is no up2date in FC5...

Comment 6 Andrew D. Stadler 2006-07-11 16:26:37 UTC
OK...  Hmm...  Well, I am running FC5 and up2date is definitely there (if not working properly).  Perhaps 
this redefines this bug?

Comment 7 Matthew Miller 2006-07-11 16:27:54 UTC
It may have not gotten removed when you did an upgrade? I always remove up2date,
so I'm not sure myself.

Comment 8 petrosyan 2006-10-18 11:10:30 UTC
Here are all the rpms from FC5:
http://download.fedora.redhat.com/pub/fedora/linux/core/5/i386/os/Fedora/RPMS/
up2date is clearly not there.

Comment 9 Andrew D. Stadler 2006-10-18 17:19:12 UTC
Fair enough.  up2date is not running properly because it is no longer supported.
 I will be happy to resubmit this issue as an installer/upgrade issue.  I don't
know which tool that should be - anaconda? yum? or something else.

Comment 10 John Thacker 2006-10-29 14:24:47 UTC
Removed programs are generally not removed by anaconda on upgrade, since the
user may still want them.  (It would be a bigger headache if they were removed.)
 pirut replaces up2date, but does not explicitly Obsolete it for various
reasons, hence it's not removed.  Please try with pirut/pup.