Bug 1629544

Summary: dnf module list --installed claims wrong package
Product: [Fedora] Fedora Reporter: lnie <lnie>
Component: dnfAssignee: Jaroslav Mracek <jmracek>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: dmach, jmracek, lnie, mblaha, packaging-team-maint, rpm-software-management, vmukhame
Target Milestone: ---Keywords: Reopened, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-4.2.1 dnf-4.2.1-1.fc30 dnf-4.2.1-1.fc29 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-03-19 19:38:46 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:
Attachments:
Description Flags
journal none

Description lnie 2018-09-17 04:34:05 UTC
Created attachment 1483856 [details]
journal

Description of problem:
As shown in the following,dnf module list --installed will claim mongodb:3.6,but not mongodb:3.4,is installed even though I just dnf module enable it

[root@localhost ~]# dnf module list --installed
Last metadata expiration check: 1:30:19 ago on Mon 17 Sep 2018 10:41:37 AM CST.
Fedora Modular 29 - x86_64
Name                                                           Stream                                                         Profiles                                                                             
mongodb                                                        3.4 [e]                                                        client, default[i], server, ...                                                      

Hint: [d]efault, [e]nabled, [i]nstalled
[root@localhost ~]# dnf module enable mongodb:3.6
Last metadata expiration check: 1:30:41 ago on Mon 17 Sep 2018 10:41:37 AM CST.
===================================================================================================================================================================================================================
 Package                                            Arch                                              Version                                             Repository                                          Size
===================================================================================================================================================================================================================
Switching module streams:
 mongodb                                                                                              3.4 -> 3.6                                                                                                  

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

Is this ok [y/N]: y

To switch to the new streams' RPMs, run 'dnf distro-sync'. 
Then migrate configuration files and data as necessary.
[root@localhost ~]# dnf module list --installed
Last metadata expiration check: 1:30:50 ago on Mon 17 Sep 2018 10:41:37 AM CST.
Fedora Modular 29 - x86_64
Name                                                           Stream                                                         Profiles                                                                             
mongodb                                                        3.6 [e]                                                        client, default[i], server, ...                                                      

Hint: [d]efault, [e]nabled, [i]nstalled
[root@localhost ~]#  dnf module install mongodb:3.6
Last metadata expiration check: 1:31:18 ago on Mon 17 Sep 2018 10:41:37 AM CST.
Dependencies resolved.
===================================================================================================================================================================================================================
 Package                                          Arch                                     Version                                                          Repository                                        Size
===================================================================================================================================================================================================================
Upgrading:
 mongodb                                          x86_64                                   3.6.4-2.module_1831+e8c1cdcd                                     fedora-modular                                    26 M
 mongodb-server                                   x86_64                                   3.6.4-2.module_1831+e8c1cdcd                                     fedora-modular                                    22 M

Transaction Summary
===================================================================================================================================================================================================================
Upgrade  2 Packages

Total download size: 48 M
Is this ok [y/N]: N
Operation aborted.


Version-Release number of selected component (if applicable):
dnf-3.2.0-2.fc29.noarch
kernel-4.18.5-300.fc29.x86_64


How reproducible:
always

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Jaroslav Mracek 2018-09-18 14:55:43 UTC
I believe that problem was solved in dnf-3.5.1. Please if the bug is still reproducible, please don't hesitate to reopen the bug.

Comment 2 lnie 2018-09-20 08:43:35 UTC
Here is the output of the fresh installed system with Fedora-Workstation-Live-x86_64-29_Beta-1.4.iso.

[root@localhost-live lnie]# dnf module list --installed
Last metadata expiration check: 0:04:11 ago on Thu 20 Sep 2018 04:26:49 PM CST.
Fedora Modular 29 - x86_64
Name                  Stream                Profiles                                 Summary                    mongodb               3.4 [e]               client, server, default [i]              MongoDB Module             

Hint: [d]efault, [e]nabled, [i]nstalled
[root@localhost-live lnie]# dnf module enable mongodb:3.6
Last metadata expiration check: 0:14:12 ago on Thu 20 Sep 2018 04:26:49 PM CST.
Dependencies resolved.
================================================================================================================
 Package                   Arch                     Version                     Repository                 Size
================================================================================================================
Switching module streams:
 mongodb                                            3.4 -> 3.6                                                 

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

Is this ok [y/N]: y
Complete!

To switch to the new streams' RPMs, run 'dnf distro-sync'. 
Then migrate configuration files and data as necessary.
[root@localhost-live lnie]# dnf module list --installed
Last metadata expiration check: 0:14:18 ago on Thu 20 Sep 2018 04:26:49 PM CST.
Fedora Modular 29 - x86_64
Name                  Stream                Profiles                                 Summary                    mongodb               3.6 [e]               client, server, default [i]              MongoDB Module             

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

[root@localhost-live lnie]# rpm -q dnf
dnf-3.5.1-1.fc29.noarch

Comment 3 Jaroslav Mracek 2018-09-20 08:54:50 UTC
Please can you specify expected behavior. I only guess that you expect that after switching streams installed profiles should be:
a) deleted
b) packages removed and profiles deleted
c) ...

Comment 4 lnie 2018-09-20 09:24:51 UTC
dnf module list --installed is supposed to list modules that are installed on the system,right? mongodb:3.6 is not installed after you only run"dnf module enable mongodb:3.6",so the output should still list 3.4 but not 3.6.

Comment 5 Jaroslav Mracek 2018-10-01 15:54:19 UTC
The solution would be to store not only installed profiles, but also stream, and package names that were part of the profile at the time of installation.

Comment 6 Jaroslav Mracek 2018-10-02 08:20:00 UTC
Unfortunately the change has to be approve first, because it requires change in modular configuration file.

Comment 7 Jaroslav Mracek 2019-03-12 09:35:26 UTC
The problem is fixed by deleting of installed profiles during module disable/reset. Direct switching of modules is forbidden.

Comment 8 Fedora Update System 2019-03-13 13:41:55 UTC
dnf-plugins-core-4.0.6-1.fc29 libdnf-0.28.0-1.fc29 libcomps-0.1.11-1.fc29 createrepo_c-0.12.2-1.fc29 librepo-1.9.5-1.fc29 dnf-4.2.1-1.fc29 dnf-plugins-extras-4.0.4-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-a03be2cebe

Comment 9 Fedora Update System 2019-03-13 13:42:49 UTC
dnf-plugins-core-4.0.6-1.fc30 libdnf-0.28.0-1.fc30 libcomps-0.1.11-1.fc30 createrepo_c-0.12.2-1.fc30 librepo-1.9.5-1.fc30 dnf-4.2.1-1.fc30 dnf-plugins-extras-4.0.4-1.fc30 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-bc9607a8dc

Comment 10 Fedora Update System 2019-03-13 15:37:07 UTC
createrepo_c-0.12.2-1.fc30, dnf-4.2.1-1.fc30, dnf-plugins-core-4.0.6-1.fc30, dnf-plugins-extras-4.0.4-1.fc30, libcomps-0.1.11-1.fc30, libdnf-0.28.0-1.fc30, librepo-1.9.5-1.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-bc9607a8dc

Comment 11 Fedora Update System 2019-03-14 18:51:37 UTC
createrepo_c-0.12.2-1.fc29, dnf-4.2.1-1.fc29, dnf-plugins-core-4.0.6-1.fc29, dnf-plugins-extras-4.0.4-1.fc29, libcomps-0.1.11-1.fc29, libdnf-0.28.0-1.fc29, librepo-1.9.5-1.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-a03be2cebe

Comment 12 Fedora Update System 2019-03-15 13:09:41 UTC
createrepo_c-0.12.2-1.fc30 dnf-4.2.1-1.fc30 dnf-plugins-core-4.0.6-1.fc30 dnf-plugins-extras-4.0.4-1.fc30 libcomps-0.1.11-1.fc30 libdnf-0.28.0-1.fc30 librepo-1.9.5-1.fc30 swid-tools-0.7.3-1.fc30 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-bc9607a8dc

Comment 13 Fedora Update System 2019-03-16 20:17:36 UTC
createrepo_c-0.12.2-1.fc30, dnf-4.2.1-1.fc30, dnf-plugins-core-4.0.6-1.fc30, dnf-plugins-extras-4.0.4-1.fc30, libcomps-0.1.11-1.fc30, libdnf-0.28.0-1.fc30, librepo-1.9.5-1.fc30, swid-tools-0.7.3-1.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-bc9607a8dc

Comment 14 Fedora Update System 2019-03-19 19:38:46 UTC
createrepo_c-0.12.2-1.fc30, dnf-4.2.1-1.fc30, dnf-plugins-core-4.0.6-1.fc30, dnf-plugins-extras-4.0.4-1.fc30, libcomps-0.1.11-1.fc30, libdnf-0.28.0-1.fc30, librepo-1.9.5-1.fc30, swid-tools-0.7.3-1.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2019-03-21 14:40:44 UTC
createrepo_c-0.12.2-1.fc29, dnf-4.2.1-1.fc29, dnf-plugins-core-4.0.6-1.fc29, dnf-plugins-extras-4.0.4-1.fc29, libcomps-0.1.11-1.fc29, libdnf-0.28.0-1.fc29, librepo-1.9.5-1.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.