Bug 1211891

Summary: If an error occurs dnf don't resume work and re-redownload everything.
Product: [Fedora] Fedora Reporter: Mikhail <mikhail.v.gavrilov>
Component: dnfAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: covex, jmontleo, jones.peter.busi, jonha87, jsilhan, jzeleny, mikhail.v.gavrilov, mluscon, mustafa1024m, packaging-team-maint, pnemade, tim.lauridsen, vmukhame
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-19 12:24:39 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:
Attachments:
Description Flags
dnf tty output none

Description Mikhail 2015-04-15 07:41:40 UTC
Created attachment 1014614 [details]
dnf tty output

Description of problem:
If an error occurs dnf don't resume work and re-redownload everything.

In attached log you can see that occurs error:

Error: Error downloading packages:.fc22.i686.rpm                                       73% [==============================================================-                      ] 2.5 MB/s | 100 MB     00:14 ETA
  Curl error (56): Failure when receiving data from the peer for ftp://ftp.linux.cz/pub/linux/fedora/linux/updates/testing/22/i386/drpms/iwl5000-firmware-8.83.5.1_1-46.fc22_8.83.5.1_1-49.fc22.noarch.drpm [response reading failed]


After restart DNF begins re-redownload all downloaded packages again.

Comment 1 Jason Montleon 2015-04-27 15:17:28 UTC
Same issue. Get hung up on a missing gpg key, import, try to install again, redownload everything again.

Comment 2 Honza Silhan 2015-04-28 08:46:51 UTC
Thanks for the report. DNF tries to clean up after any job. Does it happen with `keepcache=True` option set in /etc/dnf/dnf.conf?

Comment 3 Mikhail 2015-04-29 16:41:54 UTC
Thanks, with option "keepcache=true" DNF work as expected.
I think you should enable this option by default.
Who needs to clear the cache will always be able to type "dnf clean all"

Comment 4 Radek Holy 2015-04-30 08:32:09 UTC
I'm afraid that a lot of users will complain if we wouldn't remove downloaded packages automatically. Actually there is the "local" plugin for those people who have unlimited disk space.
We could rather "keepcache" only in case of an error. But it's questionable which concrete error should it be.

Comment 5 Mikhail 2015-04-30 08:33:59 UTC
(In reply to Radek Holy from comment #4)
> We could rather "keepcache" only in case of an error. But it's questionable
> which concrete error should it be.

1. Error downloading packages
2. missing gpg key

Comment 6 Radek Holy 2015-04-30 08:38:58 UTC
Yeah. I should rather say: We should carefully consider which errors should it be. I agree with those two. (Hopefully, librepo allows us to recognize them.)

Comment 7 Jonathan Haas 2015-05-03 19:05:05 UTC
I was just installing 420MB of updates and after the download finished (it took some time because I have rather bad internet) dnf complained that the disk is full and aborted the installation. So I deleted some files and started the update again, and dnf redownloads everything again. This is stupid. Other package managers keep the files in cache somewhere and delete them only if they aren't needed anymore (because the update succeeded or whatever) or after some time has passed (I don't know the details).

TLDR, a full disk error should also cause the cache to be kept.

Comment 8 Radek Holy 2015-05-04 11:14:38 UTC
*** Bug 1217876 has been marked as a duplicate of this bug. ***

Comment 9 Radek Holy 2015-05-04 11:18:49 UTC
I wonder how helpful (and difficult) would it be to remove cache only during the next run... In combination of this with the cache sharing service (which is being developed these days, I believe) it could even result in no need for --keepcache any more.

Comment 10 Honza Silhan 2015-05-05 12:36:42 UTC

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

Comment 11 Mustafa Muhammad 2015-05-06 15:42:06 UTC
But this is not the same as that package, I don't believe it is a duplicate.
When I downloaded 200 MBs of updates I don't want it to go if I press no, or a problem in gpg checking.

Comment 12 Adam Pribyl 2015-10-04 17:21:29 UTC
As the duplicated bug moved completely out of scope, I do reopen this one, as this behavior of DNF is plain wrong. This bothers me every then and now as dnf deletes all packages downloaded for running transaction on transaction failures.

This has nothing to do with keepcache option as it was in the yum - this meant to not remove cache on successful completition. We do want the same behavior as yum did it. Why the hell should I redownload 4 times 1GB of updates that takes 15minuts just because it 
a) was not able to install kernel in /boot due to not enought space?
b) was missing gpg signature for certain package
c) mirrors have failed due to dropout in the internet connection
d) ...

Comment 13 Michal Luscon 2015-10-19 12:24:39 UTC
Are you aware that we reworked this behaviour of dnf?

keepcache

    boolean

    Keep downloaded packages in the cache. If set to False and packages have not been installed they will still persist until next successful transaction. The default is False.