This page provides information on general Extensible Service Proxy troubleshooting. The issues are summarized in four cateogries:
The OpenAPI Specification file can be in YAML format or JSON format. If it is in JSON format, the syntax needs to be verified.
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
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 -m json.tool input.json > output.json
input.json with the path to your
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
gcloud command-line tool to convert it to the Cloud Endpoints
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
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
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.
Checking debug information
gcloud command-line tool with debug verbosity will help with
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 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
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
-aflag value in
gke.yaml. For Compute Engine check the
-aflag value in the
- For Container Engine, check the
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.
Locating Cloud Endpoints Logs
Go to Cloud Console Logs page.
Select the service for which you want logs.
Locating Endpoints Metrics/Graphs
Go to the Cloud Console Endpoints page.
Select the service for which you want metrics.
The graphs will update a few minutes after you make an API request.
Go to the Cloud Console Logs page.
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.