Bug 2016070
| Summary: | dnf rollback of a transaction with a group upgrade in it causes errors when trying to downgrade group | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Alena <alrodrig> | |
| Component: | dnf | Assignee: | Jan Kolarik <jkolarik> | |
| Status: | CLOSED ERRATA | QA Contact: | Eva Mrakova <emrakova> | |
| Severity: | medium | Docs Contact: | Mariya Pershina <mpershin> | |
| Priority: | medium | |||
| Version: | 8.4 | CC: | james.antill, jkolarik, mbanas, mpershin, nsella, swm-qe | |
| Target Milestone: | rc | Keywords: | Triaged | |
| Target Release: | --- | Flags: | pm-rhel:
mirror+
|
|
| Hardware: | All | |||
| OS: | Linux | |||
| Whiteboard: | ||||
| Fixed In Version: | dnf-4.7.0-13.el8 | Doc Type: | Bug Fix | |
| Doc Text: |
.Reverting a YUM upgrade transaction is now possible for a package group or environment
Previously, the `yum history rollback` command failed when attempting to revert an upgrade transaction for a package group or an environment.
With this update, the issue has been fixed, and you can now revert the YUM upgrade transaction for a package group or environment.
|
Story Points: | --- | |
| Clone Of: | ||||
| : | 2122626 (view as bug list) | Environment: | ||
| Last Closed: | 2023-05-16 09:06:59 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: | ||
| Embargoed: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 2122626 | |||
We consider the bug as a valid but because the issue has limited impact (medium priority) we postpone the issue in favor of other issues. I have seen in the bug that a possible solution for undo group upgrade would be implement group downgrade functionality. But I am not sure whether is it a good idea. Let me explain what group upgrade does and then we will see what will be a good solution. DNF upgrade 1. upgrade packages defined in group 2. install packages that were not define in group at time of the last operation with the group 3. Reason change - for new packages in the group that are already installed as a dep there can be a reason change to group (not sure whether it is there or not or whether reason change is also covered by undo operation) 4. Update a definition of the group in history DB and update what is installed from the group During `undo`, first two points are already covered by rpm transaction elements and they are reverted. The point 3 is not reported by the issue therefore let's skip it. Then there is point 4. To revert point 4 100% correctly I am supposed to revert definition of the group to the state like the operation was never performed. I guess it is doable if we undo an operation that is the last that modified the group but if the situation in history db is like that: 1. group install core -x sssd (installs dnf, systemd, (sssd is define in group but excluded from transaction)) 2. group upgrade core (at that time additional package (nodejs) was defined in the group) => upgrade dnf, systemd, install nodejs 3. group upgrade core - new set of packages defined in metadata Then when I perform - `dnf history undo 2` => then it is quite difficult to detect into which state the definition of the group it should be reverted. I was checking the history DB state and after each group operation new definition of group is created, so it is easy to rollback previous state. Following PRs were queued to fix this: fix: https://github.com/rpm-software-management/dnf/pull/1844 tests: https://github.com/rpm-software-management/ci-dnf-stack/pull/1149 Cloned into RHEL9 ticket https://bugzilla.redhat.com/show_bug.cgi?id=2122626. 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-2023:2980 |
Description of problem: Using dnf rollback on a transaction with a group upgrade in it causes issues when dnf tries to downgrade the group since downgrade isn't a valid group action. Version-Release number of selected component (if applicable): dnf-4.4.2-11.el8.noarch libdnf-0.55.0-7.el8.x86_64 How reproducible: Always Steps to Reproduce: 1. Release lock to get an older version of a group installed (for my testing I used 8.2) 2. Install a group. I used the "Security Tools" group, but it's reproducible with all groups: # yum group install 'Security Tools' 3. Upgrade the group: # yum group upgrade 'Security Tools' 4. Attempt to rollback, with <id> as the id before the group upgrade: # yum history rollback <id> Actual results: [root@e4e271df66fb /]# yum history rollback 3 Last metadata expiration check: 0:01:15 ago on Tue Oct 19 18:16:03 2021. Error: The following problems occurred while running a transaction: Unexpected value of group action "Downgraded" for group "security-tools". Expected results: yum should have the ability to downgrade groups, or it should properly handle this so that the group is removed and packages are downgraded, then the group is marked installed again. Additional info: I got different behavior when using the deprecated 'groupupdate' syntax on the update of the group. On one occasion it threw a traceback, on the other occasion it actually removed the group and downgraded the package which is the closest to desired behavior, but still not perfect because it results in the group not being marked installed. There is the workaround of marking the group removed, downgrading the packages, and marking it installed, but it should not be the case that a 'yum history rollback' causes this issue in the first place, and ideally yum group would have downgrade as a valid action instead of just the following three actions: --- 534 if action == "Install": 535 self._swdb_group_install(group_id, pkg_types, group_data["packages"]) 536 elif action == "Upgrade": 537 self._swdb_group_upgrade(group_id, pkg_types, group_data["packages"]) 538 elif action == "Removed": 539 self._swdb_group_remove(group_id, pkg_types, group_data["packages"]) 540 else: 541 errors.append(TransactionError( 542 _('Unexpected value of group action "{action}" for group "{group}".') 543 .format(action=action, group=group_id) 544 )) --- ~~~ Additional info: