google-api-python-client: SSLEOFError: EOF occurred in violation of protocol (_ssl.c:590)
After installing this package on python 2.7.10 and using Google Admin API I get tons of these errors in an intermittent fashion:
File "/usr/local/lib/python2.7/site-packages/oauth2client/util.py", line 135, in positional_wrapper
return wrapped(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/googleapiclient/http.py", line 827, in execute
method=str(self.method), body=self.body, headers=self.headers)
File "/usr/local/lib/python2.7/site-packages/googleapiclient/http.py", line 167, in _retry_request
raise exception
SSLEOFError: EOF occurred in violation of protocol (_ssl.c:590)
I’m using Ubuntu 14.04:
$ openssl version
OpenSSL 1.0.1f 6 Jan 2014
ubuntu@tests:~$ python
Python 2.7.10 (default, Sep 7 2015, 14:45:00)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>> ssl.OPENSSL_VERSION
'OpenSSL 1.0.1f 6 Jan 2014'
Any ideas on how to fix this?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 34 (17 by maintainers)
@jonparrott As the problem arrives from the use of this library it would be good to have some way to inform the developers that this error can be erroneously reported by Google servers in high concurrency scenarios.
@dhermes I’m doing this right now… I just wanted to make sure it is not related to Ubuntu OpenSSL version.
@jonparrott I did it for httplib2: one HTTP client generated per request. And the error happens anyway.
It’s probably very likely that this library is sneakily using httplib2 without you noticing. You can try using httplib2shim and see if that fixes things, but the simplest thing to do is just construct a new client for every thread/greenlet/etc.
On Thu, Jul 21, 2016, 9:53 AM Carlo Pires notifications@github.com wrote:
@daspecster I’ll never complain about you accidentally helping me out here. 😃
@carlopires this is usually the most likely culprit when it comes to exceptions deep in the stack like this. If it’s not, then the next most likely culprit is that your openssl version is out of date. I would recommend updating openssl as a first step.
(closing for now, feel free to continue to comment. we can re-open if needed)