gcloud crashed (SSLHandshakeError) in gcloud app deploy

筅森魡賤 提交于 2020-07-08 05:39:28

问题


Unable to deploy my app as I started getting below error since today morning. I have tried gcloud info --run-diagnostics and gcloud components reinstall without much help.

I tried to deploy it using the old Google App Engine Launcher for Windows but faced the same error. Earlier it worked till yesterday night (IST) using gcloud. Please help!

I am on latest gcloud sdk and have updated all its components. I use Win10. I tried rebooting my laptop as well.

C:\gaurav\coding\python\myapp\myapp\dist>gcloud app deploy --project=myproject --version 1 --verbosity=info ./app.yaml
INFO: Refreshing access_token
ERROR: gcloud crashed (SSLHandshakeError): [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)

If you would like to report this issue, please run the following command:
  gcloud feedback

To check gcloud for common problems, please run the following command:
  gcloud info --run-diagnostics

C:\gaurav\coding\python\myapp\myapp\dist>

Diagnostics Output.

C:\gaurav\coding\python\myapp\myapp\dist> gcloud info --run-diagnostics
Network diagnostic detects and fixes local network connection issues.
Checking network connection...done.
ERROR: Reachability Check failed.
    Cannot reach https://accounts.google.com (SSLHandshakeError)
    Cannot reach https://cloudresourcemanager.googleapis.com/v1beta1/projects (SSLHandshakeError)
    Cannot reach https://www.googleapis.com/auth/cloud-platform (SSLHandshakeError)
Network connection problems may be due to proxy or firewall settings.


Do you have a network proxy you would like to set in gcloud (Y/n)?  n

ERROR: Network diagnostic (0/1 checks) failed.


C:\gaurav\coding\python\myapp\myapp\dist>

Although gcloud info --run-diagnostics complains that the three URLs are not reachable. I am able to open them from web browser.


回答1:


I found that when using Fiddler (for viewing network traffic) and have decrypting https traffic enabled, then I received the SSLHandshakeError.

Stopping the tool (or choosing not to decrypt https traffic) and then running the gcloud resulted in success.


According to the comments, also a problem with other web debugging proxies such as Charles.




回答2:


A problem in recent GAE and GCloud SDK versions is the presence of invalid SSH certificates, see, for example, Google App Engine SSL Certificate Error and issue 38338974.

You could try to use my suggested solution in the above-mentioned post and replace your SDK's certificate file with a valid one (will have to locate a good one for the gcloud SDK, my answer was for the GAE SDK).

You might also be able to use the gcloud config command to set the core custom_ca_certs_file configurable property to point to a file with up to date certificates, if you have one. I didn't try it, YMMV.




回答3:


Upgrading to Python 2.7.9 on MacOS High Sierra solved the issue for me.




回答4:


I had this issue upon install of the google cloud SDK on MacOS Mojave. I am not behind a corporate proxy, and all the answers on the web seemed to indicate that this was the issue. I noticed in the install.sh script that it takes an environment variable CLOUDSDK_PYTHON for the python executable. So, I fixed this by exporting the path to my python 3 executable.

In my case: export CLOUDSDK_PYTHON=/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6

The install worked as expected after this.




回答5:


I had the same issue, downloaded the root/intermediate cert from one of the google url you get when you run the command: gcloud info --run-diagnostics and append to the cacerts.txt file that is being used. In my case it was the following one: google-cloud-sdk/lib/third_party/httplib2/python2/httplib2/cacerts.txt




回答6:


For me it was a conflict in the python versions. gcloud was calling a different version. The solution was to set CLOUDSDK_PYTHON to point to the correct python (python2 in this case).




回答7:


On MacOS Catalina, the solution was to completely uninstall gcloud and reinstall it.




回答8:


I tried to deploy gcloud and I was getting this error. Here is how I fixed it:

  1. Access to Google cloud using Firefox

  2. Download certificate. pem file and chain file

  3. Append them on cert.pem located at: C:\Program Files\google-cloud-sdk\lib\third_party\certifi\cert.pem (using this you are creating custom CA cert file based on your proxy)

  4. Update cert file as mentioned here: https://cloud.google.com/sdk/gcloud/reference/config/set (Absolute path to a custom CA cert file.)

Make sure you have cert.pem at the end of path.



来源:https://stackoverflow.com/questions/46221601/gcloud-crashed-sslhandshakeerror-in-gcloud-app-deploy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!