Creating new API gateway fails

56 views
Skip to first unread message

Ludwig Fingal

unread,
Nov 30, 2020, 5:12:20 AM11/30/20
to api-gateway-users
Hi,

We have deployed two gateways previously (a few weeks ago). At first we kept hitting "an internal error occurred", which is actually the same problem as we are having now, but it worked flawlessly the next day so we didn't think more of it.

Last week we wanted to deploy another gateway and hit the same issue. Figured we would wait a few days to see if it would resolve itself like last time but unfortunately nothing so far.

Worth mentioning is that updating existing gateways seems to work just fine. Creating/updating APIs and configs also works, it's only the gateway deployment we are having issues with. Tried using both CLI and console, same error on both.

Any ideas what could be going wrong, or what I could do to troubleshoot it?

Command:
gcloud --verbosity=debug beta api-gateway gateways create radinn-api-gateway --api=radinn-api --api-config=initial-config --location=europe-west1 --project=radinn-sales

Error:
DEBUG: (gcloud.beta.api-gateway.gateways.create) an internal error has occurred

Can also supply the stack trace if needed.

Kyle Wiese

unread,
Nov 30, 2020, 10:37:07 AM11/30/20
to api-gateway-users
Hey Ludwig,

If you could provide us those debug logs, that would be very helpful. If you don't feel comfortable posting them here, feel free to shoot them in an email directly to me.

Thanks!
Kyle

Ludwig Fingal

unread,
Nov 30, 2020, 11:16:28 AM11/30/20
to api-gateway-users
Hey! Appreciate the help - here are the logs:

DEBUG: Running [gcloud.beta.api-gateway.gateways.create] with arguments: [--api: "radinn-sales-api", --api-config: "initial-config", --location: "europe-west1", --project: "sales-sandbox-a59a7", --verbosity: "debug", GATEWAY: "radinn-sales-api-gateway"]
DEBUG: Making request: POST https://oauth2.googleapis.com/token
Waiting for API Gateway [radinn-sales-api-gateway] to be created with [projects/sales-san
dbox-a59a7/locations/global/apis/radinn-sales-api/configs/initial-config] config...failed
.
DEBUG: (gcloud.beta.api-gateway.gateways.create) an internal error has occurred
Traceback (most recent call last):
  File "/home/lode/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 983, in Execute
    resources = calliope_command.Run(cli=self, args=args)
  File "/home/lode/google-cloud-sdk/lib/googlecloudsdk/calliope/backend.py", line 808, in Run
    resources = command_instance.Run(args)
  File "/home/lode/google-cloud-sdk/lib/surface/api_gateway/gateways/create.py", line 66, in Run
    return operations_util.PrintOperationResult(
  File "/home/lode/google-cloud-sdk/lib/googlecloudsdk/command_lib/api_gateway/operations_util.py", line 67, in PrintOperationResult
    return op_client.WaitForOperation(operation_ref, wait_string, service)
  File "/home/lode/google-cloud-sdk/lib/googlecloudsdk/api_lib/api_gateway/operations.py", line 89, in WaitForOperation
    return waiter.WaitFor(poller, operation_ref, message)
  File "/home/lode/google-cloud-sdk/lib/googlecloudsdk/api_lib/util/waiter.py", line 261, in WaitFor
    operation = PollUntilDone(
  File "/home/lode/google-cloud-sdk/lib/googlecloudsdk/api_lib/util/waiter.py", line 322, in PollUntilDone
    operation = retryer.RetryOnResult(
  File "/home/lode/google-cloud-sdk/lib/googlecloudsdk/core/util/retry.py", line 229, in RetryOnResult
    if not should_retry(result, state):
  File "/home/lode/google-cloud-sdk/lib/googlecloudsdk/api_lib/util/waiter.py", line 320, in _IsNotDone
    return not poller.IsDone(operation)
  File "/home/lode/google-cloud-sdk/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

Josh Einhorn

unread,
Nov 30, 2020, 11:34:52 AM11/30/20
to Ludwig Fingal, api-gateway-users
I believe Kyle has found the root cause is actually invalid input (i.e. your spec). Apologies for having to reach out here to find this out; FWIW, we actually previously identified this gap and have been hard at work making sure actionable error messages will actually be raised directly to you for self-service debugging rather than via opaque internal errors. This will be live soon in an upcoming release.

-Josh

--
You received this message because you are subscribed to the Google Groups "api-gateway-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-gateway-us...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/api-gateway-users/412946de-0db2-4538-ad1e-25c3ed0c3842n%40googlegroups.com.


--
Josh Einhorn | Software Engineer | joshe...@google.com | 1-215-837-1102

Kyle Wiese

unread,
Nov 30, 2020, 11:45:42 AM11/30/20
to api-gateway-users
Hey Ludwig,

The specific issue with the API spec seems to be the `/promos/:code/consume` path where the `:` can't be used except for the last path segment. It's a tad confusing since it's related to gRPC, but in case your curious, the specific error you ran into is related to https://cloud.google.com/endpoints/docs/grpc-service-config/reference/rpc/google.api#path-template-syntax and the API style guide https://google.aip.dev/136. Thanks for reaching out and bringing this to our attention!

Ludwig Fingal

unread,
Nov 30, 2020, 12:00:09 PM11/30/20
to api-gateway-users
Ah, I see! I had a feeling it was somewhere on our end, but couldn't quite figure it out :-)

Thanks a lot for the help!
Reply all
Reply to author
Forward
0 new messages