Bug 1729465

Summary: dnf: bogus problem report with python3.8
Product: [Fedora] Fedora Reporter: Zbigniew Jędrzejewski-Szmek <zbyszek>
Component: dnfAssignee: Marek Blaha <mblaha>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 32CC: jmracek, jrohel, mblaha, mhatina, mhroncok, packaging-team-maint, pkratoch, 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: 2020-02-14 14:32:23 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: 1686977    

Description Zbigniew Jędrzejewski-Szmek 2019-07-12 11:15:41 UTC
Description of problem:
This is really confusing, I'm not sure what exactly is going on here. But the problem report seems to misattribute requirements:

# dnf upgrade --allowerasing  --best
Last metadata expiration check: 3:09:50 ago on Fri Jul 12 09:47:19 2019.
Error: 
 Problem 1: problem with installed package mpich-3.2.1-12.fc31.x86_64
  - cannot install the best update candidate for package mpich-3.2.1-12.fc31.x86_64
  - python3-3.7.4~rc2-1.fc31.i686 has inferior architecture
  - package python3-3.8.0~b2-1.fc31.x86_64 requires (python(abi) = 3.7 if python3), but none of the providers can be installed
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  - cannot install both python3-3.8.0~b2-1.fc31.x86_64 and python3-3.7.4~rc2-1.fc31.x86_64
  - cannot install both python3-3.7.4~rc2-1.fc31.x86_64 and python3-3.8.0~b2-1.fc31.x86_64
  - problem with installed package python3-3.7.4~rc2-1.fc31.x86_64
  - cannot install the best update candidate for package python3-3.7.4~rc2-1.fc31.x86_64
 Problem 2: problem with installed package python3-libs-3.7.4~rc2-1.fc31.x86_64
  - cannot install the best update candidate for package python3-libs-3.7.4~rc2-1.fc31.x86_64
  - cannot install the best update candidate for package python3-rpm-4.15.0-0.beta.1.fc31.x86_64
  - problem with installed package python3-rpm-4.15.0-0.beta.1.fc31.x86_64
  - package python3-rpm-4.15.0-0.beta.1.fc31.x86_64 requires libpython3.7m.so.1.0()(64bit), but none of the providers can be installed
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  - cannot install both python3-libs-3.8.0~b2-1.fc31.x86_64 and python3-libs-3.7.4~rc2-1.fc31.x86_64
  - cannot install both python3-libs-3.7.4~rc2-1.fc31.x86_64 and python3-libs-3.8.0~b2-1.fc31.x86_64
(try to add '--skip-broken' to skip uninstallable packages)

But in fact the python3 package has no such requirements.

# rpm -qpR python3-3.8.0~b2-1.fc31.x86_64.rpm 
libc.so.6()(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libpython3.8.so.1.0()(64bit)
python3-libs(x86-64) = 3.8.0~b2-1.fc31
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsZstd) <= 5.4.18-1
rpmlib(TildeInVersions) <= 4.10.0-1
rtld(GNU_HASH)

It's the mpich package which does (and only it):
# rpm -qR mpich|grep python
(python(abi) = 3.7 if python3)

It looks like dnf is mixing the package which has the provides with the package which has the requires.

Version-Release number of selected component (if applicable):
rpm-4.15.0-0.beta.1.fc31.x86_64
dnf-4.2.7-1.fc31.noarch

How reproducible:
deterministic

Steps to Reproduce:
1. Install mpich
2. Enable python3.8 copr: https://copr.fedorainfracloud.org/coprs/g/python/python3.8/
3. Try to upgrade to latest versions of packages

What's even more confusing, the problem is not with mpich (because the Requires is conditional), and not with python3 (as said above), but with meson, which comes from a module and wasn't rebuilt properly. And a slightly different dnf command let's things upgrade properly:
# dnf upgrade python3 --best --allowerasing
Last metadata expiration check: 3:17:02 ago on Fri Jul 12 09:47:19 2019.
Dependencies resolved.
==========================================================================================================================
 Package                          Arch        Version                                   Repository                   Size
==========================================================================================================================
Upgrading:
 python3                          x86_64      3.8.0~b2-1.fc31                           group_python-python3.8       27 k
 python3-libs                     x86_64      3.8.0~b2-1.fc31                           group_python-python3.8      7.6 M
 unbound-libs                     x86_64      1.8.3-4.fc31                              group_python-python3.8      515 k
Reinstalling:
 gdb-headless                     x86_64      8.3.50.20190702-19.fc31                   group_python-python3.8      3.7 M
 gobject-introspection-devel      x86_64      1.60.1-3.fc31                             group_python-python3.8      1.0 M
 mpich                            x86_64      3.2.1-12.fc31                             group_python-python3.8      1.2 M
 python3-cccolutils               x86_64      1.5-11.fc31                               group_python-python3.8       21 k
 python3-dnf                      noarch      4.2.7-1.fc31                              group_python-python3.8      399 k
 python3-future                   noarch      0.17.1-0.1.20190313gitc423752.fc31        group_python-python3.8      735 k
 python3-gitdb                    noarch      2.0.3-6.fc31                              group_python-python3.8      108 k
 python3-gpg                      x86_64      1.12.0-2.fc31                             group_python-python3.8      251 k
 python3-hawkey                   x86_64      0.35.1-1.fc31                             group_python-python3.8       98 k
 python3-hyperlink                noarch      19.0.0-1.fc31                             group_python-python3.8       75 k
 python3-idna                     noarch      2.8-1.fc31                                group_python-python3.8       97 k
 python3-libcomps                 x86_64      0.1.11-1.fc31                             group_python-python3.8       50 k
 python3-libdnf                   x86_64      0.35.1-1.fc31                             group_python-python3.8      732 k
 python3-librepo                  x86_64      1.10.2-2.fc31                             group_python-python3.8       50 k
 python3-mako                     noarch      1.0.12-1.fc31                             group_python-python3.8      145 k
 python3-markupsafe               x86_64      1.1.1-1.fc31                              group_python-python3.8       32 k
 python3-numexpr                  x86_64      2.6.6-3.fc31                              group_python-python3.8      197 k
 python3-numpy                    x86_64      1:1.16.4-2.fc31                           group_python-python3.8      3.5 M
 python3-psutil                   x86_64      5.6.3-1.fc31                              group_python-python3.8      379 k
 python3-pyroute2                 noarch      0.5.3-3.fc31                              group_python-python3.8      470 k
 python3-rpm                      x86_64      4.15.0-0.beta.1.fc31                      group_python-python3.8       98 k
 python3-setuptools               noarch      41.0.1-2.fc31                             group_python-python3.8      581 k
 python3-smmap                    noarch      2.0.3-6.fc31                              group_python-python3.8       47 k
 python3-stomper                  noarch      0.4.3-1.fc31                              group_python-python3.8       49 k
Removing dependent packages:
^^^^^^(bogus message here)^^
 meson                            noarch      0.50.1-1.module_f31+3967+781a4e9d         @rawhide-modular            4.0 M
 python3-GitPython                noarch      2.1.11-3.fc31                             @rawhide                    2.4 M

Transaction Summary
==========================================================================================================================
Upgrade  3 Packages
Remove   2 Packages
...

It seems that --allowerasing doesn't work until dnf is tickled to do a partial upgrade.
Subsequent 'dnf upgrade --best --allowerasing' only upgrades two unrelated packages without issue.

Comment 1 Marek Blaha 2019-07-16 13:10:26 UTC
The problem seems to be with having two different packages with the same NEVRA in two repositories. In this case it is mpich-0:3.2.1-12.fc31.x86_64 in rawhide and group_python-python3.8 repositories:

# dnf repoquery mpich-0:3.2.1-12.fc31.x86_64 --requires --repoid=rawhide
Last metadata expiration check: 0:54:17 ago on Út 16. července 2019, 13:28:00 CEST.
(python(abi) = 3.7 if python3)
/usr/bin/perl
.....

# dnf repoquery mpich-0:3.2.1-12.fc31.x86_64 --requires --repoid=group_python-python3.8
Last metadata expiration check: 0:54:21 ago on Út 16. července 2019, 13:27:58 CEST.
(python(abi) = 3.8 if python3)
/usr/bin/perl
.....

# dnf repoquery mpich-0:3.2.1-12.fc31.x86_64 --requires 
Last metadata expiration check: 0:54:10 ago on Út 16. července 2019, 13:28:00 CEST.
(python(abi) = 3.7 if python3)
(python(abi) = 3.8 if python3)
/usr/bin/perl
.....
When you do not specify the repo to work with, the requirements from both mpich packages are merged resulting in this contradictory requirements.

Anyway, the DNF error messages really are misleading.

Comment 2 Ben Cotton 2019-08-13 16:52:29 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 3 Ben Cotton 2019-08-13 18:53:18 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to 31.

Comment 4 Marek Blaha 2020-02-11 14:47:59 UTC
I think the issue is in libsolv. I've filed an issue for this: https://github.com/openSUSE/libsolv/issues/367

Comment 5 Ben Cotton 2020-02-11 15:35:50 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle.
Changing version to 32.

Comment 6 Marek Blaha 2020-02-14 14:32:23 UTC
The libsolv issue has been resolved in upstream. You can test the latest libsolv from our nightly repo (dnf copr enable rpmsoftwaremanagement/dnf-nightly). With this libsolv installed, I'm no longer able to reproduce the bug.