Bug 1281969

Summary: baseurl with file:// hangs and then timeout in yum repo
Product: Red Hat Enterprise Linux 7 Reporter: eduda
Component: curlAssignee: Kamil Dudka <kdudka>
Status: CLOSED ERRATA QA Contact: Daniel Rusek <drusek>
Severity: medium Docs Contact:
Priority: urgent    
Version: 7.1CC: bnater, dmach, drusek, fkrska, kdudka, mdomonko, vchoudha
Target Milestone: rcKeywords: Triaged, ZStream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: curl-7.29.0-52.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1709474 (view as bug list) Environment:
Last Closed: 2019-08-06 13:03:15 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:
Bug Depends On:    
Bug Blocks: 1709474    

Description eduda 2015-11-13 22:54:38 UTC
Description of problem:

using file:// in the repo appears to cause yum to timeout and not work

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


How reproducible:

cat /rpmcache/7/myrepo.repo 

[myrepo]
name=myrepo
baseurl=file:///rpmcache/7/myrepo
enabled=1

/rpmcache/7/myrepo/* has a few rpms in it and repodata is created with createrepo

/usr/bin/yum --setopt=reposdir=/rpmcache/7 list


Actual results:

file:///rpmcache/7/myrepo/repodata/repomd.xml: [Errno 12] Timeout on file://rpmcache/7/myrepo/repodata/repomd.xml: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds')
Trying other mirror.

...repeats that msg.

Expected results:

should list the rpms

Additional info:

python-urlgrabber-3.10-6.el7.noarch

Comment 2 eduda 2015-11-18 17:21:56 UTC
bug appears to be related to throttle=100 in yum.conf, so we might be able to work around this by increasing it.

Comment 4 Michal Domonkos 2018-11-28 17:27:07 UTC
Indeed, curl shouldn't apply the speed limit when fetching local files:

https://curl.haxx.se/libcurl/c/CURLOPT_MAX_RECV_SPEED_LARGE.html

[...]
This option doesn't affect transfer speeds done with FILE:// URLs. 
[...]

This is also reproducible using the curl(1) binary on RHEL-7.6:

$ curl --limit-rate 100 file:///path/to/file

I have tried the same command on a Fedora 29 system and it worked correctly (i.e. the limit wasn't applied).  Reassigning to curl.

Comment 5 Kamil Dudka 2018-11-28 21:59:57 UTC
(In reply to Michal Domonkos from comment #4)
> Indeed, curl shouldn't apply the speed limit when fetching local files:
> 
> https://curl.haxx.se/libcurl/c/CURLOPT_MAX_RECV_SPEED_LARGE.html
> 
> [...]
> This option doesn't affect transfer speeds done with FILE:// URLs. 
> [...]

You are referring to documentation of the latest upstream release of curl, not to the release of curl that we have in RHEL-7.

> This is also reproducible using the curl(1) binary on RHEL-7.6:
> 
> $ curl --limit-rate 100 file:///path/to/file
> 
> I have tried the same command on a Fedora 29 system and it worked correctly
> (i.e. the limit wasn't applied).  Reassigning to curl.

Thanks for the reproducer!  This was fixed upstream by the following commits:

https://github.com/curl/curl/commit/curl-7_34_0-39-g2715d7f94
https://github.com/curl/curl/commit/curl-7_34_0-40-gf718415bc

We should be able to backport them to RHEL-7.

Comment 6 Michal Domonkos 2018-11-30 14:43:41 UTC
(In reply to Kamil Dudka from comment #5)
> You are referring to documentation of the latest upstream release of curl,
> not to the release of curl that we have in RHEL-7.

Oh, you got me there :)  Right, I didn't consider this possibility.  Thanks for noticing.

> 
> > This is also reproducible using the curl(1) binary on RHEL-7.6:
> > 
> > $ curl --limit-rate 100 file:///path/to/file
> > 
> > I have tried the same command on a Fedora 29 system and it worked correctly
> > (i.e. the limit wasn't applied).  Reassigning to curl.
> 
> Thanks for the reproducer!  This was fixed upstream by the following commits:
> 
> https://github.com/curl/curl/commit/curl-7_34_0-39-g2715d7f94
> https://github.com/curl/curl/commit/curl-7_34_0-40-gf718415bc
> 
> We should be able to backport them to RHEL-7.

That's perfect, thank you!

Comment 9 Kamil Dudka 2019-05-09 13:10:24 UTC
*** Bug 1701370 has been marked as a duplicate of this bug. ***

Comment 15 errata-xmlrpc 2019-08-06 13: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://access.redhat.com/errata/RHSA-2019:2181