2
votes

I tried out google cloud run and working perfectly but suddenly got error while depolying after few days crashed (AttributeError): 'NoneType' object has no attribute 'image'

Everything seems fine, I have set project name, region but getting the same error

The command used is

gcloud beta run deploy --image gcr.io/cloud-run-test/image-name --allow-unauthenticated --update-env-vars environment="PRODUCTION"

1

1 Answers

1
votes

I have found the solution, the google cloud run is in beta so the commands using to deploy may change in future.

What I did is updated the gcloud

gcloud components update

then after the update they introduced an additional parameter to specify platform.

The updated CLI code is

gcloud beta run deploy --platform managed --image gcr.io/cloud-run-test/image-name --allow-unauthenticated --update-env-vars environment="PRODUCTION"

You can specify platform as managed or gke

Available platforms:

  • gke: Cloud Run on Google Kubernetes Engine. Use with the --cluster and --cluster-location flags or set the [run/cluster] and [run/cluster_location] properties to specify a cluster in a given zone.
  • managed: Fully managed version of Cloud Run. Use with the --region flag or set the [run/region] property to specify a Cloud Run region.