Bug 809392 - yum history rollback ends with traceback
yum history rollback ends with traceback
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: yum (Show other bugs)
6.3
Unspecified Unspecified
medium Severity medium
: alpha
: ---
Assigned To: James Antill
BaseOS QE Security Team
:
Depends On:
Blocks: 809394
  Show dependency treegraph
 
Reported: 2012-04-03 05:09 EDT by Patrik Kis
Modified: 2014-01-21 01:25 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 809394 (view as bug list)
Environment:
Last Closed: 2012-06-20 09:54:03 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0857 normal SHIPPED_LIVE yum bug fix and enhancement update 2012-06-19 16:48:27 EDT

  None (edit)
Description Patrik Kis 2012-04-03 05:09:11 EDT
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 2 James Antill 2012-04-03 10:25:44 EDT
This is already fixed in rawhide/F16/F17/upstream:

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

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

...one line easy fix.
Comment 9 errata-xmlrpc 2012-06-20 09:54:03 EDT
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.

http://rhn.redhat.com/errata/RHBA-2012-0857.html

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