Troubleshooting Response Errors

This page describes how to troubleshoot errors that you receive in a response from a request to your API.

Upstream backend unavailable

If you receive an error code 14 and the message upstream backend unavailable, this indicates that the Extensible Service Proxy (ESP) can't reach the service backend. Check the following:

  • Make sure the backend service is running. How you do that depends on the backend.
  • The correct IP address port of the backend service is specified:
    • For GKE, check the ESP --backend flag value (the short option is -a) in your Deployment manifest file (often called deployment.yaml).
    • For Compute Engine check the ESP --backend flag value (the short option is -a) in the docker run command.

API is not enabled for the project

If you sent an API key in the request, an error message like "API is not enabled for the project" indicates that the API key was created in a different GCP project than the API. To fix this, you can either create the API key in the same GCP project that the API is associated with, or you can enable the API in the GCP project that the API key was created in.

Method doesn't allow unregistered callers

ESP responds with this error when you have specified allow_unregistered_calls: false in your gRPC API config file, but the request to your API does not have an API key assigned to a query parameter named key.

If you need to generate an API key so that you can make calls to your API, see Creating an API key.

Method does not exist

This response means that the HTTP method (GET, POST or other) on the specified URL path was not found. To troubleshoot, compare the service configuration that you have deployed to make sure that the method name and URL path that you are sending in the request match:

  1. In the GCP Console, go to the Endpoints Services page for your project.

    Endpoints Services Page

  2. If you have more than one API, select the API that you sent the request to.

  3. Click the Deployment history tab.
  4. Select the latest deployment to see the service configuration.

Transport is closing

If you receive an error code 13 and the message transport is closing, this indicates that ESP is unreachable.

Check the ESP error logs. How you do that depends on the backend. See the following for more information:

Unexpected responses

If the HTTP response looks like it is binary, this might indicate that the request is hitting the API via the HTTP2 port when you intended to use the HTTP1 port.

Check your port configuration options for ESP. Because the short form flags -p (for HTTP1) and -P (for HTTP2) look similar, we recommend that you use the long form flags instead: --http_port for HTTP1 and --http2_port for HTTP2.

A misconfiguration of the ESP backend may also cause unexpected responses. Make sure the backend flag (-a or --backend) is set to a gRPC URL such as --backend=grpc://

For more details on the ESP flags, see ESP Startup Options

Checking the Stackdriver logs

To use the Stackdriver logs to help troubleshoot response errors:

  1. Go to the Stackdriver > Logging page in the GCP Console:

    Go to the Logs Viewer page

  2. Select the GCP project at the top of the page.

  3. Using the drop-down menus on the left, select Produced API > [YOUR_SERVICE_NAME].

  4. Adjust the time range until you see a row that shows your response error.

  5. Expand the JSON payload and look for error_cause.

    • If the error_cause is set to application, this indicates an issue in your code.

    • If the error cause is anything else and you are unable to fix the issue, export the log and include it in any communication that you have with Google.

See the following for more information:

Was this page helpful? Let us know how we did:

Send feedback about...

Cloud Endpoints with gRPC
Need help? Visit our support page.