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

Viewed 12520

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 :)

3 Answers

Disable IPV6 :

sysctl net.ipv6.conf.all.disable_ipv6=1

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

I updated 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 this point the issue still persisted, decided to reinstall gcloud and came across this: I was using zsh so I added the followin .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 a gcloud init got me resetting some proxy configuration that was probably the main issue from the start.

Related