Django allauth facebook错误:OSError:[Errno 0]错误

时间:2016-03-01 21:43:26

标签: python django django-rest-framework django-allauth django-1.8

我在我的制作应用中使用django-allauth进行身份验证。通常它工作正常,但有时我似乎失败了,我得到奇怪的错误信息:

OSError: [Errno 0] Error

这是完整的追溯。有谁知道出了什么问题?

Internal Server Error: /api/facebook-auth/
Traceback (most recent call last):
  File ".../lib/requests/packages/urllib3/connectionpool.py", line 559, in urlopen
    body=body, headers=headers)
  File "...lib/requests/packages/urllib3/connectionpool.py", line 345, in _make_request
    self._validate_conn(conn)
  File "...lib/requests/packages/urllib3/connectionpool.py", line 784, in _validate_conn
    conn.connect()
  File "...lib/newrelic-2.60.0.46/newrelic/hooks/external_httplib.py", line 29, in httplib_connect_wrapper
    return wrapped(*args, **kwargs)
  File "...lib/requests/packages/urllib3/connection.py", line 252, in connect
    ssl_version=resolved_ssl_version)
  File "...lib/requests/packages/urllib3/util/ssl_.py", line 305, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/local/lib/python3.4/ssl.py", line 362, in wrap_socket
    _context=self)
  File "/usr/local/lib/python3.4/ssl.py", line 580, in __init__
    self.do_handshake()
  File "/usr/local/lib/python3.4/ssl.py", line 807, in do_handshake
    self._sslobj.do_handshake()
OSError: [Errno 0] Error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "...lib/requests/adapters.py", line 376, in send
    timeout=timeout
  File "...lib/requests/packages/urllib3/connectionpool.py", line 609, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "...lib/requests/packages/urllib3/util/retry.py", line 247, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "...lib/requests/packages/urllib3/packages/six.py", line 309, in reraise
    raise value.with_traceback(tb)
  File "...lib/requests/packages/urllib3/connectionpool.py", line 559, in urlopen
    body=body, headers=headers)
  File "...lib/requests/packages/urllib3/connectionpool.py", line 345, in _make_request
    self._validate_conn(conn)
  File "...lib/requests/packages/urllib3/connectionpool.py", line 784, in _validate_conn
    conn.connect()
  File "...lib/newrelic-2.60.0.46/newrelic/hooks/external_httplib.py", line 29, in httplib_connect_wrapper
    return wrapped(*args, **kwargs)
  File "...lib/requests/packages/urllib3/connection.py", line 252, in connect
    ssl_version=resolved_ssl_version)
  File "...lib/requests/packages/urllib3/util/ssl_.py", line 305, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/local/lib/python3.4/ssl.py", line 362, in wrap_socket
    _context=self)
  File "/usr/local/lib/python3.4/ssl.py", line 580, in __init__
    self.do_handshake()
  File "/usr/local/lib/python3.4/ssl.py", line 807, in do_handshake
    self._sslobj.do_handshake()
requests.packages.urllib3.exceptions.ProtocolError: ('Connection aborted.', OSError(0, 'Error'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "...lib/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "...lib/newrelic-2.60.0.46/newrelic/hooks/framework_django.py", line 499, in wrapper
    return wrapped(*args, **kwargs)
  File "...lib/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "...lib/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "...lib/newrelic-2.60.0.46/newrelic/hooks/component_djangorestframework.py", line 27, in _nr_wrapper_APIView_dispatch_
    return wrapped(*args, **kwargs)
  File "...lib/python3.4/rest_framework/views.py", line 466, in dispatch
    response = self.handle_exception(exc)
  File "...lib/python3.4/rest_framework/views.py", line 463, in dispatch
    response = handler(request, *args, **kwargs)
  File "...lib/rest_auth/views.py", line 54, in post
    if not self.serializer.is_valid():
  File "...lib/python3.4/rest_framework/serializers.py", line 197, in is_valid
    self._validated_data = self.run_validation(self.initial_data)
  File "/.../lib/python3.4/rest_framework/serializers.py", line 394, in run_validation
    value = self.validate(value)
  File "...production_backend/custom_auth/serializers.py", line 230, in validate
    response=access_token)
  File "...lib/allauth/socialaccount/providers/facebook/views.py", line 58, in complete_login
    return fb_complete_login(request, app, access_token)
  File "...lib/allauth/socialaccount/providers/facebook/views.py", line 42, in fb_complete_login
    'appsecret_proof': compute_appsecret_proof(app, token)
  File "...lib/requests/api.py", line 67, in get
    return request('get', url, params=params, **kwargs)
  File "...lib/newrelic-2.60.0.46/newrelic/api/external_trace.py", line 124, in dynamic_wrapper
    return wrapped(*args, **kwargs)
  File "...lib/requests/api.py", line 53, in request
    return session.request(method=method, url=url, **kwargs)
  File "...lib/requests/sessions.py", line 468, in request
    resp = self.send(prep, **send_kwargs)
  File "...lib/newrelic-2.60.0.46/newrelic/api/external_trace.py", line 124, in dynamic_wrapper
    return wrapped(*args, **kwargs)
  File "...lib/requests/sessions.py", line 576, in send
    r = adapter.send(request, **kwargs)
  File "...lib/requests/adapters.py", line 426, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', OSError(0, 'Error'))

0 个答案:

没有答案