Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy connections requiring authentication are failing #636

Closed
danielmitterdorfer opened this issue Jan 29, 2019 · 0 comments
Closed

Proxy connections requiring authentication are failing #636

danielmitterdorfer opened this issue Jan 29, 2019 · 0 comments
Labels
bug Something's wrong
Milestone

Comments

@danielmitterdorfer
Copy link
Member

Rally version (get with esrally --version): 1.0.3

Steps to reproduce:

  1. Setup an HTTP proxy server that requires authentication
  2. export http_proxy=http://username:[email protected]:8080
  3. Invoke Rally

Expected behavior:

Rally uses the proxy to connect to the Internet

Actual behavior:

Rally reports that no Internet connection is available. On the command line we can see.

[WARNING] No Internet connection detected. Automatic download of track data sets etc. is disabled. 

Provide logs (if relevant):

2019-01-23 15:19:43,262 -not-actor-/PID:16740 esrally.utils.net INFO Rally connects via proxy URL [http://username:[email protected]:8080] to the Internet (picked up from the environment variable [http_proxy]).
2019-01-23 15:19:43,263 -not-actor-/PID:16740 esrally.utils.net DEBUG Checking for internet connection against [https://github.com/]
2019-01-23 15:19:43,347 -not-actor-/PID:16740 esrally.utils.net DEBUG Could not detect a working Internet connection
Traceback (most recent call last):
  File "/usr/local/python3/lib/python3.6/site-packages/urllib3/connectionpool.py", line 595, in urlopen
    self._prepare_proxy(conn)
  File "/usr/local/python3/lib/python3.6/site-packages/urllib3/connectionpool.py", line 816, in _prepare_proxy
    conn.connect()
  File "/usr/local/python3/lib/python3.6/site-packages/urllib3/connection.py", line 294, in connect
    self._tunnel()
  File "/usr/local/python3/lib/python3.6/http/client.py", line 919, in _tunnel
    message.strip()))
OSError: Tunnel connection failed: 407 Proxy Authentication Required

Analysis:

The problem is that Python does not take the provided credentials in the URL into account. Thus, Rally needs to provide them separately using a ProxyBasicAuthHandler.

@danielmitterdorfer danielmitterdorfer added the bug Something's wrong label Jan 29, 2019
@danielmitterdorfer danielmitterdorfer added this to the 1.0.4 milestone Jan 29, 2019
@danielmitterdorfer danielmitterdorfer modified the milestones: 1.0.4, 1.1.0 Feb 20, 2019
danielmitterdorfer added a commit to danielmitterdorfer/rally that referenced this issue Feb 22, 2019
With this commit Rally will set the proper authentication header for
proxies that require it.

Closes elastic#636
dliappis pushed a commit that referenced this issue Feb 26, 2019
With this commit Rally will set the proper authentication header for
proxies that require it.

Closes #636
Relates #652
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something's wrong
Projects
None yet
Development

No branches or pull requests

1 participant