Bug 1011972 - proxy host setting ignored
Summary: proxy host setting ignored
Keywords:
Status: CLOSED DUPLICATE of bug 1014368
Alias: None
Product: Pulp
Classification: Retired
Component: async/tasks
Version: 2.2
Hardware: x86_64
OS: Linux
high
low
Target Milestone: ---
: 2.2.0
Assignee: Jeff Ortel
QA Contact: pulp-qe-list
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-25 13:20 UTC by Everhard Faas
Modified: 2013-10-09 20:52 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-10-09 20:52:37 UTC
Embargoed:


Attachments (Terms of Use)

Description Everhard Faas 2013-09-25 13:20:33 UTC
Description of problem:
When using the new 2.2 style proxy settings, no proxy seems to be used by the sync task. The rpm create repo functions correct, but the sync run keeps downloading - hanging forever. While the pulp.log shows a python stack-trace.

Version-Release number of selected component (if applicable):
pulp-server-2.2.0-1.el6.noarch
python-nectar-1.1.1-1.el6.noarch

How reproducible:

Steps to Reproduce:  
1. pulp-admin rpm repo create                                              \
   --repo-id=repo123                                                       \
   --feed=http://repos.fedorapeople.org/repos/pulp/pulp/stable/2.2/6Server \
   --proxy-host=www-proxy.dev.example.com                                   \
   --proxy-port=8082 
2. pulp-admin rpm repo sync run --repo-id=repo123

Actual results:
in /var/log/pulp/pulp.log:
2013-09-25 14:59:11,346 nectar.downloaders.threaded:ERROR: Unhandled Exception in Worker Thread [139706406786816]
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/nectar/downloaders/threaded.py", line 92, in worker
    session = build_session(self.config)
  File "/usr/lib/python2.6/site-packages/nectar/downloaders/threaded.py", line 281, in build_session
    _add_proxy(session, config)
  File "/usr/lib/python2.6/site-packages/nectar/downloaders/threaded.py", line 310, in _add_proxy
    url = ':'.join((host, str(config.proxy_port)))
TypeError: sequence item 0: expected string, NoneType found

Expected results:
transfer of (any) repository to this pulp repo.


Additional info:
The same repo-sync command (with 2.1 command style) is working fine.

Comment 1 Jason Connor 2013-09-27 16:18:05 UTC
The bug is a semantic one, the --proxy-host requires the scheme (ie http:// or https://)

Comment 2 Martijn Pepping 2013-09-27 17:21:47 UTC
True, the documentation also mentions to include the scheme. But, when specifying the proxy with the scheme the results are somewhat the same:\

# Adding a repo:

pulp-admin rpm repo create \
  --repo-id=rhel-6-server --retain-old-count=1 \
  --serve-http=true --serve-https=false \
  --feed=https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os \
  --feed-ca-cert=/etc/rhsm/ca/redhat-uep.pem \
  --feed-key=/etc/pki/entitlement/xxx.pem \
  --feed-cert=/etc/pki/entitlement/yyy.pem \
  --proxy-host=http://www-proxy.dev.example.com --proxy-port=8082 \
  --relative-url=rhel-6-server --max-downloads=4


# Results of running a sync in pulp.log

2013-09-24 10:02:47,181 nectar.downloaders.threaded:ERROR: [Errno -2] Name or service not known
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/nectar/downloaders/threaded.py", line 160, in _fetch
    response = session.get(request.url, headers=headers)
  File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 310, in get
    return self.request('GET', url, **kwargs)
  File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 279, in request
    resp = self.send(prep, stream=stream, timeout=timeout, verify=verify, cert=cert, proxies=proxies)
  File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 374, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.6/site-packages/requests/adapters.py", line 206, in send
    raise ConnectionError(sockerr)
ConnectionError: [Errno -2] Name or service not known



Maybe it is worth to mention that no DNS resolving of Internet-hosts can be done on the local network. Only the proxyhost can. Eg., "cdn.redhat.com" cannot be resolved by the pulp node, but can be resolved (and reached) by the proxyhost.

A similar host on the same network running pulp 2.1 works as supposed, with the difference that on pulp 2.1 the switch --proxy-url is used (changed with pulp2.2).

Rgrds, Martijn

Comment 3 Martijn Pepping 2013-09-27 17:23:41 UTC
I suggest the severity and priority can be upped with information from the previous comment?

Rgrds, Martijn

Comment 4 Michael Hrivnak 2013-09-27 17:55:29 UTC
bumping this to high priority on 2.3 so we can at least try reproducing it locally.

Comment 5 Martijn Pepping 2013-09-27 21:14:18 UTC
Did another setup with pulp 2.2 and a squid http-proxy. Proxy support seems definitely broken in pulp 2.2.  

I got it to work by patching 'threaded.py' with the patch below. This makes it possible to use a proxy-host (/w scheme suffix) .. downside is that it only works with feeds over http. Feeds over https respond with a "bad request".


--- threaded.py	2013-09-27 19:58:37.922115101 +0000
+++ threaded.py.me	2013-09-27 21:05:49.889114884 +0000
@@ -314,7 +314,7 @@
         auth = config.proxy_username + password_part
         url = '@'.join((auth, url))

-    session.proxies[protocol] = url
+    session.proxies['http'] = '://'.join((protocol, url))

 # -- thread-safe generator queue -----------------------------------------------


Hope this is of any help.

Rgrds, Martijn

Comment 6 Michael Hrivnak 2013-09-30 18:07:26 UTC
This issue was fixed in nectar, but that fix is not available in the 2.2 repository. We are going to update python-nectar in the 2.2 repo, which should take care of this.

Comment 7 Jeff Ortel 2013-09-30 22:38:16 UTC
Rebuilt to include nectar-1.1.2-1 in: http://repos.fedorapeople.org/repos/pulp/pulp/beta/2.2/

Comment 9 Sayli Karmarkar 2013-10-09 20:52:37 UTC

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


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