Bug 1656782

Summary: When switch module stream failed, the [i]nstalled display wrong.
Product: Red Hat Enterprise Linux 8 Reporter: fzxiaomange <cyent>
Component: libdnfAssignee: Jaroslav Mracek <jmracek>
Status: CLOSED CURRENTRELEASE QA Contact: Marek Blaha <mblaha>
Severity: high Docs Contact:
Priority: medium    
Version: 8.0CC: cyent, dkutalek, dmach, james.antill, mblaha
Target Milestone: rcKeywords: Triaged
Target Release: 8.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libdnf-0.22.4-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-14 01:25:31 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:
Bug Depends On:    
Bug Blocks: 1649352    

Description fzxiaomange 2018-12-06 10:11:28 UTC
Description of problem:
When switch the module stream failed, the metadata [i]nstalled display not correct.

Version-Release number of selected component (if applicable):
rhel8.0 beta

How reproducible:
First, `yum module install nodejs:8` , It's Ok.
Then,  `yum module install nodejs:10`, It's Ok.
Then,  `yum module install nodejs:8` , It occers error:
------------
Error: Transaction check error:
  file /usr/lib/node_modules/npm/node_modules/JSONStream from install of npm-1:5.6.0-1.8.11.4.2.el8+2022+2ec55091.x86_64 conflicts with file from package npm-1:6.4.1-1.10.11.0.2.el8+2021+27085a9b.x86_64
  file /usr/lib/node_modules/npm/node_modules/abbrev from install of npm-1:5.6.0-1.8.11.4.2.el8+2022+2ec55091.x86_64 conflicts with file from package npm-1:6.4.1-1.10.11.0.2.el8+2021+27085a9b.x86_64
  file /usr/lib/node_modules/npm/node_modules/ansi-regex from install of npm-1:5.6.0-1.8.11.4.2.el8+2022+2ec55091.x86_64 conflicts with file from package npm-1:6.4.1-1.10.11.0.2.el8+2021+27085a9b.x86_64
  file /usr/lib/node_modules/npm/node_modules/ansicolors from install of npm-1:5.6.0-1.8.11.4.2.el8+2022+2ec55091.x86_64 conflicts with file from package npm-1:6.4.1-1.10.11.0.2.el8+2021+27085a9b.x86_64
------------

At this time, `rpm -qa | grep nodejs`, it display:
nodejs-10.11.0-2.el8+2021+27085a9b.x86_64.  It's correct because install nodejs:8 failed.

But, `yum module list`, it display:
nodejs  10 [d]  development, minimal, s2i, default [d]       Javascript runtime
nodejs  8 [e]   development, minimal, s2i, default [d] [i]   Javascript runtime
It's not correct because the existing nodejs is nodejs 10, not 8. At this time, the [i] should be in nodejs 10

Comment 2 Jaroslav Mracek 2018-12-11 09:09:37 UTC
I create a patch that changed behavior of DNF (https://github.com/rpm-software-management/libdnf/commit/f2ea82cbd92a439153f2135040082912a7fa8533). If module enable or disable is requested, DNF will remove all information about installed profiles, but packages will remain on the system. Please is it solving your problem?

Comment 3 fzxiaomange 2018-12-12 02:20:33 UTC
(In reply to Jaroslav Mracek from comment #2)
> I create a patch that changed behavior of DNF
> (https://github.com/rpm-software-management/libdnf/commit/
> f2ea82cbd92a439153f2135040082912a7fa8533). If module enable or disable is
> requested, DNF will remove all information about installed profiles, but
> packages will remain on the system. Please is it solving your problem?

Sorry, I don't understand your meaning

"DNF will remove all information about installed profiles" mean that whatever the `yum install` is successful or failed, it both delete [i] ? So, you discard the [i] tag ?