Bug 2060815 - `dnf history rollback` fails with `KeyError: 'Reason Change'`
Summary: `dnf history rollback` fails with `KeyError: 'Reason Change'`
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: dnf
Version: 8.5
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Packaging Maintenance Team
QA Contact: Tomáš Bajer
Mariya Pershina
URL:
Whiteboard:
: 2064581 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-03-04 10:26 UTC by Pradeep Jagtap
Modified: 2022-11-08 12:29 UTC (History)
8 users (show)

Fixed In Version: dnf-4.7.0-9.el8
Doc Type: Bug Fix
Doc Text:
.DNF now correctly rolls back a transaction containing an item with the `Reason Change` Action type Previously, running the `dnf history rollback` command on a transaction containing an item with the `Reason Change` Action type failed. With this update, the issue has been fixed, and `dnf history rollback` now works as expected.
Clone Of:
Environment:
Last Closed: 2022-11-08 10:47:20 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-114502 0 None None None 2022-11-08 11:11:42 UTC
Red Hat Knowledge Base (Solution) 6802691 0 None None None 2022-03-09 09:43:03 UTC
Red Hat Product Errata RHBA-2022:7712 0 None None None 2022-11-08 10:47:35 UTC

Description Pradeep Jagtap 2022-03-04 10:26:58 UTC
Description of problem:
========================
Dnf/yum rollback fails with below traceback

# yum history undo <ID>
Traceback (most recent call last):
File "/bin/yum", line 58, in <module>
main.user_main(sys.argv[1:], exit_code=True)
File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 201, in user_main
errcode = main(args)
File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 67, in main
return _main(base, args, cli_class, option_parser_class)
File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 106, in _main
return cli_run(cli, base)
File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 122, in cli_run
cli.run()
File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 1055, in run
return self.command.run()
File "/usr/lib/python3.6/site-packages/dnf/cli/commands/history.py", line 342, in run
self._hcmd_undo(tids)
File "/usr/lib/python3.6/site-packages/dnf/cli/commands/history.py", line 190, in _hcmd_undo
self._revert_transaction(old)
File "/usr/lib/python3.6/site-packages/dnf/cli/commands/history.py", line 233, in _revert_transaction
ti["action"] = action_map[ti["action"]]
KeyError: 'Reason Change'


Version-Release number of selected component (if applicable):
=============================================
Affected versions
python3-dnf-4.4.2-11.el8.noarch
python3-dnf-4.7.0-4.el8.noarch

Actual results:
================
Failed with KeyError: 'Reason Change' error

Expected results:
=================
Downgrade should be successful

Comment 8 Lukáš Hrázký 2022-05-04 14:42:12 UTC
*** Bug 2064581 has been marked as a duplicate of this bug. ***

Comment 17 errata-xmlrpc 2022-11-08 10:47:20 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 (dnf bug fix and enhancement update), and where to find the updated
files, follow the link below.

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

https://access.redhat.com/errata/RHBA-2022:7712


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