Bug 802462

Summary: yum history stats traceback after creation of new history
Product: Red Hat Enterprise Linux 6 Reporter: Patrik Kis <pkis>
Component: yumAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED ERRATA QA Contact: Patrik Kis <pkis>
Severity: low Docs Contact:
Priority: low    
Version: 6.2CC: james.antill, pknirsch
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: yum-3.2.29-35.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 802661 (view as bug list) Environment:
Last Closed: 2013-02-21 10:12:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 802661    

Description Patrik Kis 2012-03-12 15:33:31 UTC
Description of problem:
After creating a new yum history file yum stats fails with traceback instead of reporting error.


Version-Release number of selected component (if applicable):
yum-3.2.29-22.el6.noarch
python-2.6.6-29.el6.x86_64

How reproducible:
always

Steps to Reproduce:
# yum history
Loaded plugins: product-id, security, subscription-manager
Updating certificate-based repositories.
ID     | Login user               | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
     2 | root <root>              | 2012-03-12 16:25 | Install        |    1   
     1 | root <root>              | 2012-03-12 16:25 | Erase          |    1   
history list
# yum history stats
Loaded plugins: product-id, security, subscription-manager
Updating certificate-based repositories.
File        : //var/lib/yum/history/history-2012-03-12.sqlite
Size        : 23,552
Transactions: 2
Begin time  : Mon Mar 12 16:25:30 2012
End time    : Mon Mar 12 16:25:42 2012
Counts      :
  NEVRAC :      5
  NEVRA  :      5
  NA     :      5
  NEVR   :      5
  rpm DB :      1
  yum DB :      1
history stats
# ll /var/lib/yum/history/
total 860
drwxr-xr-x. 3 root root   4096 Jan 17 08:30 2012-01-17
drwxr-xr-x. 7 root root   4096 Mar 12 12:51 2012-03-12
-rw-------. 1 root root 793600 Jan 17 08:35 history-2012-01-17.sqlite
-rw-------. 1 root root  23552 Mar 12 16:25 history-2012-03-12.sqlite
-rw-------. 1 root root  40960 Mar 12 12:51 history-2012-03-12.sqlite.old
# yum history new
Loaded plugins: product-id, security, subscription-manager
Updating certificate-based repositories.
history new
# ll /var/lib/yum/history/
total 844
drwxr-xr-x. 3 root root   4096 Jan 17 08:30 2012-01-17
drwxr-xr-x. 7 root root   4096 Mar 12 12:51 2012-03-12
-rw-------. 1 root root 793600 Jan 17 08:35 history-2012-01-17.sqlite
-rw-------. 1 root root  23552 Mar 12 16:28 history-2012-03-12.sqlite
-rw-------. 1 root root  23552 Mar 12 16:25 history-2012-03-12.sqlite.old
# yum history
Loaded plugins: product-id, security, subscription-manager
Updating certificate-based repositories.
No transactions
Error: Failed history list
# yum history stats
Loaded plugins: product-id, security, subscription-manager
Updating certificate-based repositories.
File        : //var/lib/yum/history/history-2012-03-12.sqlite
Size        : 23,552
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 276, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 129, 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 1493, in doCommand
    ret = self._hcmd_stats(base, extcmds)
  File "/usr/share/yum-cli/yumcommands.py", line 1421, in _hcmd_stats
    trans_1 = base.history.old("1")[0]
IndexError: list index out of range


Actual results:
See the traceback above.

Expected results:
Any descriptive error message.

Additional info:
The yum history stats start to work again after the first yum record to history, e.g. install.

Comment 2 RHEL Program Management 2012-07-10 06:02:20 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 3 RHEL Program Management 2012-07-11 02:11:30 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 10 errata-xmlrpc 2013-02-21 10:12:33 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.

http://rhn.redhat.com/errata/RHBA-2013-0406.html