Network connection problems in Google Cloud SDK while I have access to google or website like google app engine in my browser
Asked Answered
M

3

8

I created an account on Google App Engine, then I installed google-cloud-sdk by gcloud init, and get the following error:

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

Your current configuration has been set to: [a]

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 (ResponseNotReady)
    Cannot reach https://accounts.google.com (ResponseNotReady)
    Cannot reach 
https://cloudresourcemanager.googleapis.com/v1beta1/projects 
(ResponseNotReady)
    Cannot reach https://www.googleapis.com/auth/cloud-platform 
(ResponseNotReady)
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)?  Y

Select the proxy type:
 [1] HTTP
 [2] HTTP_NO_TUNNEL
 [3] SOCKS4
 [4] SOCKS5
Please enter your numeric choice:  1

Enter the proxy host address: XXX

Enter the proxy port: XXX

Is your proxy authenticated (y/N)?  n

Cloud SDK proxy properties set.

Rechecking network connection...done.
ERROR: Reachability Check still does not pass.
    Cannot reach https://www.google.com (ResponseNotReady)
    Cannot reach https://accounts.google.com (ResponseNotReady)
    Cannot reach 
https://cloudresourcemanager.googleapis.com/v1beta1/projects 
(ResponseNotReady)
    Cannot reach https://www.googleapis.com/auth/cloud-platform 
(ResponseNotReady)
    Cannot reach 
https://dl.google.com/dl/cloudsdk/channels/rapid/components-2.json 
(ResponseNotReady)

Current effective Cloud SDK network proxy settings:
    type = http
    host = XXX
    port = XXX
    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
Please enter your numeric choice:

I am in China but I can unblock google or website like google app engine in my browser with proxy(setting in shadowsocks2.3). I tried to set a network proxy in google cloud SDK, the IP address and port are exactly the one used in shadowsocks2.3, but it still didn’t work. And my project list couldn’t be accessed. What is the exact problem? Hints or explanations are all appreciated. Many thanks in advance!

Mcintire answered 1/4, 2018 at 7:24 Comment(2)
Did you follow steps in cloud.google.com/sdk/docs/proxy-settings, can you be more specific what you have tried, and/or include example that someone can replicate your steps?Bib
I followed the steps according to the hint in SDK. And I have modified the code in question. Is there any problem in the setting process ?Mcintire
D
2

You need to configure your gcloud cli tool to use a proxy.

https://cloud.google.com/sdk/docs/proxy-settings

In my case, I'm using shadow-socks as proxy, so I did:

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

and it works.

Distrust answered 27/3, 2019 at 3:48 Comment(1)
gcloud config set proxy/type socks5; gcloud config set proxy/address 192.168.31.101 gcloud config set proxy/port 1080Ecthyma
O
0

To set your host : 127.0.0.1 and port : 1080

I have ss in my computer.And when I set like above,it can work well.

Offend answered 24/3, 2019 at 7:3 Comment(2)
Can you clarify what 'ss' is?Bushhammer
shadowsocksOffend
I
0
Do you have a network proxy you would like to set in gcloud (Y/n)?  Y

Select the proxy type:
 [1] HTTP
 [2] HTTP_NO_TUNNEL
 [3] SOCKS4
 [4] SOCKS5
Please enter your numeric choice:  4

Enter the proxy host address: your proxy host address (e.g.127.0.0.1)

Enter the proxy port: your proxy port (e.g. 8080)

Is your proxy authenticated (y/N)?  y

Enter the proxy username: your proxy username

Enter the proxy password: your proxy password

Cloud SDK proxy properties set.

Rechecking network connection...done.                                          
Reachability Check now passes.
Network diagnostic passed (1/1 checks passed).
Illtempered answered 6/11, 2021 at 10:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.