RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1690894 - dnf download does not re-download damaged .rpm
Summary: dnf download does not re-download damaged .rpm
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: dnf
Version: 8.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 8.1
Assignee: Jaroslav Mracek
QA Contact: Luca Berton
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-20 12:23 UTC by Eva Mrakova
Modified: 2023-02-16 17:47 UTC (History)
7 users (show)

Fixed In Version: librepo-1.10.6-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-28 16:47:40 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-29677 0 None None None 2023-02-16 17:47:37 UTC
Red Hat Product Errata RHBA-2020:1823 0 None None None 2020-04-28 16:47:54 UTC

Description Eva Mrakova 2019-03-20 12:23:56 UTC
Description of problem:
when an already downloaded .rpm is damaged, 'dnf download' does not re-download
the file and ends up with a strange error message.

Version-Release number of selected component (if applicable):
dnf-4.0.9.2-5.el8.noarch

How reproducible:
always for certain ways of damage

Steps to Reproduce:
1. dnf download bash
   (downloads bash-4.4.19-7.el8.x86_64.rpm)
2. echo whatever > bash-4.4.19-7.el8.x86_64.rpm
3. dnf download bash

Actual results:
# dnf download bash
[MIRROR] bash-4.4.19-7.el8.x86_64.rpm: Downloading successful, but checksum doesn't match. Calculated: 9cbe93e459acf1d1c437eebbe13bc2bb5b047ec44e8d454d5b827c353c1079ac(sha256)  Expected: 5976a32244ccd1e5cabf8fef04f7c65eae6802504344a14f08b9539f941189df(sha256) 
[FAILED] bash-4.4.19-7.el8.x86_64.rpm: No more mirrors to try - All mirrors were already tried without success

Expected results:
.rpm is successfully re-downloaded


Additional info:
* when the damaged .rpm is removed, dnf download gets the file again without 
  any problems
* the bug is not present for certain ways of damages, e.g. when the damaged 
  file is empty or it is a part of the non-damaged original .rpm, etc.

Comment 2 Jaroslav Mracek 2019-03-29 11:38:52 UTC
I am sorry, but I am unable to reproduce the issue using reproducer above.
dnf-4.2.3-1.git.8777.b570a46.fc29.noarch
dnf-plugins-core-4.0.6-1.fc29.noarch


Please could you provide some additional data?

Comment 3 Eva Mrakova 2019-03-29 12:01:10 UTC
I'm still able to reproduce the bug on rhel8 with the packages
dnf-plugins-core-4.0.2.2-3.el8.noarch
dnf-4.0.9.2-5.el8.noarch
exactly the same way as described in comment 0. Also for other packages than bash.

This is a console log for 'dnf -v download...' (other repos disabled just to shorten the log):

# cat bash-4.4.19-7.el8.x86_64.rpm
whatever
# dnf --disablerepo=* --enablerepo=rhel -v download bash
Loaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, needs-restarting, playground, product-id, repoclosure, repodiff, repograph, repomanage, reposync, subscription-manager, uploadprofile
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
DNF version: 4.0.9
cachedir: /var/cache/dnf
Repository beaker-client-testing is listed more than once in the configuration
rhel                                            2.3 kB/s | 2.3 kB     00:01    
reviving: 'rhel' can be revived - repomd matches.
not found other for: rhel
not found modules for: rhel
not found deltainfo for: rhel
not found updateinfo for: rhel
rhel: using metadata from Wed 27 Mar 2019 12:02:58 AM EDT.
No module defaults found
Completion plugin: Generating completion cache...
[MIRROR] bash-4.4.19-7.el8.x86_64.rpm: Downloading successful, but checksum doesn't match. Calculated: 9cbe93e459acf1d1c437eebbe13bc2bb5b047ec44e8d454d5b827c353c1079ac(sha256)  Expected: 5976a32244ccd1e5cabf8fef04f7c65eae6802504344a14f08b9539f941189df(sha256) 
[FAILED] bash-4.4.19-7.el8.x86_64.rpm: No more mirrors to try - All mirrors were already tried without success
# rm -f bash-4.4.19-7.el8.x86_64.rpm
# dnf --disablerepo=* --enablerepo=rhel -v download bash
Loaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, needs-restarting, playground, product-id, repoclosure, repodiff, repograph, repomanage, reposync, subscription-manager, uploadprofile
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
DNF version: 4.0.9
cachedir: /var/cache/dnf
Repository beaker-client-testing is listed more than once in the configuration
rhel                                            2.3 kB/s | 2.3 kB     00:01    
reviving: 'rhel' can be revived - repomd matches.
not found other for: rhel
not found modules for: rhel
not found deltainfo for: rhel
not found updateinfo for: rhel
rhel: using metadata from Wed 27 Mar 2019 12:02:58 AM EDT.
No module defaults found
Completion plugin: Generating completion cache...
bash-4.4.19-7.el8.x86_64.rpm                     60 MB/s | 1.5 MB     00:00    


What other kind of additional data would help?

Comment 5 Jaroslav Mracek 2019-07-29 07:28:27 UTC
I create a patch (https://github.com/rpm-software-management/librepo/pull/162). The problem was that downloaded package keeps 'user.Librepo.DownloadInProgress=0sAA==' file attribute therefore librepo thinks that the last download was interrupted. The patch remove the attribute after successful download.

Also it requires patches from related pull requests - https://github.com/rpm-software-management/librepo/pull/158, https://github.com/rpm-software-management/librepo/pull/161, to fully resolve the issue. They allows to try multiple times to download content over damaged rpm.

Comment 6 Jaroslav Mracek 2019-07-29 08:28:36 UTC
I have also a problem to create a test for the issue because it requires a file system that allows usage of extended file attributes. The attributes can be seen by getfattr -d -m - file bash-5.0.7-1.fc30.x86_64.rpm.

The original librepo keeps user.Librepo.DownloadInProgress=0sAA==.

The patch change key to user.Librepo.DownloadInProgress="1" and removes the key after successful download.

Please do you have any idea how to test it?

Comment 14 errata-xmlrpc 2020-04-28 16:47:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:1823


Note You need to log in before you can comment on or make changes to this bug.