1
votes

Deploying a TF serving container I get the following error:

ERROR: gcloud crashed (AttributeError): 'Namespace' object has no attribute 'use_http2'

Versions

gcloud version
Google Cloud SDK 277.0.0
alpha 2019.05.17
beta 2019.05.17
bq 2.0.52
core 2020.01.17
docker-credential-gcr 
gsutil 4.47

Complete output

➜  cloud_run gcloud run deploy predict --image gcr.io/$PROJECT_ID/predict --port=8501 --memory=512 --platform managed --allow-unauthenticated --region=us-central1 
ERROR: gcloud crashed (AttributeError): 'Namespace' object has no attribute 'use_http2'

If you would like to report this issue, please run the following command:
  gcloud feedback

To check gcloud for common problems, please run the following command:
  gcloud info --run-diagnostics
➜  cloud_run gcloud run deploy predict --image gcr.io/$PROJECT_ID/predict --port=8501 --memory=512 --platform managed --allow-unauthenticated                     
ERROR: gcloud crashed (AttributeError): 'Namespace' object has no attribute 'use_http2'

If you would like to report this issue, please run the following command:
  gcloud feedback

To check gcloud for common problems, please run the following command:
  gcloud info --run-diagnostics
➜  cloud_run gcloud run deploy predict --image gcr.io/$PROJECT_ID/predict --port=8501 --memory=512 --platform managed                        
ERROR: gcloud crashed (AttributeError): 'Namespace' object has no attribute 'use_http2'

If you would like to report this issue, please run the following command:
  gcloud feedback

To check gcloud for common problems, please run the following command:
  gcloud info --run-diagnostics
➜  cloud_run gcloud run deploy predict --image gcr.io/$PROJECT_ID/predict --port=8501 --memory=512                   
ERROR: gcloud crashed (AttributeError): 'Namespace' object has no attribute 'use_http2'

If you would like to report this issue, please run the following command:
  gcloud feedback

To check gcloud for common problems, please run the following command:
  gcloud info --run-diagnostics
➜  cloud_run gcloud run deploy predict --image gcr.io/$PROJECT_ID/predict                         
Deploying container to Cloud Run service [predict] in project [XXXXXXX] region [us-central1]
✓ Deploying... Done.                                                                                                                                                              
  ✓ Creating Revision...                                                                                                                                                          
  ✓ Routing traffic...                                                                                                                                                            
Done.                                                                                                                                                                             
Service [predict] revision [predict-00005-lub] has been deployed and is serving 100 percent of traffic at https://predict-XXXXXX.a.run.app

Run diagnostics as indicated:

gcloud info --run-diagnostics
Network diagnostic detects and fixes local network connection issues.
Checking network connection...done.                                                                                                                                               
Reachability Check passed.
Network diagnostic passed (1/1 checks passed).

Property diagnostic detects issues that may be caused by properties.
Checking hidden properties...done.                                                                                                                                                
Hidden Property Check passed.
Property diagnostic passed (1/1 checks passed).

Seems to be all flags are valid:

NAME
    gcloud beta run deploy - deploy a container to Cloud Run

SYNOPSIS
    gcloud beta run deploy [[SERVICE] --namespace=NAMESPACE] --image=IMAGE
        [--args=[ARG,...]] [--async] [--command=[COMMAND,...]]
        [--concurrency=CONCURRENCY] [--max-instances=MAX_INSTANCES]
        [--memory=MEMORY] [--platform=PLATFORM] [--port=PORT]
        [--timeout=TIMEOUT]
        [--clear-env-vars | --set-env-vars=[KEY=VALUE,...]
          | --remove-env-vars=[KEY,...] --update-env-vars=[KEY=VALUE,...]]
        [--clear-labels | --remove-labels=[KEY,...] --labels=[KEY=VALUE,...]
          | --update-labels=[KEY=VALUE,...]]
        [--connectivity=CONNECTIVITY --cpu=CPU]
        [--[no-]allow-unauthenticated --revision-suffix=REVISION_SUFFIX
          --service-account=SERVICE_ACCOUNT
          --add-cloudsql-instances=[CLOUDSQL-INSTANCES,...]
          | --clear-cloudsql-instances
          | --remove-cloudsql-instances=[CLOUDSQL-INSTANCES,...]
          | --set-cloudsql-instances=[CLOUDSQL-INSTANCES,...]]
        [--region=REGION
          | --cluster=CLUSTER --cluster-location=CLUSTER_LOCATION
          | --context=CONTEXT --kubeconfig=KUBECONFIG] [GCLOUD_WIDE_FLAG ...]

DESCRIPTION
    (BETA) Deploys container images to Google Cloud Run.
1
Add the gcloud version to your question. The issue is a bug and the version number is important to future readers. - John Hanley
just added version - gogasca

1 Answers

2
votes

use the Alpha version in the SDK for the time being. a fix for the problem is being implemented, check here.

gcloud alpha run ....