Closed lukesneeringer closed 7 years ago
Hi @Spikey123, Thanks for reporting. Even though it will not change the audience for your issue much, I am going to move this over to google-auth-library-python, which is the actual source of the error you are getting.
There are a lot of things that can lead to this and none of them are the fault of this library. I would check, in no particular order:
You can try installing requests[security]
to see if it automatically fixes it.
We are also affected by this issue within the same timeframe.
To reply back about what I did: 1.) I checked all the things @jonparrott mentioned and all those things were configured correctly for me 2.) I asked for a VM reload of the day prior the issue surfaced
Therefore I have no idea what the issue was actually caused by and fortunately had a systems team that kept good VM backups for us :)
The fact that it worked after the VM refresh confirms that it's not an issue with the libraries used. It must be a VM configuration issue of some sort.
Seeing this too after upgrading google-cloud
to 0.27.0. Was working fine at 0.24.0. Working in a docker container, so minimal scope for other dependencies to be out of whack. Already at the latest versions of requests
and certifi
.
Here's my trace:
Traceback (most recent call last):
...
File "/app/content/lib.py", line 50, in <listcomp>
table_dates = reversed(sorted([t.name.replace(table, '')
File "/usr/lib/python3.5/site-packages/google_cloud_core-0.26.0-py3.5.egg/google/cloud/iterator.py", line 218, in _items_iter
for page in self._page_iter(increment=False):
File "/usr/lib/python3.5/site-packages/google_cloud_core-0.26.0-py3.5.egg/google/cloud/iterator.py", line 248, in _page_iter
page = self._next_page()
File "/usr/lib/python3.5/site-packages/google_cloud_core-0.26.0-py3.5.egg/google/cloud/iterator.py", line 348, in _next_page
response = self._get_next_page_response()
File "/usr/lib/python3.5/site-packages/google_cloud_core-0.26.0-py3.5.egg/google/cloud/iterator.py", line 399, in _get_next_page_response
query_params=params)
File "/usr/lib/python3.5/site-packages/google_cloud_core-0.26.0-py3.5.egg/google/cloud/_http.py", line 290, in api_request
headers=headers, target_object=_target_object)
File "/usr/lib/python3.5/site-packages/google_cloud_core-0.26.0-py3.5.egg/google/cloud/_http.py", line 183, in _make_request
return self._do_request(method, url, headers, data, target_object)
File "/usr/lib/python3.5/site-packages/google_cloud_core-0.26.0-py3.5.egg/google/cloud/_http.py", line 212, in _do_request
url=url, method=method, headers=headers, data=data)
File "/usr/lib/python3.5/site-packages/google_auth-1.0.2-py3.5.egg/google/auth/transport/requests.py", line 179, in request
method, url, data=data, headers=request_headers, **kwargs)
File "/usr/lib/python3.5/site-packages/requests-2.18.4-py3.5.egg/requests/sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3.5/site-packages/requests-2.18.4-py3.5.egg/requests/sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3.5/site-packages/requests-2.18.4-py3.5.egg/requests/adapters.py", line 506, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='www.googleapis.com', port=443): Max retries exceeded with url: /bigquery/v2/projects/my-proj/datasets/pixel/tables (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)'),))
Issue goes away downgrading to google-cloud
0.24.0.
https://github.com/requests/requests/issues/3859#issuecomment-311275977 is likely the solution to this issue if the following fails for you.
import requests
requests.get('https://google.com/')
Upgrading certifi and requests alone isn't going to solve the issue because it's being caused by a buggy openssl installation.
What @thomasw mentioned work for me when I ran into this issue.
For CentOS 7 all I had to do was 'yum update openssl' and the problem was resolved.
thanks @jonparrott, I was using python 2.7.5 and moved to 2.7.11 it solved it for me. SNI was the culprit.
@saurav955 good to hear. SSL on older pythons is a huge pain.
I've installed 2.7.11, downgraded google-cloud to 0.24.0, installed the latest version of openssl via brew and requests[security] and it still hasn't changed the error.
Same thing is happenings to us TransportError: HTTPSConnectionPool(host='accounts.google.com', port=443): Max retries exceeded with url: /o/oauth2/token (Caused by SSLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:661)'),))
. Updating SSL didn't help. Nothing did.
EOF is a completely different kind of error, please file a separate issue for that.
The fix that worked for me is installing requests-toolbelt via pip. It appears GAE uses requests in connecting to Datastore. Surprised it doesn't come standard in GAE.
Same thing is happenings to us
TransportError: HTTPSConnectionPool(host='accounts.google.com', port=443): Max retries exceeded with url: /o/oauth2/token (Caused by SSLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:661)'),))
. Updating SSL didn't help. Nothing did.
did you ever figure out the SSLEOFError issue?
@erickertz unfortunately not. We ended up coding our own wrapper around PubSub REST API with auth. We haven't tried newer versions though.
downgraded google-cloud-core to 0.24.1 works for me, but don't know why
Issue solved after downgrading to google-cloud 0.30.0
I had same issue. Resolved by installing "pip install requests-toolbelt"
Issue :
I did this step and it worked for me https://stackoverflow.com/questions/45927259/google-cloud-python-sdk-installation-error-ssl-certification-error/50524168#50524168
From @Spikey123 on August 23, 2017 13:5
Hello.
I've been using tswast's method to query BigQuery results and it's been purring along fine for a while now. Over the last several days, I've been getting an SSL certificate verification issue. Below is the full error message and below that is the code I use.
I'll note that I updated the python client, bigquery library, cloud storage library, and gcloud components.
pip install --upgrade google-api-python-client
pip install --upgrade google-cloud-bigquery
pip install --upgrade google-cloud-storage
gcloud components update
Service account permissions should be fine
Update: I'm getting the same exact error on other scripts I have running - like this one that deletes blobs in Google Cloud Storage:
I checked the certs on accounts.google.com and they appeared to be fine. So I'm not sure why the SSL error would be thrown.
Thanks!
The code is:
Copied from original issue: GoogleCloudPlatform/google-cloud-python#3857