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 error code 14 and the message upstream backend unavailable, this indicates that the Extensible Service Proxy (ESP) can't reach the service's 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 my-api.endpoints.example-project-12345.cloud.goog is not enabled for the project" indicates that the API key was created in a different Google Cloud Platform (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.

Service control request failed with HTTP response code 403

If you receive error code 14 and the message Service control request failed with HTTP response code 403, this indicates that the Service Control API (servicecontrol.googleapis.com) isn't enabled on the project. See Checking required services to make sure that all the services that Endpoints and ESP require are enabled on your project.

Method doesn't allow unregistered callers

ESP responds with the error, Method doesn't allow unregistered callers, when you have specified allow_unregistered_calls: false in your gRPC API configuration file, but the request to your API doesn't have an API key assigned to a query parameter named key.

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

Method does not exist

The response, Method does not exist, means that the HTTP method (GET, POST, or other) on the specified URL path wasn't 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.

    Go to the 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 by using 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 might also cause unexpected responses. Make sure the backend flag (-a or --backend) is set to a gRPC URL such as --backend=grpc://127.0.0.1:8081.

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. In the GCP Console, go to the Stackdriver > Logging page.

    Go to the Logs Viewer page

  2. At the top of the page, select the GCP project.

  3. Using the drop-down menu 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.