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

后端 未结 3 1003
陌清茗
陌清茗 2020-12-29 08:54

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 f

相关标签:
3条回答
  • 2020-12-29 09:18

    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

    0 讨论(0)
  • 2020-12-29 09:19

    Disable IPV6 :

    sysctl net.ipv6.conf.all.disable_ipv6=1
    
    0 讨论(0)
  • 2020-12-29 09:24

    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.

    0 讨论(0)
提交回复
热议问题