Skip to content

API key validation check in info page does not use proxy settings #3011

Description

@2rs2ts

(This is an issue as of 5.10)

This commit: 4ecd5ef does not use the config's proxy settings, so when accessing the info page, if you cannot connect except via proxy, you'll get an error like this:

2016-11-09 20:24:37,578 | ERROR | dd.forwarder | checks.check_status(check_status.py:130) | Unable to validate API Key
Traceback (most recent call last):
  File "/opt/datadog-agent/agent/checks/check_status.py", line 122, in validate_api_key
    params={'api_key': api_key}, timeout=3)
  File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/requests/api.py", line 68, in get
    return request('get', url, **kwargs)
  File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/requests/api.py", line 50, in request
    response = session.request(method=method, url=url, **kwargs)
  File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/requests/sessions.py", line 465, in request
    resp = self.send(prep, **send_kwargs)
  File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/requests/sessions.py", line 573, in send
    r = adapter.send(request, **kwargs)
  File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/requests/adapters.py", line 415, in send
    raise ConnectionError(err, request=request)
ConnectionError: ('Connection aborted.', error(99, 'Cannot assign requested address'))

Steps to reproduce the issue:

Using a pretty basic amazon linux EC2 instance, you can test this with the following setup:

  1. Set up a proxy e.g. squid on your host
  2. Configure dd-agent with a proxy_host and proxy_port
  3. Configure your firewall to allow squid to send egress messages on port 443 but not dd-agent
  4. /etc/init.d/datadog-agent info

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions