Bug 809394

Summary: yum history rollback ends with traceback
Product: Red Hat Enterprise Linux 7 Reporter: Patrik Kis <pkis>
Component: yumAssignee: James Antill <james.antill>
Status: CLOSED CURRENTRELEASE QA Contact: Hubert Kario <hkario>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: carlos.costa, hkario, tcallawa
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 809392 Environment:
Last Closed: 2014-06-13 10:32:45 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:
Bug Depends On: 809392    
Bug Blocks:    

Description Patrik Kis 2012-04-03 09:10:03 UTC
+++ This bug was initially created as a clone of Bug #809392 +++

Description of problem:
When the same package is installed and removed more times and the yum history is replayed it end with traceback.

Version-Release number of selected component (if applicable):
yum-3.2.29-27.el6.noarch

How reproducible:
always

Steps to Reproduce:
1. Clean the yum history
# yum history new

2. Install, remove and again install the same package
# yum -y install zsh
# yum -y remove zsh
# yum -y install zsh
# yum history
Loaded plugins: product-id, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
ID     | Login user               | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
     3 | root <root>              | 2012-04-03 05:05 | Install        |    1   
     2 | root <root>              | 2012-04-03 05:05 | Erase          |    1   
     1 | root <root>              | 2012-04-03 05:05 | Install        |    1   
history list

3. Perform a yum history rollback
# yum history rollback 2
Loaded plugins: product-id, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Rollback to transaction 2, from Tue Apr  3 05:05:19 2012
  Undoing the following transactions: 3
    Install zsh-4.3.10-5.el6.i686 @beaker-Server
...

# yum history rollback 1
Loaded plugins: product-id, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Rollback to transaction 1, from Tue Apr  3 05:05:08 2012
  Undoing the following transactions: 2, 3
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 136, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 438, in doCommands
    return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
  File "/usr/share/yum-cli/yumcommands.py", line 1488, in doCommand
    ret = self._hcmd_rollback(base, extcmds)
  File "/usr/share/yum-cli/yumcommands.py", line 1408, in _hcmd_rollback
    base.historyInfoCmdPkgsAltered(mobj)
  File "/usr/share/yum-cli/output.py", line 1858, in historyInfoCmdPkgsAltered
    for hpkg in old.trans_data:
  File "/usr/lib/python2.6/site-packages/yum/history.py", line 307, in <lambda>
    trans_data = property(fget=lambda self: self._getTransData())
  File "/usr/lib/python2.6/site-packages/yum/history.py", line 509, in _getTransData
    _move_pkg_n(npkg, 'Reinstall')
  File "/usr/lib/python2.6/site-packages/yum/history.py", line 461, in _move_pkg_n
    self._move_pkg(sk, nstate, npkgtup2pkg, npkgstate2pkg)
  File "/usr/lib/python2.6/site-packages/yum/history.py", line 449, in _move_pkg
    xpkg = self._conv_pkg_state(xpkg, nstate)
  File "/usr/lib/python2.6/site-packages/yum/history.py", line 429, in _conv_pkg_state
    pkg._history)
  File "/usr/lib/python2.6/site-packages/yum/history.py", line 220, in __init__
    checksum, history)
  File "/usr/lib/python2.6/site-packages/yum/history.py", line 162, in __init__
    chk = checksum.split(':')
AttributeError: YumHistory instance has no attribute 'split'

  
Actual results:
yum history rollback 1
 * ends with traceback

Expected results:
yum history rollback 1
 * performs the transactions even if the system will end up on the same state (the package is uninstalled and installed again)

Additional info:

Comment 1 James Antill 2012-04-03 14:24:53 UTC
This is already fixed in rawhide/F16/F17/upstream:

commit 2216e1a8d352718e92ebb14ff57f9635d960c29c
Author: James Antill <james>
Date:   Thu Dec 1 13:09:29 2011 -0500

    Fix _conv_pkg_state when calling with history as checksum. BZ 757736.

Comment 2 carlos.costa 2012-06-20 21:07:04 UTC
Removing LD_LIBRARY_PATH which was point to /opt/oracle/11.0/lib, solved this issue.

Comment 5 James Antill 2012-11-12 19:42:46 UTC
 I assume the fix should be in RHEL-7 by now.

Comment 7 Ludek Smid 2014-06-13 10:32:45 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.