Bug 607258

Summary: yum localinstall drpms/foo.drpm leads to Traceback
Product: Red Hat Enterprise Linux 6 Reporter: Petr Sklenar <psklenar>
Component: yumAssignee: James Antill <james.antill>
Status: CLOSED ERRATA QA Contact: Karel Srot <ksrot>
Severity: medium Docs Contact:
Priority: high    
Version: 6.0CC: ksrot, syeghiay
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: yum-3.2.29-1.el6 Doc Type: Bug Fix
Doc Text:
Cause: yum tried to use any file that ended in "rpm" Consequence: yum would try to act on ".drpm" files, and fail Fix: check for ".rpm" instead of just "rpm" Result: yum doesn't try to open ".drpm" files.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 13:33:31 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: 582655    

Description Petr Sklenar 2010-06-23 16:22:38 UTC
Description of problem:
yum localinstall foo.drpms leads to Traceback


Version-Release number of selected component (if applicable):
# rpm -q yum rpm deltarpm yum-presto
yum-3.2.27-12.el6.noarch
rpm-4.8.0-9.el6.i686
deltarpm-3.5-0.5.20090913git.el6.i686
yum-presto-0.6.2-1.el6.noarch

How reproducible:
always

Steps to Reproduce:
1. have a repo with OLD.rpm, yum-utils-1.1.24-2.el6.noarch
2. have a deltarpm repo with NEW.rpm and its OLD_NEW.drpm,  yum-utils-1.1.26-10.el6.noarch and drpms/yum-utils-1.1.24-2.el6_1.1.26-10.el6.noarch.drpm
3. yum loclainstall drpms/yum-utils-1.1.24-2.el6_1.1.26-10.el6.noarch.drpm
  
Actual results:
traceback

Expected results:
some nice error like has rpm (error: yum-utils-1.1.26-10.el6.noarch is a Delta RPM and cannot be directly installed)
or
do some magic which enable direct yum local installation

Additional info:

[root@dell-pe840-01 new]# rpm -q yum-utils
yum-utils-1.1.24-2.el6.noarch
[root@dell-pe840-01 new]# yum localinstall drpms/yum-utils-1.1.24-2.el6_1.1.26-10.el6.noarch.drpm 
Loaded plugins: presto, refresh-packagekit, rhnplugin
Setting up Local Package Process
Examining drpms/yum-utils-1.1.24-2.el6_1.1.26-10.el6.noarch.drpm: yum-utils-1.1.26-10.el6.noarch
Marking drpms/yum-utils-1.1.24-2.el6_1.1.26-10.el6.noarch.drpm as an update to yum-utils-1.1.24-2.el6.noarch
Resolving Dependencies
--> Running transaction check
---> Package yum-utils.noarch 0:1.1.26-10.el6 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================================================================
 Package                      Arch                      Version                           Repository                                                            Size
=====================================================================================================================================================================
Updating:
 yum-utils                    noarch                    1.1.26-10.el6                     /yum-utils-1.1.24-2.el6_1.1.26-10.el6.noarch.drpm                    239 k

Transaction Summary
=====================================================================================================================================================================
Install       0 Package(s)
Upgrade       1 Package(s)

Total size: 239 k
Is this ok [y/N]: y
Downloading Packages:


Package yum-utils-1.1.24-2.el6_1.1.26-10.el6.noarch.drpm is not signed
[root@dell-pe840-01 new]# yum localinstall drpms/yum-utils-1.1.24-2.el6_1.1.26-10.el6.noarch.drpm  --nogpgcheck
Loaded plugins: presto, refresh-packagekit, rhnplugin
Setting up Local Package Process
Examining drpms/yum-utils-1.1.24-2.el6_1.1.26-10.el6.noarch.drpm: yum-utils-1.1.26-10.el6.noarch
Marking drpms/yum-utils-1.1.24-2.el6_1.1.26-10.el6.noarch.drpm as an update to yum-utils-1.1.24-2.el6.noarch
Resolving Dependencies
--> Running transaction check
---> Package yum-utils.noarch 0:1.1.26-10.el6 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================================================================
 Package                      Arch                      Version                           Repository                                                            Size
=====================================================================================================================================================================
Updating:
 yum-utils                    noarch                    1.1.26-10.el6                     /yum-utils-1.1.24-2.el6_1.1.26-10.el6.noarch.drpm                    239 k

Transaction Summary
=====================================================================================================================================================================
Install       0 Package(s)
Upgrade       1 Package(s)

Total size: 239 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
error: yum-utils-1.1.26-10.el6.noarch is a Delta RPM and cannot be directly installed
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 254, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 192, in main
    return_code = base.doTransaction()
  File "/usr/share/yum-cli/cli.py", line 428, in doTransaction
    msgs = self._run_rpm_check_debug()
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 4341, in _run_rpm_check_debug
    self.populateTs(test=1)
  File "/usr/lib/python2.6/site-packages/yum/depsolve.py", line 224, in populateTs
    self.ts.addInstall(hdr, (hdr, rpmfile), txmbr.ts_state)
  File "/usr/lib/python2.6/site-packages/rpm/transaction.py", line 62, in addInstall
    raise rpm.error("adding package to transaction failed")
_rpm.error: adding package to transaction failed

Comment 1 RHEL Program Management 2010-06-23 16:32:57 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 2 James Antill 2010-06-23 17:47:46 UTC
We could catch the "rpm.error" at the top, and thus. not print the traceback. We can't give much info. though other than "rpm refused to deal with failname: %s". But I guess rpm is outputting something, so that'll work.

We are looking to see if we can spot .drpm files earlier in yum (without just checking the name), but I'm not sure how easy that will be.

Comment 10 James Antill 2011-05-12 19:08:21 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause: yum tried to use any file that ended in "rpm"
Consequence: yum would try to act on ".drpm" files, and fail
Fix: check for ".rpm" instead of just "rpm"
Result: yum doesn't try to open ".drpm" files.

Comment 11 errata-xmlrpc 2011-05-19 13:33:31 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0602.html