Actions
Issue #4120
closedSyncing a repo with `background` download policy raises InvalidURL in RHEL 7.6
Start date:
Due date:
Estimated time:
Severity:
4. Urgent
Version:
Platform Release:
2.18.0
OS:
RHEL 7
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Sprint 45
Quarter:
Description
Steps to reproduce:¶
On a RHEL 7.6 system with Pulp 2.19a1 try to sync a repository using `background` download policy.
Actual Results:¶
Fails with InvalidURL looks like the hostname is being stripped from url `https:///streamer/var/lib/` should be `https://HOSTNAME/streamer/var/lib/\`
Traceback:
Nov 05 09:48:54 rhel-76-pulp-2 pulp[32479]: nectar.downloaders.threaded:ERROR: (32479-15392) Invalid URL u'https:///streamer/var/lib/[942/1850]
nt/units/rpm/49/4cfcbf385e13d07497e336719a12c530a7b908f24d4bc49961f29d6c88d20e/horse-0.22-2.noarch.rpm?policy=eyJleHRlbnNpb25zIjoge30sICJyZXNvd
XJjZSI6ICIvc3RyZWFtZXIvdmFyL2xpYi9wdWxwL2NvbnRlbnQvdW5pdHMvcnBtLzQ5LzRjZmNiZjM4NWUxM2QwNzQ5N2UzMzY3MTlhMTJjNTMwYTdiOTA4ZjI0ZDRiYzQ5OTYxZjI5ZDZ$
ODhkMjBlL2hvcnNlLTAuMjItMi5ub2FyY2gucnBtIiwgImV4cGlyYXRpb24iOiAxNTcyOTY1MzM0fQ%3D%3D;signature=U9lk6sPAapefL_eq3YMy7u0jJeH_d6Jjj6GLrSowaAFrOa-$
-mO2M9s5XMaAWVmqD3gLRvI61_hmV8AxLymSylZSLw4nfjOPDn_k7Jd1DCLvE0l8xcGbS2s2Bo5ScnxCGQsSAneiaQHrStFHIxBr-0JgPKDAARe1RV375AcpKQTBgVIPjzNJ6RhZ5Qybg_$
RXvWI2YP66cn915zCcv9bWYgH5gkE6b6mAiWnt6u_cNnk2yTcL5c25-9cG6QcHeXpeN_AtwGO_uL7gfLqeSYEkCqgcxTDbkFQ5T0OPht2ePuZmtDy5dDnhPOnWXSJsqQi-t3WFD40gSr7P$
uLdFn4BA%3D%3D': No host supplied
Nov 05 09:48:54 rhel-76-pulp-2 pulp[32479]: nectar.downloaders.threaded:ERROR: (32479-15392) Traceback (most recent call last):
Nov 05 09:48:54 rhel-76-pulp-2 pulp[32479]: nectar.downloaders.threaded:ERROR: (32479-15392) File "/usr/lib/python2.7/site-packages/nectar/d$
wnloaders/threaded.py", line 274, in _fetch
Nov 05 09:48:54 rhel-76-pulp-2 pulp[32479]: nectar.downloaders.threaded:ERROR: (32479-15392) **requests_kwargs)
Nov 05 09:48:54 rhel-76-pulp-2 pulp[32479]: nectar.downloaders.threaded:ERROR: (32479-15392) File "/usr/lib/python2.7/site-packages/requests/
sessions.py", line 476, in get
Nov 05 09:48:54 rhel-76-pulp-2 pulp[32479]: nectar.downloaders.threaded:ERROR: (32479-15392) return self.request('GET', url, **kwargs)
Nov 05 09:48:54 rhel-76-pulp-2 pulp[32479]: nectar.downloaders.threaded:ERROR: (32479-15392) File "/usr/lib/python2.7/site-packages/requests/
sessions.py", line 450, in request
Nov 05 09:48:54 rhel-76-pulp-2 pulp[32479]: nectar.downloaders.threaded:ERROR: (32479-15392) prep = self.prepare_request(req)
Nov 05 09:48:54 rhel-76-pulp-2 pulp[32479]: nectar.downloaders.threaded:ERROR: (32479-15392) File "/usr/lib/python2.7/site-packages/requests/
sessions.py", line 381, in prepare_request
Nov 05 09:48:54 rhel-76-pulp-2 pulp[32479]: nectar.downloaders.threaded:ERROR: (32479-15392) hooks=merge_hooks(request.hooks, self.hooks),
Nov 05 09:48:54 rhel-76-pulp-2 pulp[32479]: nectar.downloaders.threaded:ERROR: (32479-15392) File "/usr/lib/python2.7/site-packages/requests
sessions.py", line 381, in prepare_request
Nov 05 09:48:54 rhel-76-pulp-2 pulp[32479]: nectar.downloaders.threaded:ERROR: (32479-15392) hooks=merge_hooks(request.hooks, self.hooks),
Nov 05 09:48:54 rhel-76-pulp-2 pulp[32479]: nectar.downloaders.threaded:ERROR: (32479-15392) File "/usr/lib/python2.7/site-packages/requests$
models.py", line 304, in prepare
Nov 05 09:48:54 rhel-76-pulp-2 pulp[32479]: nectar.downloaders.threaded:ERROR: (32479-15392) self.prepare_url(url, params)
Nov 05 09:48:54 rhel-76-pulp-2 pulp[32479]: nectar.downloaders.threaded:ERROR: (32479-15392) File "/usr/lib/python2.7/site-packages/requests/
models.py", line 364, in prepare_url
Nov 05 09:48:54 rhel-76-pulp-2 pulp[32479]: nectar.downloaders.threaded:ERROR: (32479-15392) raise InvalidURL("Invalid URL %%r: No host sup
plied" %% url)
Expected Results:¶
as in a RHEL75 system the same test passes with the proper hostname in URL
Nov 05 09:47:08 rhel-75-pulp-2 pulp[2512]: nectar.downloaders.threaded:INFO: Download succeeded: https://rhel-75-pulp-2.virt.box/streamer/var/l
ib/pulp/content/units/rpm/29/84c64d8df0293698f4427d762e4a61447b8b2d916dff501c1445c594e048f5/dog-4.23-1.noarch.rpm?policy=eyJleHRlbnNpb25zIjoge3
0sICJyZXNvdXJjZSI6ICIvc3RyZWFtZXIvdmFyL2xpYi9wdWxwL2NvbnRlbnQvdW5pdHMvcnBtLzI5Lzg0YzY0ZDhkZjAyOTM2OThmNDQyN2Q3NjJlNGE2MTQ0N2I4YjJkOTE2ZGZmNTAxY
zE0NDVjNTk0ZTA0OGY1L2RvZy00LjIzLTEubm9hcmNoLnJwbSIsICJleHBpcmF0aW9uIjogMTU3Mjk2NTIyMn0%3D;signature=KLppf9KciB92Ycd7_ZMrU66hHNJs4n90TKUvG5mwQIO
MA4E0b5-zIZxZzwXwARojeuhavhUhiX_O9bE7sSlUfVlzE_irE3ftI6uQlk5PcU4GUQZ3j9MwtiJqUPBWMaxRHQr0KoG2qfQTn7g9KhPIAm9XCsgHEEqj5yrdQCsgexUS-sIWdHqnSWEAcc
CAvgPv7LZcV7w_Pi-YgjEyrK6ttydhkS3I_mlbsQmC040-jSN1n7P057z0O9InKTXjlLxgQWsmkOWuhmU6Uf1g0QMQONn6Udw0s9-WBu0OYDSRWYki9JVFMjCWMpIBOxvgZ0ByfkBbgjsWd
01WBUw8mM_dvw%3D%3D.
More details:¶
The test passes if `immediate` download policy is used instead of `background`
The test passes if running on `RHEL 7.5`
Env info:¶
Repository: https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-unsigned/
O.S: RHEL 7.6 GA
Pulp: 2.19a1
Related issues
Actions
Fixing missing hostname for deferred downloads
A change was made in #4092 to allow users to use the server request hostname as the redirect_host for on-demand repos by leaving host in the lazy config as blank. However, the defered_download code doesn't have a server request and therefore should default to socket.getfqdn() if redirect_host is unset.
fixes #4120 https://pulp.plan.io/issues/4120