Bug 135111 - up2date --whatprovides crashes when server connection refused (urllib2.URLError)
Summary: up2date --whatprovides crashes when server connection refused (urllib2.URLError)
Alias: None
Product: Fedora
Classification: Fedora
Component: up2date (Show other bugs)
(Show other bugs)
Version: 5
Hardware: i686 Linux
Target Milestone: ---
Assignee: Bret McMillan
QA Contact: Fanny Augustin
Depends On:
TreeView+ depends on / blocked
Reported: 2004-10-08 18:20 UTC by Andrew D. Stadler
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-10-29 14:24:47 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

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

How reproducible:

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
using mirror: http://mirror.eas.muohio.edu/fedora/linux/core/2/i386/os/
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
    package_list = availablePackageList(
  File "/usr/share/rhn/up2date_client/rhnPackageInfo.py", line 153, in
    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
    return self.handlers[channel['type']].listPackages(channel,
msgCallback, progressCallback)
  File "/usr/share/rhn/up2date_client/rpmSource.py", line 226, in
    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
  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
using mirror:
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

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:
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.

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