I am looking to create a GCP Cloud API Gateway resource for my project. I have created the API and also created the API config. I am now looking to create the Gateway itself. However, when I run the Gateway creation command I get the following error:
gcloud beta api-gateway gateways create project-api-gateway --api=project-api --api-config=project-config --location=us-central1
Waiting for API Gateway [project-api-gateway] to be created with [projects/${MY_PROJECT}/locations/global/apis/project-api/configs/project-config] config...failed. ERROR: (gcloud.beta.api-gateway.gateways.create) an internal error has occurred
The same happens when I try and do this through the cloud console and creating the API gateway through terraform. Anyone know what's going wrong here?
The API and API config were created through terraform, but I believe the equivalent creation commands are:
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
EDIT: As request, the command run with debug turned on (and slightly redacted):
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 can be found at http://www.filedropper.com/swagger_1