Bug 191773

Summary: rhnlib throws a generic Exception when a file isn't found
Product: Red Hat Enterprise Linux 3 Reporter: James Bowes <jbowes>
Component: rhnlibAssignee: Bryan Kearney <bkearney>
Status: CLOSED ERRATA QA Contact: Beth Nackashi <bnackash>
Severity: medium Docs Contact:
Priority: high    
Version: 3.0CC: bkearney
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2006-0465 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-08-29 15:34:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 126528    

Description James Bowes 2006-05-15 18:13:47 UTC
Previous versions of rhnlib would throw a FileNotFoundError when a requested
file was not found on the server. The new version just throws a generic
Exception, making it impossible to detect further up in the code.

When up2date is called to get a source package it uses the FileNotFoundError to
display a warning or error to the user. The current version drops the user to
the command line and instructs them to look in the log file to see what the
problem was.

Comment 1 James Bowes 2006-05-15 18:19:25 UTC
Copied from bug 126528:

"Retrieval/Installation" corresponds to "retrieveSource" (Comment: Retrieve
source RPM along with binary package) in the --nox version of up2date.

Packages tested:
up2date-4.4.69-8
rhnlib-1.8.7-1

This does not fail cleanly as hoped:

[root@test07 root]# up2date --get acroread

Fetching all package list for channel: rhel-i386-as-3...
########################################

Fetching all package list for channel: rhel-i386-as-3-extras...
########################################

Fetching all package list for channel: rhn-tools-rhel-3-as-i386...
########################################

Fetching all package list for channel: rhel-i386-as-3-fastrack...
########################################

Fetching package list for channel: rhel-i386-as-3...
########################################

Fetching package list for channel: rhel-i386-as-3-extras...
########################################

Fetching package list for channel: rhn-tools-rhel-3-as-i386...
########################################

Fetching package list for channel: rhel-i386-as-3-fastrack...
########################################

acroread-7.0.1-1.1.0.EL3.i386.rpm...
########################################
An error has occurred:
exceptions.Exception
See /var/log/up2date for more information

[Mon May 15 12:15:19 2006] up2date   File "/usr/sbin/up2date", line 1282, in ?
    sys.exit(main() or 0)
   File "/usr/sbin/up2date", line 708, in main
    return getPackages(pkgNames)
   File "/usr/sbin/up2date", line 1062, in getPackages
    onlySource = source)
   File "/usr/share/rhn/up2date_client/up2date.py", line 188, in getPackage
    msgCallback, progressCallback)
   File "/usr/share/rhn/up2date_client/rpcServer.py", line 236, in doCall
    ret = apply(method, args, kwargs)
   File "/usr/share/rhn/up2date_client/repoDirector.py", line 40, in
getPackageSource
    return self.handlers[channel['type']].getPackageSource(channel, pkg,
msgCallback, progressCallback)
   File "/usr/share/rhn/up2date_client/rpmSource.py", line 201, in getPackageSource
    MsgCallback, progressCallback)
   File "/usr/share/rhn/up2date_client/repoBackends/up2dateRepo.py", line 242,
in getPackageSource
    fd = self.s.getPackageSource(channel['label'], filename)
   File "/usr/lib/python2.2/site-packages/rhn/rpclib.py", line 609, in __call__
    result = self._send(self._name, args)
   File "/usr/lib/python2.2/site-packages/rhn/rpclib.py", line 397, in _request
    raise Exception("Error requesting with the server:: error code:: %s" %
save_response)

Comment 2 Beth Nackashi 2006-06-01 15:12:46 UTC
latest up2date and rhnlib packages:

/dist/3.0E-U8/up2date/4.4.69-10
/dist/3.0E-U8/rhnlib/1.8.7-3



Comment 3 Beth Nackashi 2006-06-01 17:07:39 UTC
If the source RPM is not found, the FileNotFoundError now actually prints a
warning to stdout:

"warning: source RPM for acroread was not found."