首页 > 解决方案 > gcloud登录网络连接失败问题

问题描述

我试图将 gcloud 与gcloud init. 我收到网络连接错误。

当我可以在浏览器中访问谷歌或谷歌应用引擎等网站时,我尝试修复谷歌云 SDK 中的网络连接问题

gcloud config set proxy/type socks5
gcloud config set proxy/address 127.0.0.1
gcloud config set proxy/port 1086

但它仍然对我不起作用。

我的日志是:

Welcome! This command will take you through the configuration of gcloud.

Settings from your current configuration [default] are:
core:
  disable_usage_reporting: 'False'
proxy:
  address: 127.0.0.1
  port: '1080'
  type: socks5

Pick configuration to use:
 [1] Re-initialize this configuration [default] with new settings 
 [2] Create a new configuration
 [3] Switch to and re-initialize existing configuration: [cindy]
Please enter your numeric choice:  1

Your current configuration has been set to: [default]

You can skip diagnostics next time by using the following flag:
  gcloud init --skip-diagnostics

Network diagnostic detects and fixes local network connection issues.
Checking network connection...done.                                                                                                                                        
ERROR: Reachability Check failed.
    Cannot reach https://www.google.com (error)
    Cannot reach https://accounts.google.com (error)
    Cannot reach https://cloudresourcemanager.googleapis.com/v1beta1/projects (error)
    Cannot reach https://www.googleapis.com/auth/cloud-platform (error)
    Cannot reach https://dl.google.com/dl/cloudsdk/channels/rapid/components-2.json (error)
Network connection problems may be due to proxy or firewall settings.

Current effective Cloud SDK network proxy settings:
    type = socks5
    host = 127.0.0.1
    port = 1080
    username = None
    password = None

What would you like to do?
 [1] Change Cloud SDK network proxy properties
 [2] Clear all gcloud proxy properties
 [3] Exit

标签: proxygcloudgoogle-cloud-sdk

解决方案


这是由于从 goolge 帐户重定向到 localhost 以获取令牌尝试使用 firefox 登录


推荐阅读