【问题标题】:Google Cloud Endpoint Error when creating service config创建服务配置时出现 Google Cloud Endpoint 错误
【发布时间】:2020-05-02 05:07:13
【问题描述】:

我正在尝试使用 Cloud Functions 配置 Google Cloud Endpoints。同样,我遵循以下指示:https://cloud.google.com/endpoints/docs/openapi/get-started-cloud-functions

我已按照给出的步骤进行操作,并将服务配置构建到新的 ESPv2 Beta docker 映像中。当我下达命令时:

chmod +x gcloud_build_image
./gcloud_build_image -s CLOUD_RUN_HOSTNAME \
    -c CONFIG_ID -p ESP_PROJECT_ID

替换主机名和 configid 和 projectid 后出现以下错误

>     -c service-host-name-xxx -p project-id
Using base image: gcr.io/endpoints-release/endpoints-runtime-serverless:2
++ mktemp -d /tmp/docker.XXXX
+ cd /tmp/docker.5l3t
+ gcloud endpoints configs describe service-host-name-xxx.run.app --project=project-id --service=service-host-name-xxx.app --format=json
ERROR: (gcloud.endpoints.configs.describe) NOT_FOUND: Service configuration 'services/service-host-name-xxx.run.app/configs/service-host-name-xxx' not found.
+ error_exit 'Failed to download service config'
+ echo './gcloud_build_image: line 46: Failed to download service config (exit 1)'
./gcloud_build_image: line 46: Failed to download service config (exit 1)
+ exit 1

知道我做错了什么吗?谢谢

【问题讨论】:

    标签: google-cloud-endpoints-v2


    【解决方案1】:

    我的错。我重复了这些步骤并让它工作。所以我想我在尝试时一定犯了一些错误。该文档按其说明工作。

    【讨论】:

      【解决方案2】:

      我有同样的错误。两次运行脚本时,它可以工作。这意味着您必须已经配置了一个服务端点,当脚本尝试通过以下方式获取端点信息时,该端点还不存在:

      gcloud endpoints configs describe service-host-name-xxx.run.app
      

      我要做的(在 cloudbuild 中)是首先提供某种“空”容器。我在我的 cloudbuild.yaml 上使用了以下示例:

      gcloud run services list \
        --platform managed \
        --project ${PROJECT_ID} \
        --region europe-west1 \
        --filter=${PROJECT_ID}-esp-svc \
        --format yaml | grep . ||
      gcloud run deploy ${PROJECT_ID}-esp-svc \
        --image="gcr.io/endpoints-release/endpoints-runtime-serverless:2" \
        --allow-unauthenticated \
        --platform managed \
        --project=${PROJECT_ID} \
        --region=europe-west1 \
        --timeout=120
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-03-06
        • 2020-07-19
        • 1970-01-01
        • 2014-07-27
        • 2011-12-30
        • 1970-01-01
        相关资源
        最近更新 更多