zalando-stups / fullstop

Audit reporting: collect violations across all AWS accounts

Home Page:https://docs.stups.io/en/latest/components/fullstop.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Increase read timeout

rwitzel opened this issue · comments

The current read timeout of 10 seconds seems to be too small, see below.

$ fullstop list-violations --since 300d --limit 6000 --accounts ***** --output json --type UNSECURED_PUBLIC_ENDPOINT | jq . > downloaded-violations-UNSECURED_PUBLIC_ENDPOINT.json

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 414, in _make_request
    httplib_response = conn.getresponse(buffering=True)
TypeError: getresponse() got an unexpected keyword argument 'buffering'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 416, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/lib/python3.4/http/client.py", line 1171, in getresponse
    response.begin()
  File "/usr/lib/python3.4/http/client.py", line 351, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.4/http/client.py", line 313, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.4/socket.py", line 374, in readinto
    return self._sock.recv_into(b)
  File "/usr/lib/python3.4/ssl.py", line 769, in recv_into
    return self.read(nbytes, buffer)
  File "/usr/lib/python3.4/ssl.py", line 641, in read
    v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 330, in send
    timeout=timeout
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 562, in urlopen
    body=body, headers=headers)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 419, in _make_request
    self, url, "Read timed out. (read timeout=%s)" % read_timeout)
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='fullstop.stups.zalan.do', port=443): Read timed out. (read timeout=10)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/fullstop", line 9, in <module>
    load_entry_point('stups-fullstop==1.0.24', 'console_scripts', 'fullstop')()
  File "/usr/local/lib/python3.4/dist-packages/fullstop/cli.py", line 318, in main
    cli()
  File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.4/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/click/decorators.py", line 27, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/fullstop/cli.py", line 225, in list_violations
    r = request(url, '/api/violations', token, params=params)
  File "/usr/local/lib/python3.4/dist-packages/fullstop/api.py", line 13, in request
    params=params)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 467, in get
    return self.request('GET', url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 455, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 558, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 387, in send
    raise Timeout(e)
requests.exceptions.Timeout: HTTPSConnectionPool(host='fullstop.stups.zalan.do', port=443): Read timed out. (read timeout=10)