Bug 1582524 - dnf doesn't follow default profile for an enabled non-default stream
Summary: dnf doesn't follow default profile for an enabled non-default stream
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 28
Hardware: Unspecified
OS: Unspecified
high
urgent
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: AcceptedBlocker
Depends On:
Blocks: 1478068 F29BetaBlocker
TreeView+ depends on / blocked
 
Reported: 2018-05-25 13:33 UTC by Karel Srot
Modified: 2018-09-10 08:24 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1582450
Environment:
Last Closed: 2018-09-10 08:24:24 UTC


Attachments (Terms of Use)

Description Karel Srot 2018-05-25 13:33:17 UTC
Description of problem:

Having system defaults defined:

          """
          document: modulemd-defaults
          version: 1
          data:
            module: ModuleA
            stream: f26
            profiles:
              f26: [minimal, devel]
              f27: [minimal]
          """

  Scenario: Default profile is used when installing a module with enabled stream
      Given I run "dnf module enable ModuleA:f27 -y"
       When I run "dnf module install ModuleA -y"
       Then a module ModuleA config file should contain
          | Key      | Value         |
          | stream   | f27           |
          | profiles | (set) minimal |
          | version  | 2             |

However both minimal and devel profiles are installed.

Version-Release number of selected component (if applicable):
dnf-2.7.5-14
libdnf-0.11.1-3

Comment 1 Stephen Gallagher 2018-05-25 14:50:35 UTC
For the record, I can reproduce this with DNF on F28 easily with the following steps:

1. Install fedora-repos-modular
2. Create the file /etc/dnf/modules.defaults.d/nodejs.yaml with the contents:
```
document: modulemd-defaults
version: 1
data:
    module: nodejs
    stream: 10
    profiles:
        10: [ development ]
        6: [ minimal ]
```
(This tells DNF that the "10" stream is the default for this system and sets the default profiles for stream "10" and "6" to be different)
3. `dnf module install nodejs:6` (This tells DNF to install a non-default stream that should use the 'minimal' profile, since that's the one that matches from the defaults file.

Actual results:
DNF installs packages from the "6" stream, but uses the "development" profile instead of the "minimal" profile. It also writes /etc/dnf/modules.d/nodejs.module with the contents:
```
[nodejs]
name = nodejs
stream = 10
version = 20180503133726
profiles =development
enabled = 1
locked = 0
```
Note that it has specified that the stream is 10 (despite installing packages from the "6" stream) and that the enabled profiles are "development".

Also, after this, `dnf module list` shows:
nodejs                    10 [d][e]           20180510163433         default, development, ...           
indicating that DNF erroneously thinks that the module stream "10" is active, which results in a subsequent `dnf update` attempting to replace the Node.js 6.x packages with ones from 10.x.

Expected results:
The packages must be installed from the 6.x stream, the default profile used must be "minimal" as set in the defaults file and the .module file in /etc/dnf/modules.d must contain these same values.

Comment 2 Fedora Blocker Bugs Application 2018-05-25 15:08:38 UTC
Proposed as a Blocker for 29-beta by Fedora user sgallagh using the blocker tracking app because:

 "The installed system must be able to download and install appropriate updates with the default console tool for the relevant update type (e.g. default console package manager)."

Comment 3 Adam Williamson 2018-05-25 19:12:29 UTC
Looks +1ish to me, yep.

Comment 4 Stephen Gallagher 2018-05-25 19:54:11 UTC
Investigation is ongoing, but this is looking like it *may* only happen when someone uses an override file, so it’s possible this is not a strictly be a blocker. I’m trying to figure out if this affects things that are only coming from repodata.

Please defer this from the blocker bug meeting on Monday, as it’s a holiday here and I probably won’t have time to fully dig into this before Tuesday.

Comment 5 Karel Srot 2018-05-25 21:16:33 UTC
(In reply to Stephen Gallagher from comment #4)
> Investigation is ongoing, but this is looking like it *may* only happen when
> someone uses an override file, so it’s possible this is not a strictly be a
> blocker. 

Nope. I did move the content into the yaml file in the repository and as you can see the module defaults are listed incorrectly for stream f27.

bash-4.4# dnf module list
Last metadata expiration check: 0:00:04 ago on Fri May 25 21:13:06 2018.
modularityABDE
Name                     Stream                   Version                  Profiles                             
ModuleA                  f26 [d]                  2                        client, default, ...                 
ModuleA                  f27                      1                        client, default, ...                 

Hint: [d]efault, [e]nabled, [i]nstalled, [l]ocked
bash-4.4# dnf module info ModuleA:f26
Last metadata expiration check: 0:00:17 ago on Fri May 25 21:13:06 2018.

Name             : ModuleA
Stream           : f26 (default)
Version          : 2
Profiles         : client default devel minimal server
Default profiles : devel minimal
Repo             : modularityABDE
Summary          : Module ModuleA summary
Description      : Module ModuleA description
Artifacts        : TestA-0:1-2.modA.noarch
                 : TestB-0:1-1.modA.noarch
                 : TestC-0:1-2.modA.noarch
                 : TestD-0:1-1.modA.noarch
bash-4.4# dnf module info ModuleA:f27
Last metadata expiration check: 0:00:22 ago on Fri May 25 21:13:06 2018.

Name             : ModuleA
Stream           : f27
Version          : 1
Profiles         : client default devel minimal server
Default profiles : devel minimal
Repo             : modularityABDE
Summary          : Module ModuleA summary
Description      : Module ModuleA description
Artifacts        : TestA-0:2-1.modA.noarch
                 : TestB-0:2-1.modA.noarch
                 : TestC-0:2-1.modA.noarch
                 : TestD-0:2-1.modA.noarch

Comment 6 Lukas Ruzicka 2018-07-16 16:26:51 UTC
Discussed at the 2018-07-16 blocker review meeting [1]:

AcceptedBlocker (Beta) - accepted as a violation of Basic criterion "The installed system must be able to download and install appropriate updates with the default console tool for the relevant update type (e.g. default console package manager)", in a fairly simple module stream configuration

https://meetbot-raw.fedoraproject.org/fedora-blocker-review/2018-07-16/

Comment 9 Adam Williamson 2018-08-13 18:36:29 UTC
Karel, Stephen - can you confirm whether this is now considered sufficiently resolved and should be closed? Thanks!

Comment 10 Karel Srot 2018-08-20 09:14:21 UTC
I could not try mine reproducer as I can't install python3-behave on F29 but tried Stephen's one and it seems to work correctly with
dnf-3.3.0-1.fc29.noarch
libdnf-0.17.2-1.fc29.x86_64
from Koji.

Comment 11 Karel Srot 2018-08-20 09:15:59 UTC
Pasting some evidence:

[root@1d266697710f /]# cat /etc/dnf/modules.defaults.d/nodejs.yaml
document: modulemd-defaults
version: 1
data:
    module: nodejs
    stream: 10
    profiles:
        10: [ development ]
        8: [ minimal ]

[root@1d266697710f /]# dnf module install nodejs:8 --nogpgcheck
Last metadata expiration check: 0:03:22 ago on Mon Aug 20 09:09:30 2018.
Dependencies resolved.
==============================================================================================================
 Package                Arch         Version                                       Repository            Size
==============================================================================================================
Installing group packages:
 nodejs                 x86_64       1:8.11.4-1.module_2030+42747d40               fedora-modular       7.3 M
Installing dependencies:
 compat-openssl10       x86_64       1:1.0.2o-3.fc29                               rawhide              1.1 M
 gc                     x86_64       7.6.4-4.fc29                                  rawhide              101 k
 guile                  x86_64       5:2.0.14-12.fc29                              rawhide              3.5 M
 http-parser            x86_64       2.8.1-2.fc29                                  rawhide               37 k
 libatomic_ops          x86_64       7.6.6-1.fc29                                  rawhide               34 k
 libtool-ltdl           x86_64       2.4.6-25.fc29                                 rawhide               36 k
 libuv                  x86_64       1:1.22.0-2.fc29                               rawhide              126 k
 make                   x86_64       1:4.2.1-10.fc29                               rawhide              487 k
Installing weak dependencies:
 npm                    x86_64       1:5.6.0-1.8.11.4.1.module_2030+42747d40       fedora-modular       4.0 M
Installing module profiles:
 nodejs/minimal                                                                                              
Enabling module streams:
 nodejs                              8                                                                       

Transaction Summary
...
...
Complete!
[root@1d266697710f /]# cat /etc/dnf/modules.d/nodejs.module
[nodejs]
name=nodejs
profiles=minimal
state=enabled
stream=8
[root@1d266697710f /]# dnf module list --installed
Last metadata expiration check: 0:03:41 ago on Mon Aug 20 09:09:30 2018.
Fedora Modular 29 - x86_64
Name            Stream          Profiles                                           Summary                    
nodejs          8 [e]           default, development [d], minimal[i], ...          Javascript runtime         

Hint: [d]efault, [e]nabled, [i]nstalled

Comment 12 Adam Williamson 2018-09-08 00:01:59 UTC
Karel: 3.3.0 is still not stable for F29 yet. Sorry to be a pain, but do we know if this works with 3.2.0-2.fc29?

Comment 13 Karel Srot 2018-09-10 07:55:58 UTC
Yes, with dnf-3.2.0-2.fc29.noarch the issue is also fixed.

Comment 14 Adam Williamson 2018-09-10 08:24:24 UTC
Thanks.


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