Bug 1294820

Summary: dnf download doesn't work with --cacheonly
Product: [Fedora] Fedora Reporter: Jan Včelák <jv+fedora>
Component: dnf-plugins-coreAssignee: rpm-software-management
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: jmracek, jsilhan, mluscon, packaging-team-maint, pnemade, RadekHolyPublic, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-25 20:10:00 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:

Description Jan Včelák 2015-12-30 13:48:11 UTC
Description of problem:

Running 'dnf -C download' as a non-privileged user doesn't work. The command first downloads the package into the cache which is read-only for a regular user. Then the file is copied from the cache to the desired location.

Downloading the package into the cache makes a little sense, because the package is downloaded no matter if the file is already in the cache.


Version-Release number of selected component (if applicable):
dnf-plugins-core-0.1.15-1.fc23.noarch

How reproducible:
always

Steps to Reproduce:
1. $ sudo dnf clean all
2. $ sudo dnf makecache
3. $ dnf -C download --destdir /tmp bash

Actual results:
Last metadata expiration check performed 1:49:19 ago on Wed Dec 30 12:57:05 2015.
[Errno unknown] Cannot open /var/cache/dnf/fedora-fe3d2f0c91e9b65c/packages/bash-4.3.42-1.fc23.x86_64.rpm: Permission denied: 'Input/Output error

Expected results:
bash package is downloaded into /tmp


Additional info:

Comment 1 Jaroslav Mracek 2016-01-06 12:13:17 UTC
It try to use cache from root (/var/cache/dnf/) instead of user's cache (/var/tmp/dnf-USER-hash/). We will try to fix it.

Comment 2 Jaroslav Mracek 2016-01-06 12:30:52 UTC
Small correction, I think it try to write down the downloaded rpm but into root's directory /var/cache/dnf/fedora-fe3d2f0c91e9b65c/packages/ where non-privilege user doesn't have access. The problem only appear when --destdir option is used. The cache is used correctly.

Comment 3 Jaroslav Mracek 2016-01-06 12:36:35 UTC
Another correction: The problem only appear when -C option is used and it is not connected with --destdir option.

Comment 4 Fedora Admin XMLRPC Client 2016-07-08 09:25:17 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 5 Fedora End Of Life 2016-11-24 14:35:43 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 6 Jaroslav Mracek 2016-11-25 20:10:00 UTC
The presented problem cannot be reproduce with dnf-2.0. 

Steps that do not reproduce:
1. $ sudo dnf clean all
2. $ dnf clean all
3. $ dnf makecache
4. $ dnf -C download --destdir /tmp bash