1

我正在为我的项目创建一个 GCP Cloud API Gateway资源。我创建了 API 并创建了 API 配置。我现在正在寻找创建网关本身。但是,当我运行网关创建命令时,出现以下错误:

gcloud beta api-gateway 网关创建 project-api-gateway --api=project-api --api-config=project-config --location=us-central1

等待使用 [projects/${MY_PROJECT}/locations/global/apis/project-api/configs/project-config] config...创建 API 网关 [project-api-gateway] 失败。错误:(gcloud.beta.api-gateway.gateways.create)发生内部错误

当我尝试通过云控制台执行此操作并通过 terraform 创建 API 网关时,也会发生同样的情况。有人知道这里出了什么问题吗?

API 和 API 配置是通过 terraform 创建的,但我相信等效的创建命令是:

gcloud beta api-gateway apis create project-api --project= gcloud beta api-gateway api-configs create project-config
--api=project-api --openapi-spec=swagger.yaml
--project= --backend- auth-service-account=SERVICE_ACCOUNT_EMAIL

编辑:根据要求,打开调试的命令运行(并略微编辑):

gcloud beta api-gateway gateways create project-api-gateway \
  --api=project-api --api-config=project-config \
  --location=europe-west1 --verbosity=debug
DEBUG: Running [gcloud.beta.api-gateprojectway.gateways.create] with arguments: [--api: "project-api", --api-config: "project-config", --location: "europe-west1", --verbosity: "debug", GATEWAY: "project-api-gateway"]
DEBUG: Making request: POST https://www.googleapis.com/oauth2/v4/token
Waiting for API Gateway [project-api-gateway] to be created with [projects/project-prd-f4be/locations/global/apis/project-api/configs/project-config] config...failed.
DEBUG: (gcloud.beta.api-gateway.gateways.create) an internal error has occurred
Traceback (most recent call last):
  File "/Users/Person/Downloads/google-cloud-sdk 2/lib/googlecloudsdk/calliope/cli.py", line 983, in Execute
    resources = calliope_command.Run(cli=self, args=args)
  File "/Users/Person/Downloads/google-cloud-sdk 2/lib/googlecloudsdk/calliope/backend.py", line 808, in Run
    resources = command_instance.Run(args)
  File "/Users/Person/Downloads/google-cloud-sdk 2/lib/surface/api_gateway/gateways/create.py", line 66, in Run
    return operations_util.PrintOperationResult(
  File "/Users/Person/Downloads/google-cloud-sdk 2/lib/googlecloudsdk/command_lib/api_gateway/operations_util.py", line 67, in PrintOperationResult
    return op_client.WaitForOperation(operation_ref, wait_string, service)
  File "/Users/Person/Downloads/google-cloud-sdk 2/lib/googlecloudsdk/api_lib/api_gateway/operations.py", line 89, in WaitForOperation
    return waiter.WaitFor(poller, operation_ref, message)
  File "/Users/Person/Downloads/google-cloud-sdk 2/lib/googlecloudsdk/api_lib/util/waiter.py", line 261, in WaitFor
    operation = PollUntilDone(
  File "/Users/Person/Downloads/google-cloud-sdk 2/lib/googlecloudsdk/api_lib/util/waiter.py", line 322, in PollUntilDone
    operation = retryer.RetryOnResult(
  File "/Users/Person/Downloads/google-cloud-sdk 2/lib/googlecloudsdk/core/util/retry.py", line 229, in RetryOnResult
    if not should_retry(result, state):
  File "/Users/Person/Downloads/google-cloud-sdk 2/lib/googlecloudsdk/api_lib/util/waiter.py", line 320, in _IsNotDone
    return not poller.IsDone(operation)
  File "/Users/Person/Downloads/google-cloud-sdk 2/lib/googlecloudsdk/api_lib/util/waiter.py", line 122, in IsDone
    raise OperationError(operation.error.message)
googlecloudsdk.api_lib.util.waiter.OperationError: an internal error has occurred
ERROR: (gcloud.beta.api-gateway.gateways.create) an internal error has occurred

API 可以在http://www.filedropper.com/swagger_1找到

4

0 回答 0