无法安装Google Cloud SDK:<< gcloud.components.update>无法获取组件"Windows 7的 [英] Unable to install google cloud sdk: "<gcloud.components.update> Failed to fetch component" Windows7

查看:59
本文介绍了无法安装Google Cloud SDK:<< gcloud.components.update>无法获取组件"Windows 7的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试安装google cloud sdk时,会发生以下错误:

When I try to intall google cloud sdk the following error occurs:

错误:(gcloud.components.update)无法从服务器获取组件列表.检查您的网络设置,然后重试.Google Cloud SDK安装程序现在将退出.按任意键继续 ..

ERROR: (gcloud.components.update) Failed to fetch component listing from server. Check your network settings and try again. Google Cloud SDK installer will now exit. Press any key to continue . . .

result = func(*args)   File "C:\python27_x64\lib\urllib2.py", line 1222, in https_open
return self.do_open(httplib.HTTPSConnection, req)   File "C:\python27_x64\lib\urllib2.py", line 1184, in do_open
raise URLError(err) urllib2.URLError: <urlopen error [Errno 10061] No connection could be made because the target machine actively refused it>

有什么想法吗?

推荐答案

我在安装时以及在另一个以前可以正常运行的安装中的某些命令上都遇到了类似的错误.翻阅并添加一些日志后,似乎SSL证书验证对于来自Google服务器的组件列表请求失败:

I was getting a similar error both on installation and on certain commands on another previously working installation. After poking around and adding some logs, it looks like SSL Cert Verification is failing for the component listing request from Google's servers:

$ gcloud preview managed-instance-groups ...
You do not currently have this command group installed.  Using it requires the installation of components: [preview]
Could not fetch [https://dl.google.com/dl/cloudsdk/release/components-2.json]
<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)>
ERROR: (gcloud) Failed to fetch component listing from server. Check your network settings and try again.

要解决此问题(以一种几乎肯定不明智的方式),我对该单个请求禁用了SSL证书验证.如果您想走这条路,请在

To solve it (in a way that is almost certainly inadvisable), I disabled SSL Cert Validation for that single request. If you want to go down this path, modify MakeRequest() in

./google-cloud-sdk/lib/googlecloudsdk/core/updater/installers.py:248

来自:

return urllib2.urlopen(req, timeout=TIMEOUT_IN_SEC)

收件人:

return urllib2.urlopen(req, timeout=TIMEOUT_IN_SEC, context=ssl.SSLContext(ssl.PROTOCOL_TLSv1))

(在 https上存在一个与此相关的问题://code.google.com/p/google-cloud-sdk/issues/detail?id=143 .)

更新:2015年5月26日

就我而言,这是我安装的OpenSSL版本和Python引用的OpenSSL版本之间的不匹配(在更新为 OpenSSL@1.0.2a-1 ).

In my case, this turned out to be a mismatch between my installed version of OpenSSL and the version of OpenSSL referenced by Python (this may have started happening after updating to OpenSSL@1.0.2a-1).

为解决此问题,我将OpenSSL的版本更新为最新版本:

To resolve this, I updated my version of OpenSSL to the latest:

brew update
brew upgrade openssl

然后,我参照此更新版本的OpenSSL重新安装Python:

Then I reinstalled Python referencing this updated version of OpenSSL:

brew uninstall python
brew install python --with-brewed-openssl

此后,我对Google Cloud SDK的安装感到不满意(因为我在这里想办法找到解决方案;您可能不必这样做),然后从头开始安装:

After this, I nuked by Google Cloud SDK install (because I was mucking around in there a bit to find a solution; you might not have to do this) and installed from scratch:

curl https://sdk.cloud.google.com | bash

我们很黄金!

有关OS X上这些OpenSSL问题的更多信息,请查看本文: https://hynek.me/articles/apple-openssl-verification-surprises/

For further reading on these OpenSSL issues with OS X, check out this article: https://hynek.me/articles/apple-openssl-verification-surprises/

这篇关于无法安装Google Cloud SDK:&lt;&lt; gcloud.components.update&gt;无法获取组件"Windows 7的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆