Bug 1677640

Summary: The module enable/disable works unexpectedly with slow/fast train virt module
Product: Red Hat Enterprise Linux 8 Reporter: yalzhang <yalzhang>
Component: dnfAssignee: Jaroslav Mracek <jmracek>
Status: CLOSED ERRATA QA Contact: Karel Srot <ksrot>
Severity: high Docs Contact:
Priority: medium    
Version: 8.0CC: chayang, ddepaula, dmach, james.antill, jen, jmracek, juzhang, jwboyer, knoel, mtessun, psabata, tzheng, xuzhang, yalzhang
Target Milestone: rcKeywords: Triaged
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-4.2.6-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-05 22:21:13 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:
Bug Depends On: 1681084    
Bug Blocks:    

Comment 2 Jeff Nelson 2019-02-19 18:44:37 UTC
This looks like a dnf issue. Reassigning.

QE, can you please describe the steps you performed to add the Advanced Virt repo to your environment so that the dnf team can reproduce the issue?

Comment 6 Danilo de Paula 2019-02-20 15:50:39 UTC
In the situation where there's one module with two streams: foo:stream1 foo:stream2.
foo:stream1 is enabled by default.

step1: "dnf module enable foo:stream2" will, behind the scenes, disable foo:stream1
step2: "dnf module disable foo:stream2" will disable foo:stream2 and both streams will be disabled.
result: both streams disabled

FIY: dnf team made a change recently that will break step1. You won't be able to enable foo:stream2 if you don't explicitly disable foo:stream1.
This will be the result clearer.

Comment 7 yalzhang@redhat.com 2019-02-21 00:43:17 UTC
(In reply to Danilo Cesar de Paula from comment #6)
> In the situation where there's one module with two streams: foo:stream1
> foo:stream2.
> foo:stream1 is enabled by default.
> 
> step1: "dnf module enable foo:stream2" will, behind the scenes, disable
> foo:stream1

I think it is better to make it visible like:
step 0:
# yum module list virt
Fast-train
Name                                  Stream                                  Profiles                                   Summary                                              
virt                                  8.0.0**[x]**                                   common                                     Virtualization module                                
beaker-AppStream
Name                                  Stream                                  Profiles                                   Summary                                              
virt                                  rhel**[e]**                                    common [d]                                 Virtualization module                                
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

# yum module enable virt:8.0.0
Fast-train
Name                                  Stream                                  Profiles                                   Summary                                              
virt                                  8.0.0**[e]**                                   common  **[d]**                         Virtualization module                                
beaker-AppStream
Name                                  Stream                                  Profiles                                   Summary                                              
virt                                  rhel**[x]**                                    common                                  Virtualization module                                

Both stream is marked by a '[e]' or '[x]', it will never be ignored. And the '[d]' for the profile of the stream go with the '[e]' as it is the only profile for the stream.

> step2: "dnf module disable foo:stream2" will disable foo:stream2 and both
> streams will be disabled.
> result: both streams disabled

This may not be true because if I run "dnf module disable foo:stream1" here, it will get the same result: both stream are disabled.

Comment 9 Petr Ĺ abata 2019-02-21 17:12:05 UTC
This is expected behavior.

While you can specify the stream (and even the full NSVC) with the 'disable' command, the command's purpose is to disable the entire module, making all the streams unavailable -- it only considers the module name.  It doesn't automatically enable some other streams in the background.  If your goal is to switch back to defaults, you can use the 'module reset' command, which does exactly that.

The 'provides' command only searches available content, i.e. modules that are enabled, explicitly or implicitly.  We understand this is suboptimal and will be fixed in 8.1.

To answer your other question, modularity only provides parallel availability, not parallel installability.  You can indeed have only one stream enabled.

Comment 10 Jaroslav Mracek 2019-02-24 22:31:47 UTC
I think we can improve transaction table from:

Dependencies resolved.
==========================================================================================================================
 Package                      Architecture                Version                      Repository                    Size
==========================================================================================================================
Disabling module streams:
 perl                                                     5.24                                                           

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

To:

Dependencies resolved.
==========================================================================================================================
 Package                      Architecture                Version                      Repository                    Size
==========================================================================================================================
Disabling module:
 perl                                                                                                             

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

What do you think about? Is it a solution for the issue here?

Comment 11 yalzhang@redhat.com 2019-02-25 01:00:54 UTC
(In reply to Jaroslav Mracek from comment #10)
> I think we can improve transaction table from:
> 
> Dependencies resolved.
> =============================================================================
> =============================================
>  Package                      Architecture                Version           
> Repository                    Size
> =============================================================================
> =============================================
> Disabling module streams:
>  perl                                                     5.24              
> 
> 
> Transaction Summary
> =============================================================================
> =============================================
> 
> To:
> 
> Dependencies resolved.
> =============================================================================
> =============================================
>  Package                      Architecture                Version           
> Repository                    Size
> =============================================================================
> =============================================
> Disabling module:
>  perl                                                                       
> 
> 
> Transaction Summary
> =============================================================================
> =============================================
> 
> What do you think about? Is it a solution for the issue here?

I think it makes sense. Thank you.

Comment 12 Jaroslav Mracek 2019-02-26 09:45:38 UTC
I create a pull request https://github.com/rpm-software-management/dnf/pull/1334 that change an output according to Comment 10.

Comment 13 Jaroslav Mracek 2019-02-26 11:43:20 UTC
Here is also a test coverage: https://github.com/rpm-software-management/ci-dnf-stack/pull/508

Comment 21 errata-xmlrpc 2019-11-05 22:21:13 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