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 1104995 - yumdownloader can't download package when there's an oversize RPM in the destdir.
Summary: yumdownloader can't download package when there's an oversize RPM in the dest...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: yum-utils
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Valentina Mukhamedzhanova
QA Contact: Karel Srot
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-05 07:44 UTC by Karel Srot
Modified: 2015-03-05 09:03 UTC (History)
2 users (show)

Fixed In Version: yum-utils-1.1.31-26.el7
Doc Type: Bug Fix
Doc Text:
Clone Of: 1004089
Environment:
Last Closed: 2015-03-05 09:03:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0401 0 normal SHIPPED_LIVE yum-utils bug fix and enhancement update 2015-03-05 14:00:14 UTC

Description Karel Srot 2014-06-05 07:44:56 UTC
The bug is present on RHEL-7 too, tested with yum-utils-1.1.31-24.el7

Also, the behavior doesn't match the intended fix for RHEL-6,see bug 1004089 comments #c5 and #c7.

case 1:
I am missing the message '... already exists and appears to be complete' 
case 2: getting HTTP Error 416 - Requested Range Not Satisfiable while the package should be downloaded again.
case 3: getting Package does not match intended download. Suggestion: run yum --enablerepo=beaker-Server clean metadata  while the package should be downloaded again.

+++ This bug was initially created as a clone of Bug #1004089 +++

Description of problem:
When repo cache is disabled (e.g. as used in yumdownloader), YumRepository._getFile() would never check if a local file exists (both for metadata files and for RPMs), so the url is always passed to urlgrabber. The latter then finds that the target file on the local file system already exists and generates a GET with Range: header set to the size of the local file.

This of itself is a problem as it generates unnecessary HTTP load on the repo server, but it gets worse because curl doesn't check Content-Length header on receiving HTTP status 416 (https://tools.ietf.org/html/rfc2616#section-10.4.17), not to mention that some HTTP servers wouldn't add Content-Length header when returning 416. In that case, yum download fails and the requested packages are not installed.

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

How reproducible:
Always.

Steps to Reproduce:
1. Install yum-utils.
2. Download a package.rpm into a local directory dir.
3. Run yumdownloader --destdir=dir package

Actual results:
http://.../package.rpm: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 416 Requested Range Not Satisfiable"

Expected results:
dir/package.rpm already exists and appears to be complete

Additional info:
Attached patch makes this problem go away. I didn't check what the impact on use cases outside of the yumdownloader scenario outlined above is going to be.


--- Additional comment from Karel Srot on 2014-03-26 07:53:59 EDT ---

Testing the current behaviour with yum-utils-1.1.20-17 I am getting:

1. for local file smaller than the download:
Package does not match intended download. Suggestion: run yum clean metadata 

the message is not very descriptive and yum clean metadata won't help here.
Something like: rpm already exists but doesn't match the intended download but be better I guess

2. for already downloaded file:
xy.rpm already downloaded and appears to be complete

This is IMO OK

3. for a local file larger than the download:
The requested URL returned error: 416 Requested Range Not Satisfiable.


Could you please clarify how this is supposed to be fixed? I guess that the best option for 1. and 3. would be something similar to 2., e.g. just write that the local copy already exists but doesn't match

--- Additional comment from Valentina Mukhamedzhanova on 2014-03-28 09:47:31 EDT ---

This is supposed to work pretty much like in upstream, so in cases 1 and 3 the existing file will be deleted and a new one will be downloaded.

Comment 11 errata-xmlrpc 2015-03-05 09:03:15 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://rhn.redhat.com/errata/RHBA-2015-0401.html


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