Bug 1259527

Summary: Assertion error / traceback when installing RPM that both obsoletes another RPM and listed in installonlypkgs
Product: Red Hat Enterprise Linux 6 Reporter: Greg Bailey <gbailey>
Component: yumAssignee: Valentina Mukhamedzhanova <vmukhame>
Status: CLOSED WONTFIX QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.7CC: bdangre, james.antill, ovasik
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-06 10:40:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
package-A spec file (version 1.0)
none
package-B spec file (version 1.0)
none
package-A spec file (version 2.0) none

Description Greg Bailey 2015-09-02 22:59:06 UTC
Description of problem:

AssertionError and python traceback seem to occur when installing an RPM if all 3 of the following conditions are met:

1) The RPM being installed is listed in "installonlypkgs" in /etc/yum.conf
2) The RPM being installed obsoletes a currently installed package
3) The RPM being installed contains a %post scriptlet

I first hit this scenario while attempting to perform a "yum upgrade" to install a newer customized kernel that obsoletes "cpuspeed", which was installed.

I've reproduced this issue with test packages which I'll call "package-A" and "package-B", and /etc/yum.conf lists "package-A" in installonlypkgs.

Package-A version 1.0 is installed
Package-B version 1.0 is installed

Package-A version 2.0 obsoletes Package-B.

When attempting to yum install Package-A version 2.0, I get the traceback listed below under "Actual results:".

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

yum-3.2.29-69.el6.centos.noarch

How reproducible:

Always reproducible

Steps to Reproduce:
1.  Install package-A (version 1.0) and package-B (version 1.0)
2.  Modify /etc/yum.conf to add package-A to installonlypkgs
3.  Attempt to install package-A (version 2.0)

Actual results:

[root@localhost x86_64]# yum install package-A-2.0-1.x86_64.rpm 
Loaded plugins: fastestmirror, security
Setting up Install Process
Examining package-A-2.0-1.x86_64.rpm: package-A-2.0-1.x86_64
Marking package-A-2.0-1.x86_64.rpm as an update to package-A-1.0-1.x86_64
Loading mirror speeds from cached hostfile
 * base: mirrors.psychz.net
 * epel: linux.mirrors.es.net
 * extras: dallas.tx.mirror.xygenhosting.com
 * updates: mirror.hostduplex.com
Resolving Dependencies
--> Running transaction check
---> Package package-A.x86_64 0:2.0-1 will be obsoleting
---> Package package-A.x86_64 0:2.0-1 will be installed
---> Package package-B.x86_64 0:1.0-1 will be obsoleted
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================
 Package                  Arch                  Version                 Repository                              Size
=====================================================================================================================
Installing:
 package-A                x86_64                2.0-1                   /package-A-2.0-1.x86_64                0.0  
     replacing  package-B.x86_64 1.0-1
 package-A                x86_64                2.0-1                   /package-A-2.0-1.x86_64                0.0  
     replacing  package-B.x86_64 1.0-1

Transaction Summary
=====================================================================================================================
Install       2 Package(s)

Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : package-A-2.0-1.x86_64                                                                            1/1 
 
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/yum/rpmtrans.py", line 470, in callback
    self._scriptStop(bytes, total, h);
  File "/usr/lib/python2.6/site-packages/yum/rpmtrans.py", line 636, in _scriptStop
    name, txmbr = self._getTxmbr(h)
  File "/usr/lib/python2.6/site-packages/yum/rpmtrans.py", line 331, in _getTxmbr
    assert len(txmbrs) == 1
AssertionError
error: python callback <bound method RPMTransaction.callback of <yum.rpmtrans.RPMTransaction instance at 0xc14c68>> failed, aborting!
[root@localhost x86_64]# 

Expected results:

Package-B is removed

Additional info:

Comment 1 Greg Bailey 2015-09-02 23:00:09 UTC
Created attachment 1069612 [details]
package-A spec file (version 1.0)

Comment 2 Greg Bailey 2015-09-02 23:00:43 UTC
Created attachment 1069613 [details]
package-B spec file (version 1.0)

Comment 3 Greg Bailey 2015-09-02 23:01:15 UTC
Created attachment 1069614 [details]
package-A spec file (version 2.0)

Comment 6 Jan Kurik 2017-12-06 10:40:15 UTC
Red Hat Enterprise Linux 6 is in the Production 3 Phase. During the Production 3 Phase, Critical impact Security Advisories (RHSAs) and selected Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available.

The official life cycle policy can be reviewed here:

http://redhat.com/rhel/lifecycle

This issue does not meet the inclusion criteria for the Production 3 Phase and will be marked as CLOSED/WONTFIX. If this remains a critical requirement, please contact Red Hat Customer Support to request a re-evaluation of the issue, citing a clear business justification. Note that a strong business justification will be required for re-evaluation. Red Hat Customer Support can be contacted via the Red Hat Customer Portal at the following URL:

https://access.redhat.com/