Bug 1677640 - The module enable/disable works unexpectedly with slow/fast train virt module
Summary: The module enable/disable works unexpectedly with slow/fast train virt module
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: dnf
Version: 8.0
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: rc
: 8.0
Assignee: Jaroslav Mracek
QA Contact: Karel Srot
URL:
Whiteboard:
Depends On: 1681084
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-02-15 12:59 UTC by yalzhang@redhat.com
Modified: 2020-11-14 17:00 UTC (History)
14 users (show)

Fixed In Version: dnf-4.2.6-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-05 22:21:13 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:3583 None None None 2019-11-05 22:21:30 UTC

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 Cesar Lemes 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


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