CircleCI-Public / gcp-cli-orb

Install and configure the Google Cloud CLI (gcloud)
https://circleci.com/orbs/registry/orb/circleci/gcp-cli
MIT License
9 stars 32 forks source link

failed to gcloud version #49

Closed peaceiris closed 1 year ago

peaceiris commented 1 year ago

Orb version

2.4.1

What happened

gcloud version failed

ERROR: gcloud failed to load: module 'collections' has no attribute 'Mapping'
    gcloud_main = _import_gcloud_main()
    import googlecloudsdk.gcloud_main
    from googlecloudsdk.calliope import cli
    from googlecloudsdk.calliope import actions
    from googlecloudsdk.calliope import markdown
    from googlecloudsdk.calliope import usage_text
    from googlecloudsdk.calliope import parser_arguments
    from googlecloudsdk.calliope import parser_completer
    from googlecloudsdk.core.console import progress_tracker
    class _BaseStagedProgressTracker(collections.Mapping):

This usually indicates corruption in your gcloud installation or problems with your Python interpreter.

Please verify that the following is the path to a working Python 2.7 or 3.5+ executable:
    /usr/bin/python3

If it is not, please set the CLOUDSDK_PYTHON environment variable to point to a working Python 2.7 or 3.5+ executable.

If you are still experiencing problems, please reinstall the Cloud SDK using the instructions here:
    https://cloud.google.com/sdk/

Exited with code exit status 1

Expected behavior

paytonagreen commented 1 year ago

I ran into this same issue, found that setting the version helped:

steps:
  - gcp-cli/install:
      version: "405.0.0"

Seems like the default is pretty out of date and has some issues interacting with certain Python versions.

eddawley commented 1 year ago

I believe the root cause is that this PR has left the default version different between install_and_initialize_cli and install

realgenekim commented 1 year ago

Thanks for the awesome tools supporting GCP — 

I've noticed that all gcp-cli/install steps started failing 2 days ago, and now require explicitly adding the version parameter.

Recommend escalating this fix, or adding some documentation of this issue and remedy on the gcp-cli page? https://circleci.com/developer/orbs/orb/circleci/gcp-cli

EricRibeiro commented 1 year ago

Hi @realgenekim 👋

We are working towards a major release that will include the fix for this issue and new features. You can check out the progress here.

The release is not far away. In the meantime, please bear with us and continue to use the version parameter.