Bug 1550006

Summary: dnf download --resolve fails for java-1.8.0-openjdk
Product: [Fedora] Fedora Reporter: Alexander Todorov <atodorov>
Component: dnf-plugins-coreAssignee: Jaroslav Mracek <jmracek>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 27CC: dmach, jmracek, mhatina, packaging-team-maint, 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: 2018-06-28 08:35:45 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 Alexander Todorov 2018-02-28 09:37:23 UTC
Description of problem:

I'm using dnf inside a test script to resolve dependencies and download RPMs locally. The following command works fine:

# dnf install --releasever=26 --downloadonly --downloaddir=/tmp/dnf.download.2 --installroot=/tmp/dnf.root.2 java-1.8.0-openjdk-1.8.0.*


however it requires root privileges and we want to run as non-root. So I tried:

$ dnf download -v --releasever=26 --resolve --best --forcearch x86_64 --downloaddir=/tmp/dnf.download.1 --installroot=/tmp/dnf.install.1 java-1.8.0-openjdk-1.8.0.* 

This fails with:

Error in resolve


After adding some debugging into to download.py
```
            for msg in goal.problems:
                logger.debug(msg)
```

I got:


package java-1.8.0-openjdk-1:1.8.0.131-7.b12.fc26.i686 requires java-1.8.0-openjdk-headless(x86-32) = 1:1.8.0.131-7.b12.fc26, but none of the providers can be installed


Version-Release number of selected component (if applicable):

python3-dnf-plugins-core-2.1.5-4.fc27.noarch
dnf-2.7.5-2.fc27.noarch

How reproducible:
Always


Additional info:


Looking at the code inside download.py I get the feeling that the underlying hawkey.Goal object is not setup properly. In any case there is a self._goal object created in dnf's base.py so maybe use that.

Comment 1 Jaroslav Mracek 2018-03-19 11:42:01 UTC
Please can you try "dnf download -v --releasever=26 --resolve --best --forcearch x86_64 --downloaddir=/tmp/dnf.download.1 --installroot=/tmp/dnf.install.1 java-1.8.0-openjdk-1.8.0.*.x86_64"

Comment 2 Jaroslav Mracek 2018-03-19 12:11:42 UTC
The reason why you experience the problem is that it tries to resolve the transaction for i686 package together with x86_64 package. Unfortunately download always tries to handle every architecture, therefore in some combination it provides different result then install command. But I think that the real issue here is reporting of errors, therefore I created a patch that should enhance behavior (https://github.com/rpm-software-management/dnf-plugins-core/pull/248). Hope that it helps.

Comment 3 Jaroslav Mracek 2018-06-28 08:35:45 UTC
The issue is solved by dnf-plugins-core-3.0.1-1 that was released into rawhide.