Bug 1706215

Summary: using the @ module syntax for yum4 avoids the stream switching error protection
Product: Red Hat Enterprise Linux 8 Reporter: jcastran
Component: yumAssignee: Jaroslav Mracek <jmracek>
Status: CLOSED ERRATA QA Contact: Eva Mrakova <emrakova>
Severity: high Docs Contact:
Priority: medium    
Version: 8.1CC: emrakova, james.antill, jaruga, kwalker, mdomonko
Target Milestone: rc   
Target Release: 8.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: dnf-4.2.7-3.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-05 22:22:06 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:

Description jcastran 2019-05-03 20:00:13 UTC
Description of problem:
Trying to enable a module when another stream is installed will fail BUT installing it with "yum install @module" will enable and install it though it shouldn't.

~~~~~~~~~~~~~~~~~~ Expected Behavior ~~~~~~~~~~~~~~~~~~
# yum module enable php:7.2
Updating Subscription Management repositories.
Last metadata expiration check: 0:26:35 ago on Fri 03 May 2019 03:25:21 PM EDT.
The operation would result in switching of module 'php' stream '7.1' to stream '7.2'
Error: It is not possible to switch enabled streams of a module.
It is recommended to remove all installed content from the module, and reset the module using 'dnf module reset <module_name>' command. After you reset the module, you can enable the other stream.

# yum module install php:7.2
Updating Subscription Management repositories.
Last metadata expiration check: 0:33:14 ago on Fri 03 May 2019 03:25:21 PM EDT.
The operation would result in switching of module 'php' stream '7.1' to stream '7.2'
Error: It is not possible to switch enabled streams of a module.
It is recommended to remove all installed content from the module, and reset the module using 'dnf module reset <module_name>' command. After you reset the module, you can install the other stream.

~~~~~~~~~~~~~~~~~~ Error ~~~~~~~~~~~~~~~~~~
# yum install @php:7.2
Updating Subscription Management repositories.
Last metadata expiration check: 0:32:41 ago on Fri 03 May 2019 03:25:21 PM EDT.
Dependencies resolved.
========================================================================
 Package         Arch           Version           Repository       Size
========================================================================
Switching module streams:
 php                            7.1 -> 7.2                             

Transaction Summary
========================================================================

Is this ok [y/N]: 


Version-Release number of selected component (if applicable):
RHEL *

How reproducible:
Everytime

Steps to Reproduce:
1. # yum install @php:7.1
2. # yum install @php:7.2
3.

Actual results:
Switching module streams:
 php                            7.1 -> 7.2                             

Transaction Summary
========================================================================


Expected results:
Error: It is not possible to switch enabled streams of a module.
It is recommended to remove all installed content from the module, and reset the module using 'dnf module reset <module_name>' command. After you reset the module, you can enable the other stream.





Additional info:

Comment 1 Jaroslav Mracek 2019-06-19 10:50:56 UTC
I created a patch that resolves the issue for "dnf install @module" command - https://github.com/rpm-software-management/dnf/pull/1416

Comment 2 Jaroslav Mracek 2019-06-20 10:48:13 UTC
Tests included here: https://github.com/rpm-software-management/ci-dnf-stack/pull/565

Comment 8 errata-xmlrpc 2019-11-05 22:22:06 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.

https://access.redhat.com/errata/RHSA-2019:3583