【问题标题】:Cloud Run throws error "ERROR: gcloud crashed (AttributeError): 'Namespace' object has no attribute 'use_http2'"Cloud Run 抛出错误“错误:gcloud 崩溃(AttributeError):'Namespace' 对象没有属性'use_http2'”
【发布时间】:2020-01-25 01:48:45
【问题描述】:

部署 TF 服务容器时出现以下错误:

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

版本

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

完整输出

➜  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

按照指示运行诊断:

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).

似乎所有标志都有效:

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.

【问题讨论】:

  • gcloud 版本添加到您的问题中。这个问题是一个错误,版本号对未来的读者很重要。
  • 刚刚添加的版本

标签: google-cloud-platform gcloud


【解决方案1】:

暂时使用Alpha version in the SDK。正在实施该问题的修复,check here

gcloud alpha run ....

【讨论】:

    猜你喜欢
    • 2020-08-24
    • 1970-01-01
    • 1970-01-01
    • 2019-11-23
    • 2021-07-31
    • 1970-01-01
    • 2023-03-22
    • 1970-01-01
    • 2020-12-29
    相关资源
    最近更新 更多