Installing Google Cloud SDK on OS X: (gcloud.components.list) Failed to get component list from server

I am trying to install Google Cloud SDK ( https://cloud.google.com/sdk/docs/quickstart-mac-os-x ) and get this error:
ERROR: (gcloud.components.list) Failed to fetch component listing from server. Check your network settings and try again.

Already tried updating OpenSSL and the corresponding Python (also tried Python 2.7.8):

openssl version  
OpenSSL 1.0.2k  26 Jan 2017

python -V
Python 2.7.13

      

Python uses this version of OpenSSL as well:

>>> import ssl
>>> ssl.OPENSSL_VERSION
'OpenSSL 1.0.2k  26 Jan 2017'

      

I use mac OS 10.12.4

I've also tried brew cask install google-cloud-sdk

which just downloads the regular version and runs the install.sh script. The same result.

Further debugging revealed that it can not load https://dl.google.com/dl/cloudsdk/channels/rapid/components-2.json

, and returns this error: URLError: <urlopen error timed out>

. Loading this file via Python directly works:

urllib2.urlopen('https://dl.google.com/dl/cloudsdk/channels/rapid/components-2.json')

Any ideas? Also any advice how to further debug this would be appreciated :)

+10


source to share


2 answers


After disabling ipv6 support, the tool works like a charm. Looks like gcloud can't work gracefully with ipv6 ...

Disable ipv6:

networksetup -setv6off Wi-Fi

      

Enable ipv6:



networksetup -setv6automatic Wi-Fi

      


Note: While researching, I was also able to get it to work using a very long timeout of 120 seconds. This would not be practical, however, for most use cases due to the long delays this would introduce for each command.

The timeout is in google-cloud-sdk/lib/googlecloudsdk/core/updater/installers.py

line 36 which is calledTIMEOUT_IN_SEC

+30


source


Disabling ipv6 doesn't work for me. I tried a bunch of things before getting it to work. I upgraded to mojave OSX before getting problems.

I have updated the Mac headers as mentioned here :

open/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

Rebooted then reinstalled python2: brew reinstall python2

At the moment the problem still persists, decided to reinstall gcloud and came across this : I was using zsh, so I added the following .zshrc

:



source <PATH to gcloud sdk>/google-cloud-sdk/path.zsh.inc
source <PATH to gcloud sdk>/google-cloud-sdk/completion.zsh.inc

      

For bash:

source <PATH to gcloud sdk>/google-cloud-sdk/path.bash.inc
source <PATH to gcloud sdk>/google-cloud-sdk/completion.bash.inc'

      

Then gcloud init

forced me to reset my proxy config, which was probably the main problem to begin with.

0


source







All Articles