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

Handle read timeouts from Auth0 #669

Open
sentry-io bot opened this issue Jun 14, 2021 · 1 comment
Open

Handle read timeouts from Auth0 #669

sentry-io bot opened this issue Jun 14, 2021 · 1 comment
Labels
refactor Something needs to be done better

Comments

@sentry-io
Copy link

sentry-io bot commented Jun 14, 2021

Sentry Issue: STUDY-CREATOR-BG9

timeout: The read operation timed out
(4 additional frame(s) were not displayed)
...
  File "http/client.py", line 307, in begin
    version, status, reason = self._read_status()
  File "http/client.py", line 268, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "socket.py", line 669, in readinto
    return self._sock.recv_into(b)
  File "ssl.py", line 1241, in recv_into
    return self.read(nbytes, buffer)
  File "ssl.py", line 1099, in read
    return self._sslobj.read(len, buffer)

ReadTimeoutError: HTTPSConnectionPool(host='kids-first.auth0.com', port=443): Read timed out. (read timeout=10)
(2 additional frame(s) were not displayed)
...
  File "urllib3/util/retry.py", line 410, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "urllib3/packages/six.py", line 735, in reraise
    raise value
  File "urllib3/connectionpool.py", line 670, in urlopen
    httplib_response = self._make_request(
  File "urllib3/connectionpool.py", line 428, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "urllib3/connectionpool.py", line 335, in _raise_timeout
    raise ReadTimeoutError(

ReadTimeout: HTTPSConnectionPool(host='kids-first.auth0.com', port=443): Read timed out. (read timeout=10)
(5 additional frame(s) were not displayed)
...
  File "requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "requests/adapters.py", line 529, in send
    raise ReadTimeout(e, request=request)
@dankolbman
Copy link
Contributor

This happened when trying to get the Auth0 public key: https://github.com/kids-first/kf-api-study-creator/blob/master/creator/middleware.py#L226.
We could extend this timeout to make this error less likely or perform retries.
Raising and allowing this error may be the safest solution as we don't want to accidentally poison the key in the cache.

@dankolbman dankolbman added the refactor Something needs to be done better label Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Something needs to be done better
Projects
None yet
Development

No branches or pull requests

1 participant