Troubleshooting Extensible Service Proxy

This page provides information on general Extensible Service Proxy troubleshooting. The issues are summarized in four cateogries:

OpenAPI Specification
Deployment
Authentication
Monitoring

OpenAPI Specification

The OpenAPI Specification file can be in YAML format or JSON format. If it is in JSON format, the syntax needs to be verified.

Validating openapi.json syntax

To check that a openapi.json is a well-formatted JSON file, you can open it in a JSON-validating text editor such as vim or use an online JSON linter service.

python can also be used to validate JSON syntax:

python -m json.tool openapi.json

To improve readability, pretty-print the JSON file using python:

python -m json.tool input.json > output.json

Replace input.json with the path to your openapi.json file. output.json is the pretty-printed JSON file.

Validating OpenAPI Specification

Not all OpenAPI constructs are currently supported by Cloud Endpoints. If your service configuration deployment fails, check the OpenAPI specification using the gcloud command-line tool to convert it to the Cloud Endpoints configuration format.

gcloud beta service-management convert-config openapi.json

Service control request failed with HTTP response code 404

If a service control request fails with a HTTP response code 404, check if the "host" is specified in your OpenAPI Specification.

Method does not exist

If you get Method does not exist, check the OpenAPI Specification to see whether the method you are calling is specified in paths.

To avoid listing all methods supported in your backend in the OpenAPI specification, add the x-google-allow flag at the top level of the specification file.

x-google-allow: all

Method doesn't allow unregistered callers

If you have specified an api_key in the security section in your OpenAPI specification, and make calls without appending api-key, you can use a Browser or Server API key from the Cloud Console Credentials page.

Deployment

Checking debug information

Running the gcloud command-line tool with debug verbosity will help with debugging.

gcloud --verbosity=debug COMMAND

This will make the gcloud command-line tool print a verbose log of the error. Depending on the command being run, the output can include request and response information from the server.

Enabling a Service

You can check whether a service is enabled using gcloud.

gcloud service-management list

To display configuration for a particular service, use the following command:

gcloud service-management describe SERVICE_NAME

Google Cloud Platform Deployment

The deployment of an proxy binary to Google Cloud Platform is platform dependent, with dedicated troubleshooting guides available.

cURL BAD_GATEWAY response

When sending a message to the echo endpoint using curl results in a response code 13 message = BAD_GATEWAY, check:

  • The backend service is running

  • The correct IP address port of the backend service is specified

    • For Container Engine, check the -a flag value in gke.yaml. For Compute Engine check the -a flag value in the docker run command.

Authentication

Proxy OAuth fails yet requests pass

Make sure there is a security section that has your OAuth definition in your OpenAPI specification file. An example specification file is available in the Cloud Endpoints Github repository.

Monitoring

Locating Cloud Endpoints Logs

  1. Go to Cloud Console Logs page.

  2. Select the service for which you want logs.

  3. Select endpoints_log.

Locating Endpoints Metrics/Graphs

  1. Go to the Cloud Console Endpoints page.

  2. Select the service for which you want metrics.

  3. The graphs will update a few minutes after you make an API request.

Locating Traces

  1. Go to the Cloud Console Logs page.

  2. Select the trace you want to view.

Note: If there is no trace being displayed, ensure the StackDriver Trace API is enabled for your project. By default, the proxy samples a request every 10 seconds to be traced. The client can also force a request to be traced: Strackdriver Trace FAQ.

Send feedback about...

Cloud Endpoints with OpenAPI