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
Running Transaction Test
Transaction Test Succeeded
Erasing : ERIClitplibvirt_CXP9030547-1.0.44-1.noarch 1/1
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in <module>
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)
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):
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
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.
The yum-post-transaction-action should be executed without any exception.
Please contact me for any more info if required.
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.