Bug 1127782 - yum post transaction action fails when package is removed
Summary: yum post transaction action fails when package is removed
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: yum-utils
Version: 7.0
Hardware: x86_64
OS: Linux
Target Milestone: rc
: ---
Assignee: James Antill
QA Contact: Karel Srot
Depends On:
TreeView+ depends on / blocked
Reported: 2014-08-07 14:35 UTC by Karel Srot
Modified: 2015-03-05 09:03 UTC (History)
2 users (show)

Fixed In Version: yum-utils-1.1.31-26.el7
Doc Type: Bug Fix
Doc Text:
Clone Of: 1045494
Last Closed: 2015-03-05 09:03:24 UTC

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0401 normal SHIPPED_LIVE yum-utils bug fix and enhancement update 2015-03-05 14:00:14 UTC

Description Karel Srot 2014-08-07 14:35:18 UTC
Present also on RHEL-7.0 with yum-utils-1.1.31-25.el7_0.

+++ This bug was initially created as a clone of Bug #1045494 +++

Description of problem:

Yum post transaction action was delivered to restart litpd service every time new python plugin is delivered and content of directory /opt/ericsson/nms/litp/lib is changed. 

The yum post action file is installed as: /etc/yum/post-actions/litp.action , below is the content of the file:
/opt/ericsson/nms/litp/lib:any:service litpd restart

All works fine during installation but when package is removed I'm getting the following error:

Installed size: 24 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing    : ERIClitplibvirt_CXP9030547-1.0.44-1.noarch                                                                                                                  1/1 
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 285, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 219, in main
    return_code = base.doTransaction()
  File "/usr/share/yum-cli/cli.py", line 586, in doTransaction
    resultobject = self.runTransaction(cb=cb)
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 1590, in runTransaction
  File "/usr/lib/python2.6/site-packages/yum/plugins.py", line 184, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/post-transaction-actions.py", line 134, in posttrans_hook
    thispo = _get_installed_po(rpmdb, txmbr.pkgtup)
  File "/usr/lib/yum-plugins/post-transaction-actions.py", line 67, in _get_installed_po
    return rpmdb.searchNevra(name=n, arch=a, epoch=e, ver=v, rel=r)[0]
IndexError: list index out of range

I'm not sure why do we search for package in rmdb which we just removed.

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


How reproducible:

Please try to remove a package for which post transaction action is enabled.

Steps to Reproduce:
1. Enable post-transaction-action for directory which will be changed when some package is removed.
2. Remove package in order to trigger yum-post-transaction-action

Actual results:

You should get "index out of range" exception as package is no longer in rpmdb. The post transaction action won't be executed but package will be removed.

Expected results:

The yum-post-transaction-action should be executed without any exception.

Additional info:

Please contact me for any more info if required.

Comment 6 errata-xmlrpc 2015-03-05 09:03:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.