Bug 1561770

Summary: [modularity] context field is ignored when installing modules
Product: [Fedora] Fedora Reporter: Merlin Mathesius <mmathesi>
Component: libdnfAssignee: rpm-software-management
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: low    
Version: 29CC: dmach, jmracek, mhatina, mluscon, packaging-team-maint, rpm-software-management, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-09-24 17:24:52 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: 1478068    

Description Merlin Mathesius 2018-03-28 21:42:59 UTC
Description of problem:
Trying selector forms N:S:V:C and N:S:V:C:A, dnf completely ignores the context field.

While this field isn't really used at this point in practice, to make the current implementation future proof, dnf should respect the selector and attempt to install the specific NSVC. If there's none (likely at this point), it should complain about the NSVC not being available rather than installing some other NSVC, ignoring the specific input.

Version-Release number of selected component (if applicable):
dnf-2.7.5-9.fc28.noarch

How reproducible:
always

Steps to Reproduce:
1. Fedora 28 with fedora-repos-modular, updates, and latest dnf
2. Attempt to install module nodejs:8:20180308143646 specifying a context that does not exist

Actual results:
dnf checks that the specified context is a valid hexadecimal number, but otherwise ignores it.

[root@50390b999544 /]# rpm -q dnf   
dnf-2.7.5-9.fc28.noarch             
[root@50390b999544 /]# dnf module list nodejs                            
Last metadata expiration check: 4:58:27 ago on Tue Mar 27 17:31:02 2018. 
Fedora Modular 28 - x86_64 - Test Updates                                
Name                           Stream                        Version                               Profiles                                        
nodejs                         6                             20180308155546                        default, development, ...                       
nodejs                         8                             20180308143646                        default, development, ...                       
nodejs                         9                             20180322003622                        default, development, ...                       

Hint: [d]efault, [e]nabled, [i]nstalled, [l]ocked                        
[root@50390b999544 /]# dnf --assumeno module install nodejs:8:20180308143646:d7ec111e/default                                                      
Last metadata expiration check: 4:58:40 ago on Tue Mar 27 17:31:02 2018. 
Dependencies resolved.              
===================================================================================================================================================
 Package                       Arch                Version                                              Repository                            Size 
===================================================================================================================================================
Installing module packages:         
 nodejs                        x86_64              1:8.10.0-3.module_1572+d7ec111e                      updates-testing-modular              5.6 M 
 npm                           x86_64              1:5.6.0-1.8.10.0.3.module_1572+d7ec111e              updates-testing-modular              4.3 M 
Installing dependencies:            
 compat-openssl10              x86_64              1:1.0.2n-3.fc28                                      fedora                               1.1 M 
 gc                            x86_64              7.6.4-3.fc28                                         updates-testing                      108 k 
 guile                         x86_64              5:2.0.14-7.fc28                                      fedora                               3.5 M 
 http-parser                   x86_64              2.8.0-1.fc28                                         fedora                                38 k 
 libatomic_ops                 x86_64              7.6.2-3.fc28                                         fedora                                37 k 
 libicu                        x86_64              60.2-2.fc28                                          fedora                               8.8 M 
 libstdc++                     x86_64              8.0.1-0.19.fc28                                      updates-testing                      477 k 
 libtool-ltdl                  x86_64              2.4.6-22.fc28                                        fedora                                56 k 
 libuv                         x86_64              1:1.19.2-1.fc28                                      fedora                               127 k 
 make                          x86_64              1:4.2.1-6.fc28                                       fedora                               497 k 

Transaction Summary                 
===================================================================================================================================================
Install  10 Packages                

Total download size: 25 M           
Installed size: 87 M                
Operation aborted.                  
[root@50390b999544 /]# dnf --assumeno module install nodejs:8:20180308143646:deadbeef/default
Last metadata expiration check: 4:59:43 ago on Tue Mar 27 17:31:02 2018.
Dependencies resolved.
===================================================================================================================================================
 Package                       Arch                Version                                              Repository                            Size
===================================================================================================================================================
Installing module packages:
 nodejs                        x86_64              1:8.10.0-3.module_1572+d7ec111e                      updates-testing-modular              5.6 M
 npm                           x86_64              1:5.6.0-1.8.10.0.3.module_1572+d7ec111e              updates-testing-modular              4.3 M
Installing dependencies:
 compat-openssl10              x86_64              1:1.0.2n-3.fc28                                      fedora                               1.1 M
 gc                            x86_64              7.6.4-3.fc28                                         updates-testing                      108 k
 guile                         x86_64              5:2.0.14-7.fc28                                      fedora                               3.5 M
 http-parser                   x86_64              2.8.0-1.fc28                                         fedora                                38 k
 libatomic_ops                 x86_64              7.6.2-3.fc28                                         fedora                                37 k
 libicu                        x86_64              60.2-2.fc28                                          fedora                               8.8 M
 libstdc++                     x86_64              8.0.1-0.19.fc28                                      updates-testing                      477 k
 libtool-ltdl                  x86_64              2.4.6-22.fc28                                        fedora                                56 k
 libuv                         x86_64              1:1.19.2-1.fc28                                      fedora                               127 k
 make                          x86_64              1:4.2.1-6.fc28                                       fedora                               497 k

Transaction Summary
===================================================================================================================================================
Install  10 Packages

Total download size: 25 M
Installed size: 87 M
Operation aborted.
[root@50390b999544 /]# dnf --assumeno module install nodejs:8:20180308143646:foocontext/default
Last metadata expiration check: 5:00:00 ago on Tue Mar 27 17:31:02 2018.
Error: No such module: nodejs:8:20180308143646:foocontext/default
[root@50390b999544 /]# 


Expected results:
dnf should reject the non-existent specified context

Additional info:

Comment 2 Jan Kurik 2018-08-14 10:08:56 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 3 Jaroslav Mracek 2018-09-24 17:24:52 UTC
The problem was solved in dnf-3.5.1