simonw / datasette.io

The official project website for Datasette
https://datasette.io
92 stars 21 forks source link

Deploys are broken, Google Cloud actions error #127

Closed simonw closed 1 year ago

simonw commented 1 year ago

Same issue as:

simonw commented 1 year ago

First failure was: https://github.com/simonw/datasette.io/actions/runs/3589526893

Error: google-github-actions/setup-gcloud failed with: failed to execute command `gcloud --quiet auth activate-service-account *** --key-file -`: /opt/hostedtoolcache/gcloud/275.0.0/x64/lib/googlecloudsdk/core/console/console_io.py:544: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if answer is None or (answer is '' and default is not None):
ERROR: gcloud failed to load: module 'collections' has no attribute 'MutableMapping'
    gcloud_main = _import_gcloud_main()
    import googlecloudsdk.gcloud_main
    from googlecloudsdk.api_lib.iamcredentials import util as iamcred_util
    from googlecloudsdk.api_lib.util import exceptions
    from googlecloudsdk.core.resource import resource_printer
    from googlecloudsdk.core.resource import config_printer
    from googlecloudsdk.core.resource import resource_printer_base
    from googlecloudsdk.core.resource import resource_projector
    from google.protobuf import json_format as protobuf_encoding
    from google.protobuf import symbol_database
    from google.protobuf import message_factory
    from google.protobuf import reflection
    from google.protobuf.internal import python_message as message_impl
    from google.protobuf.internal import containers
    MutableMapping = collections.MutableMapping

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 executable:
    /opt/hostedtoolcache/Python/3.10.8/x64/bin/python

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

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

I tried downgrading to Python 3.9 but that didn't fix it this time.

simonw commented 1 year ago

In https://github.com/simonw/datasette/commit/ec1dde5dd21304c158bb7cc4d882b8050e57ceda I also bumped the version to 318.0.0.

simonw commented 1 year ago

That fixed it, but I honestly don't know why.

simonw commented 1 year ago

Turned this into a TIL: https://til.simonwillison.net/googlecloud/gcloud-error-workaround