Bug 112686

Summary: up2date hangs when retrieving package headers
Product: [Fedora] Fedora Reporter: Peter Robinson <pbrobinson>
Component: up2dateAssignee: Adrian Likins <alikins>
Status: CLOSED WONTFIX QA Contact: Fanny Augustin <fmoquete>
Severity: medium Docs Contact:
Priority: medium    
Version: 1CC: david_costanzo
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: 2006-02-22 17:53:58 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: 124619    

Description Peter Robinson 2003-12-28 05:48:50 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1)
Gecko/20031114

Description of problem:
up2date will hang (both the latest rawhide/fedora devel version and
the fedora core1 vers) when retrieving the list of updates for the
fedora devel list (totalling some 548 packages at this date for an
update from FC1 to devel ver). It appears that there is a max and min
value set for the updating of the progress bar and actual retrieval of
packages and the max value is smaller than the actual number packages
to be retrieved and when it reaches that value it can't go any further
and hence locks up with the output below.

[root@neo up2date]# up2date
Traceback (most recent call last):
  File "/usr/share/rhn/up2date_client/gui.py", line 1360, in
onChannelsPageNext
    self.pkgList = self.pList.getPackagesToInstall()
  File "/usr/share/rhn/up2date_client/packageList.py", line 558, in
getPackagesToInstall
    result = self.__skipPackages(result)
  File "/usr/share/rhn/up2date_client/packageList.py", line 587, in
__skipPackages
    packageList = self.__skipFiles(packageList)
  File "/usr/share/rhn/up2date_client/packageList.py", line 608, in
__skipFiles
    ignoreMsgCallback = self.ignoreMsgCallback)
  File "/usr/share/rhn/up2date_client/packageList.py", line 647, in
buildHeaderList
    hdr = headerList[pkg]
  File "/usr/share/rhn/up2date_client/headers.py", line 37, in __getitem__
    self.__retrievePackage(item)
  File "/usr/share/rhn/up2date_client/headers.py", line 42, in
__retrievePackage
    hdr, sourceType = rpcServer.doCall(self.repos.getHeader, item)
  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 31, in
getHeader
    return self.handlers[channel['type']].getHeader(pkg, msgCallback,
progressCallback)
  File "/usr/share/rhn/up2date_client/rpmSource.py", line 210, in
getHeader
    header = source.getHeader(pkg, progressCallback = progressCallback)
  File "/usr/share/rhn/up2date_client/repoBackends/yumRepo.py", line
90, in getHeader
    (fn, h) = urllib.urlretrieve(url)
  File "/usr/lib/python2.2/urllib.py", line 80, in urlretrieve
    return _urlopener.retrieve(url, filename, reporthook, data)
  File "/usr/lib/python2.2/urllib.py", line 232, in retrieve
    block = fp.read(bs)
  File "/usr/lib/python2.2/httplib.py", line 1140, in read
    assert not self._line_consumed and self._line_left
AssertionError
Traceback (most recent call last):
  File "/usr/share/rhn/up2date_client/gui.py", line 1439, in
onSkippedPagePrepare
    maxlength = max(map(lambda x: len(x[0][0]), self.skipPkgList)) * 8
ValueError: min() or max() arg is an empty sequence


Version-Release number of selected component (if applicable):
up2date-4.3.1-2

How reproducible:
Always

Steps to Reproduce:
1. Add devel option to /etc/sysconfig/rhn/sources
2. Run up2date from a terminal window to get console output from up2date
3. Select just the devel option to update
4. Will crash with output as it retrieves the headers
5. Can restart the process and will start off from where it got to and
will continue the process and crash again
    

Actual Results:  Application lock up with included output

Expected Results:  Download of all headers for update

Additional info:

Comment 1 David Costanzo 2005-05-15 04:08:19 UTC
I get the same behavior on my Fedora Core 4 Test 2 using up2date-gnome-4.4.17.
If I run "up2date-nox -u" or uninstall "up2date-gnome" and run "up2date -u",
then up2date does not hang or display any exceptions.  Instead it aborts because
one of the packages does not have a GPG signature (I think that's a separate
problem).

When up2date hangs, there is no CPU or network activity.

My output is:

Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/sbin/up2date", line 1231, in exceptionHandler
    log = up2dateLog.initLog()
NameError: global name 'up2dateLog' is not defined

Original exception was:
Traceback (most recent call last):
  File "/usr/share/rhn/up2date_client/gui.py", line 1311, in onChannelsPageNext
    self.pList.run()
  File "/usr/share/rhn/up2date_client/packageList.py", line 125, in run
    self.progressCallback)
  File "/usr/share/rhn/up2date_client/rhnPackageInfo.py", line 331, in
getAvailableAllArchPackageList
    package_list = availablePackageList(
  File "/usr/share/rhn/up2date_client/rhnPackageInfo.py", line 153, in
availablePackageList    repos = repoDirector.initRepoDirector()
  File "/usr/share/rhn/up2date_client/repoDirector.py", line 75, in initRepoDirector
    from repoBackends import repomdRepo
  File "/usr/share/rhn/up2date_client/repoBackends/repomdRepo.py", line 16, in ?
    import yumBaseRepo
  File "/usr/share/rhn/up2date_client/repoBackends/yumBaseRepo.py", line 14, in ?
    import yum
  File "/usr/share/rhn/__init__.py", line 32, in ?

ImportError: No module named updates
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/sbin/up2date", line 1231, in exceptionHandler
    log = up2dateLog.initLog()
NameError: global name 'up2dateLog' is not defined

Original exception was:
Traceback (most recent call last):
  File "/usr/share/rhn/up2date_client/gui.py", line 1393, in onSkippedPagePrepare
    maxlength = max(map(lambda x: len(x[0][0]), self.skipPkgList)) * 8
ValueError: max() arg is an empty sequence


There are three exceptions.  The only one that I have in common with the
original bug report is the one in /usr/share/rhn/up2date_client/gui.py:1393:

    maxlength = max(map(lambda x: len(x[0][0]), self.skipPkgList)) * 8

The problem seems to be that the code does not gracefully handle when
self.skipPkgList is empty.

I tried making the code look like:

  maxlength = 100
  if len(self.skipPkgList) != 0 :
      maxlength = max(map(lambda x: len(x[0][0]), self.skipPkgList)) * 8

And this did remove the exception, but it did not fix the hang.

Here is a packet sniff of all network activity when running up2date:

> GET /pub/fedora/development/i386//headers/header.info HTTP/1.1

> Accept-Encoding: identity

> Host: sunsite.mff.cuni.cz

> If-modified-since: Sat, 14 May 2005 10:53:23 GMT

> Connection: close

> User-agent: Up2date /Yum


>
< HTTP/1.1 304 Not Modified

< Date: Sun, 15 May 2005 04:00:30 GMT

< Server: Apache/2.0.52 (Fedora)

< Connection: close

< ETag: "32b8068-2f45a-3f70ed4dd2ec0"
<



Comment 2 Peter Robinson 2006-02-22 17:53:58 UTC
Seeing as up2date isn't used anymore and this was in FC1 I think this should be
closed (it is after all my bug :-) I think its the right status....