Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Cloud SDK install on OS X: (gcloud.components.list) Failed to fetch component listing from server

I'm trying to install the 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 corresponding Python (also tried Python 2.7.8):

openssl version  
OpenSSL 1.0.2k  26 Jan 2017

python -V
Python 2.7.13

Python is also using this OpenSSL version:

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

I'm running mac OS 10.12.4

I've also tried brew cask install google-cloud-sdk which effectively just downloads the normal version und executes the install.sh script. Same result.

Further debugging showed, it's unable to load https://dl.google.com/dl/cloudsdk/channels/rapid/components-2.json and throws 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 hints how to further debug this, would be appreciated :)

like image 227
Jan Avatar asked May 20 '17 14:05

Jan


2 Answers

After turning off ipv6 support, the tool works like a charm. Looks like gcloud can not work gracefully with ipv6...

Disable ipv6:

networksetup -setv6off Wi-Fi

Enable ipv6:

networksetup -setv6automatic Wi-Fi

Note: While investigating this, I was also able to make it work by using a very long timeout — 120 seconds. This wouldn't be practical, though, for most use cases due to the long delays it would introduce for each command.

The timeout is located in google-cloud-sdk/lib/googlecloudsdk/core/updater/installers.py at line 36 called TIMEOUT_IN_SEC

like image 165
Jan Avatar answered Sep 23 '22 14:09

Jan


Disable IPV6 :

sysctl net.ipv6.conf.all.disable_ipv6=1
like image 33
wikimix Avatar answered Sep 24 '22 14:09

wikimix