Page MenuHome

Inability to reach Blender ID causes 500 Internal Server Error
Open, NormalPublic

Description

I got this stack trace while running inside Docker on my desktop, auth'ing against the real Blender ID:

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.blender.org', port=443): Max retries exceeded with url: /id/oauth/token (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f670cdaed30>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
mod_wsgi (pid=352): Exception occurred processing WSGI script '/data/git/blender-cloud/runserver.wsgi'.
Traceback (most recent call last):
  File "/opt/python/lib/python3.6/site-packages/requests/packages/urllib3/connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/opt/python/lib/python3.6/site-packages/requests/packages/urllib3/util/connection.py", line 60, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/opt/python/lib/python3.6/socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/python/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/opt/python/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 345, in _make_request
    self._validate_conn(conn)
  File "/opt/python/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 844, in _validate_conn
    conn.connect()
  File "/opt/python/lib/python3.6/site-packages/requests/packages/urllib3/connection.py", line 284, in connect
    conn = self._new_conn()
  File "/opt/python/lib/python3.6/site-packages/requests/packages/urllib3/connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f670acd84e0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/python/lib/python3.6/site-packages/requests/adapters.py", line 423, in send
    timeout=timeout
  File "/opt/python/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 649, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/opt/python/lib/python3.6/site-packages/requests/packages/urllib3/util/retry.py", line 376, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
requests.packages.urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.blender.org', port=443): Max retries exceeded with url: /id/oauth/token (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f670acd84e0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/python/lib/python3.6/site-packages/eve/flaskapp.py", line 1033, in __call__
    return super(Eve, self).__call__(environ, start_response)
  File "/opt/python/lib/python3.6/site-packages/flask/app.py", line 1994, in __call__
    return self.wsgi_app(environ, start_response)
  File "/opt/python/lib/python3.6/site-packages/flask/app.py", line 1985, in wsgi_app
    response = self.handle_exception(e)
  File "/opt/python/lib/python3.6/site-packages/flask/app.py", line 1540, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/python/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/opt/python/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/opt/python/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/opt/python/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/python/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/opt/python/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/python/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/data/git/pillar/pillar/web/users/routes.py", line 56, in oauth_callback
    oauth_user = oauth.callback()
  File "/data/git/pillar/pillar/auth/oauth.py", line 154, in callback
    oauth_session = self.make_oauth_session()
  File "/data/git/pillar/pillar/auth/oauth.py", line 96, in make_oauth_session
    decoder=self.decode_json
  File "/opt/python/lib/python3.6/site-packages/rauth/service.py", line 556, in get_auth_session
    session = self.get_session(self.get_access_token(method, **kwargs))
  File "/opt/python/lib/python3.6/site-packages/rauth/service.py", line 541, in get_access_token
    r = self.get_raw_access_token(method, **kwargs)
  File "/opt/python/lib/python3.6/site-packages/rauth/service.py", line 518, in get_raw_access_token
    **kwargs)
  File "/opt/python/lib/python3.6/site-packages/rauth/session.py", line 358, in request
    return super(OAuth2Session, self).request(method, url, **req_kwargs)
  File "/opt/python/lib/python3.6/site-packages/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "/opt/python/lib/python3.6/site-packages/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "/opt/python/lib/python3.6/site-packages/requests/adapters.py", line 487, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.blender.org', port=443): Max retries exceeded with url: /id/oauth/token (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f670acd84e0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))

I think it would be a good idea to do some exception catching in pillar/auth/oauth.py", line 154, in callback (and other places in our OAuth code) so that a reasonable error message is shown to the user, rather than simply crashing hard.

Details

Type
Bug

Event Timeline

Sybren A. Stüvel (sybren) triaged this task as Normal priority.