Bug 149281

Summary: up2date crashes if files in yum repository aren't readable
Product: Red Hat Enterprise Linux 4 Reporter: Steve Cleveland <steve.cleveland>
Component: up2dateAssignee: Pradeep Kilambi <pkilambi>
Status: CLOSED WONTFIX QA Contact: Ken Reilly <kreilly>
Severity: low Docs Contact:
Priority: medium    
Version: 4.0CC: bernie+fedora, k.georgiou, tsanders
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 13:26:32 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 Steve Cleveland 2005-02-21 22:24:09 UTC
Description of problem:

I have up2date setup with a local yum repositories for errata updates.  I
downloaded the latest kernel packages today and forgot to make them world readable.

I then tried to update one of my client machines to the latest kernel and go the
following error:

Fetching Obsoletes list for channel: rhel4-updates...
 
Name                                    Version        Rel
----------------------------------------------------------
kernel-smp                              2.6.9          5.0.3.EL          i686
 
 
Testing package set / solving RPM inter-dependencies...
########################################
kernel-smp-2.6.9-5.0.3.EL.i
Traceback (most recent call last):
  File "/usr/sbin/up2date", line 1245, in ?
    sys.exit(main() or 0)
  File "/usr/sbin/up2date", line 800, in main
    fullUpdate, dryRun=options.dry_run))
  File "/usr/sbin/up2date", line 1119, in batchRun
    batch.run()
  File "/usr/share/rhn/up2date_client/up2dateBatch.py", line 83, in run
    self.__getPackages()
  File "/usr/share/rhn/up2date_client/up2dateBatch.py", line 164, in __getPackages
    up2date.getPackage(pkg, wrapperUtils.printPkg, wrapperUtils.printRetrieveHash)
  File "/usr/share/rhn/up2date_client/up2date.py", line 178, in getPackage
    buf = rpcServer.doCall(repos.getPackage, pkg, msgCallback, progressCallback)
 File "/usr/share/rhn/up2date_client/rpcServer.py", line 309, in doCall
    ret = apply(method, args, kwargs)
  File "/usr/share/rhn/up2date_client/repoDirector.py", line 35, in getPackage
    return self.handlers[channel['type']].getPackage(pkg, msgCallback,
progressCallback)
  File "/usr/share/rhn/up2date_client/rpmSource.py", line 186, in getPackage
    package = source.getPackage(pkg, MsgCallback, progressCallback)
  File "/usr/share/rhn/up2date_client/repoBackends/yumRepo.py", line 138, in
getPackage
    agent = "Up2date %s/Yum" % up2dateUtils.version())
  File "/usr/share/rhn/up2date_client/repoBackends/urlUtils.py", line 360, in
fetchUrlAndWriteFD
    ret =  readFDBufWriteFD(fh, writefd, progressCallback)
  File "/usr/share/rhn/up2date_client/repoBackends/urlUtils.py", line 295, in
readFDBufWriteFD
    amt = size - size_read
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'

Obviously, the problem was that it couldn't download the file, but it should
give an error message to that effect instead of generating a traceback.


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

How reproducible:
Every time

Steps to Reproduce:
1.  Make a package available in a yum repository
2.  Change permissions such that the file isn't accessible (unreadable by the
    web server)
3.  Try to use up2date to install/upgrade the package
  
Actual results:
Traceback dump

Expected results:
An error message indicating that up2date couldn't read/find the file.


Additional info:

Comment 1 Jason Connor 2005-04-14 17:22:53 UTC
Added a check for the read failure, method should now properly return.

Comment 2 Bernie Innocenti 2009-03-18 15:25:23 UTC
Can this bug be closed?

Comment 3 Steve Cleveland 2009-03-18 15:43:56 UTC
I don't have any RHEL4 machines to test with, but I'll assume it's fixed.

Comment 5 Bernie Innocenti 2009-10-05 00:25:10 UTC
(In reply to comment #3)
> I don't have any RHEL4 machines to test with, but I'll assume it's fixed.  

Then you should close the bug yourself (I don't have the necessary permissions).

Comment 6 Jiri Pallich 2012-06-20 13:26:32 UTC
Thank you for submitting this issue for consideration in Red Hat Enterprise Linux. The release for which you requested us to review is now End of Life. 
Please See https://access.redhat.com/support/policy/updates/errata/

If you would like Red Hat to re-consider your feature request for an active release, please re-open the request via appropriate support channels and provide additional supporting details about the importance of this issue.