Bug 1480467

Summary: (dnf-modularity) how list --installed shows installed modules
Product: [Fedora] Fedora Reporter: Irina Gulina <igulina>
Component: dnfAssignee: Martin Hatina <mhatina>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 26CC: dmach, igulina, mhatina, packaging-team-maint, rpm-software-management, vmukhame
Target Milestone: ---   
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: 2017-08-16 06:15:36 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    
Attachments:
Description Flags
logs list installed pkgs
none
ansible 25 pkgs install, reinstall installed pkg, no that pkg in --installed none

Description Irina Gulina 2017-08-11 08:23:57 UTC
Created attachment 1311996 [details]
logs list installed pkgs

Description of problem:

1) dnf module list --installed shows only 2 modules, however I have 18 of them installed
2) dnf list --installed also shows only 2 modules installed in the end of its output under MODULES section, it seems others are under INSTALLED PACKAGES

See attached logs and:

>> cat /etc/dnf/modules.d/httpd.module"
[httpd]
name = httpd
stream = f26
version = 20170717182804
profiles = default
enabled = 1
locked = 

>> cat /etc/dnf/modules.d/systemtools.module"
[systemtools]
name = systemtools
stream = f26
version = 20170714152023
profiles = default
enabled = 1
locked = 

Version-Release number of selected component (if applicable):
latest boltron compose 07-17
dnf-2.6.0-3.git.40.c0f7fc6.module_a7788b02.noarch

How reproducible:
always

Comment 1 Martin Hatina 2017-08-14 06:27:10 UTC
Can you provide commands you installed profiles with, please?

Comment 2 Irina Gulina 2017-08-14 08:17:19 UTC
I didn't specify any profiles, just:

`dnf module install [module_name]`

Ansible playbook reported 18 modules were installed. 7 failed. And just 2 shown with list --installed as comment #0 says.

Comment 3 Martin Hatina 2017-08-14 08:45:53 UTC
How many `dnf module install` commands have you run? According to '/etc/dnf/modules.d/*.module' you have only 2 profiles installed from 2 modules.

Comment 4 Irina Gulina 2017-08-14 09:35:43 UTC
Created attachment 1313006 [details]
ansible 25 pkgs install, reinstall installed pkg, no that pkg in --installed

Comment 5 Irina Gulina 2017-08-14 09:42:10 UTC
All Boltron modules, 25 of them, are installed in Ansible loop [1]. 
See the attachment in the comment #4. Ansible reports that mariadb was installed. See in the end of that attachment, I tried to install mariadb again. Dnf says 2 mariadb pkgs are installed, there is nth to install, when I query --installed modules, only 2 are shown. 

I'm not the only one who says there is such an issue. Adam put it into Known Issues, though never reported it elsewhere [2]

[1] https://github.com/alexxa/compose_tester/blob/master/tests/modules_install.yaml#L8
[2] https://docs.pagure.org/modularity/prototype/boltron/issues.html

Comment 6 Irina Gulina 2017-08-14 09:43:09 UTC
*only 2 are shown, no mariadb among them.

Comment 7 Irina Gulina 2017-08-14 09:48:57 UTC
Another example: nodejs installed, but not listed by --installed: 

>> [vagrant@fvagrant ~]$ docker exec boltron_container bash -l -c "dnf module install nodejs"
Last metadata expiration check: 0:19:45 ago on Mon Aug 14 09:26:39 2017.
Package npm-1:3.10.10-1.6.10.3.2.module_9c237b2a.x86_64 is already installed, skipping.
Package nodejs-1:6.10.3-2.module_9c237b2a.x86_64 is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!
[>> vagrant@fvagrant ~]$ docker exec boltron_container bash -l -c "dnf module list --installed | grep nodejs"
>> [vagrant@fvagrant ~]$ docker exec boltron_container bash -l -c "dnf module list --installed " 
Last metadata expiration check: 0:20:26 ago on Mon Aug 14 09:26:39 2017.
Name        Stream Version        Repo           Installed                                                                Info
httpd       f26    20170717182804 fedora-modular default                                                       httpd webserver
systemtools f26    20170714152023 fedora-modular default   Provides the tools a general Linux user expects on the command line

Comment 8 Martin Hatina 2017-08-16 06:15:36 UTC
Looks like it is connected with https://bugzilla.redhat.com/show_bug.cgi?id=1475375. Module profiles are installed, but dnf backtraced before writing it to conf. Due to this it has no information about all installed profiles. Closing.