我正在使用Django Celery任务通过Gevent使用请求库连接到Facebook Graph API。我经常遇到的问题是,我时不时地发生EOF违反协议异常的情况。我到处搜索,各种来源提供了不同的修复程序,但似乎都没有用。
我试过猴子修补ssl模块(gevent.monkey.patch_all())和其他一些修补程序,但是没有运气。
我什至不确定这是否是openssl问题,因为一些消息来源可能会建议,因为在应用Gevent优化之前我还没有遇到过
Connection error: [Errno 8] _ssl.c:504: EOF occurred in violation of protocol
Traceback (most recent call last):
File "/home/user/workspace/startup/project/events/tasks.py", line 52, in _process_page
data = requests.get(current_url)
File "/home/user/workspace/startup/env/local/lib/python2.7/site-packages/requests/api.py", line 55, in get
return request('get', url, **kwargs)
File "/home/user/workspace/startup/env/local/lib/python2.7/site-packages/requests/api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
File "/home/user/workspace/startup/env/local/lib/python2.7/site-packages/requests/sessions.py", line 354, in request
resp = self.send(prep, **send_kwargs)
File "/home/user/workspace/startup/env/local/lib/python2.7/site-packages/requests/sessions.py", line 460, in send
r = adapter.send(request, **kwargs)
File "/home/user/workspace/startup/env/local/lib/python2.7/site-packages/requests/adapters.py", line 250, in send
raise SSLError(e)
SSLError: [Errno 8] _ssl.c:504: EOF occurred in violation of protocol
我正在使用最新的1.0rc Gevent版本。
尽管URL正确,但仍会不时弹出的另一个问题是:连接被“错误(2,“没有这样的文件或目录”))破坏后重试(剩余5次尝试):/ ID / events?limit = 5000&fields = description ,名称,位置,开始时间,结束时间和访问令牌=令牌
皈依舞
郎朗坤
相关分类