Bug 1680684

Summary: The profile is marked as installed despite the fact that artifacts installation failed
Product: Red Hat Enterprise Linux 8 Reporter: Marek Blaha <mblaha>
Component: dnfAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED DUPLICATE QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.0CC: james.antill, jberan, ksrot
Target Milestone: rcKeywords: Triaged
Target Release: 8.0Flags: jberan: mirror+
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: 2019-06-18 09:35:54 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:

Description Marek Blaha 2019-02-25 14:16:48 UTC
Description of problem:

This bug is a variation on https://bugzilla.redhat.com/show_bug.cgi?id=1656782 without switching the streams.
Despite unsuccessful installation of module:stream/profile, the profile is marked as installed in `dnf module list` output.


Version-Release number of selected component (if applicable):
# rpm -q dnf libdnf
dnf-4.0.9.2-5.el8.noarch
libdnf-0.22.5-4.el8.x86_64

How reproducible:
deterministic

Steps to Reproduce:
Given we have two versions of package, each version file conflicts with the other. The first one (FileConflict-1.0-1.x86_64) came from ursine repo, the second one (FileConflict-0:2.0.streamB-1.x86_64) is part of non-enabled module.
$ cat modules.yaml 
---
document: modulemd
version: 2
data:
  name: TestModule
  stream: B
  version: 1
  context: 6c81f848
  summary: Test module
  description: >-
      This is a test module
  profiles:
    default:
      rpms:
      - FileConflict
  artifacts:
    rpms:
    - FileConflict-0:2.0.streamB-1.x86_64
...

# dnf install FileConflict-1.0-1.x86_64
# dnf module install TestModule:B/default
Last metadata expiration check: 0:02:12 ago on Mon Feb 25 14:07:34 2019.
Dependencies resolved.
==========================================================================================
 Package              Arch           Version                  Repository             Size
==========================================================================================
Upgrading:
 FileConflict         x86_64         2.0.streamB-1            fileconflicts         6.7 k
Installing module profiles:
 TestModule/default                                                                      
Enabling module streams:
 TestModule                          B                                                   

Transaction Summary
==========================================================================================
Upgrade  1 Package

Total size: 6.7 k
Is this ok [y/N]: y
Downloading Packages:
[SKIPPED] FileConflict-2.0.streamB-1.x86_64.rpm: Already downloaded                      
Running transaction check
Transaction check succeeded.
Running transaction test
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: Transaction check error:
  file /usr/lib/FileConflict/a_dir from install of FileConflict-0:2.0.streamB-1.x86_64 conflicts with file from package FileConflict-0:1.0-1.x86_64

Error Summary
-------------

bash-4.4# echo $?
1


Actual results:

# dnf module list
Last metadata expiration check: 0:03:17 ago on Mon Feb 25 14:07:34 2019.
fileconflicts
Name                    Stream             Profiles                Summary                
TestModule              B [e]              default [i]             Test module            

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


Expected results:
profile "default" is not marked as installed.


Additional info:
The test of this bug is a part of ci-dnf-stack as module-install-7.feature.

Comment 1 Marek Blaha 2019-06-18 09:35:54 UTC

*** This bug has been marked as a duplicate of bug 1719679 ***