[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[[["\u003cp\u003eThis page provides troubleshooting guidance for various issues related to Cloud Endpoints, including configuration deployment, API backend deployment, and response errors.\u003c/p\u003e\n"],["\u003cp\u003eEndpoints and the Extensible Service Proxy (ESP) require the Service Management API and Service Control API to be enabled, which can be checked and enabled using the \u003ccode\u003egcloud\u003c/code\u003e command-line tool.\u003c/p\u003e\n"],["\u003cp\u003eThe instance running ESP must have permissions to access Service Management and Service Control, with specific instructions available for Cloud Run, Compute Engine, and GKE deployments.\u003c/p\u003e\n"],["\u003cp\u003eRunning \u003ccode\u003egcloud\u003c/code\u003e commands with debug verbosity (\u003ccode\u003egcloud --verbosity=debug COMMAND\u003c/code\u003e) can provide detailed error logs for troubleshooting.\u003c/p\u003e\n"],["\u003cp\u003eIf proxy OAuth fails but requests still pass, verify that the OpenAPI document contains a \u003ccode\u003esecurity\u003c/code\u003e section with the OAuth definition.\u003c/p\u003e\n"]]],[],null,["# Troubleshooting overview\n\nOpenAPI \\| [gRPC](/endpoints/docs/grpc/troubleshoot \"View this page for the Cloud Endpoints gRPC docs\")\n\n\u003cbr /\u003e\n\nThis page provides general troubleshooting information and provides links to\nother pages for additional information.\n\nErrors when deploying the Cloud Endpoints configuration\n-------------------------------------------------------\n\nIf you got an error message from the `gcloud endpoints services deploy`\ncommand, see\n[Troubleshooting Endpoints configuration deployment](/endpoints/docs/openapi/troubleshoot-config-deployment)\nfor information on troubleshooting the error.\n\nErrors when deploying your API backend\n--------------------------------------\n\nThe deployment of your API and the Extensible Service Proxy (ESP) to a\nGoogle Cloud backend is platform dependent. See the\nfollowing troubleshooting guides for more information:\n\n\n- [Troubleshooting proxy deployment on App Engine flexible environment](/endpoints/docs/openapi/troubleshoot-aeflex-deployment)\n\n\u003c!-- --\u003e\n\n- [Troubleshooting proxy deployment on Compute Engine](/endpoints/docs/openapi/troubleshoot-gce-deployment)\n\n- [Troubleshooting proxy deployment on GKE](/endpoints/docs/openapi/troubleshoot-gke-deployment)\n\nResponse errors\n---------------\n\nWhen you send a request to your API and receive an error response, see\n[Troubleshooting response errors](/endpoints/docs/openapi/troubleshoot-response-errors)\nfor information on troubleshooting the error.\n\nChecking required services\n--------------------------\n\n### Checking required services\n\nAt a minimum, Endpoints and ESP require the following Google services to be enabled:\n\nIn most cases, the `gcloud endpoints services deploy` command enables these\nrequired services. However, the `gcloud` command completes successfully but\ndoesn't enable the required services in the following circumstances:\n\n- If you used a third-party application such as Terraform, and you don't\n include these services.\n\n- You deployed the Endpoints configuration to an existing\n Google Cloud project in which these services were explicitly disabled.\n\nUse the following command to confirm that the required services are enabled: \n\n```\ngcloud services list\n```\n\nIf you do not see the required services listed, enable them: \n\n gcloud services enable servicemanagement.googleapis.com\n gcloud services enable servicecontrol.googleapis.com\n\nAlso enable your Endpoints service: \n\n```\ngcloud services enable ENDPOINTS_SERVICE_NAME\n```\n\nTo determine the \u003cvar translate=\"no\"\u003eENDPOINTS_SERVICE_NAME\u003c/var\u003e you can either:\n\n- After deploying the Endpoints configuration, go to the **Endpoints** page in the Cloud console. The list of possible \u003cvar translate=\"no\"\u003eENDPOINTS_SERVICE_NAME\u003c/var\u003e are shown under the **Service name** column.\n\n- For OpenAPI, the \u003cvar translate=\"no\"\u003eENDPOINTS_SERVICE_NAME\u003c/var\u003e is what you specified in the `host` field of your OpenAPI spec. For gRPC, the \u003cvar translate=\"no\"\u003eENDPOINTS_SERVICE_NAME\u003c/var\u003e is what you specified in the `name` field of your gRPC Endpoints configuration.\n\nFor more information about the `gcloud` commands, see\n[`gcloud` services](/sdk/gcloud/reference/services).\n\nChecking required permissions\n-----------------------------\n\nThe instance running Extensible Service Proxy requires permissions to call [Service Management](/service-infrastructure/docs/service-management/getting-started) and [ServiceControl](/service-infrastructure/docs/service-control/getting-started).\n\n- For ESP deployed on Cloud Run, see [Building a new ESPv2 image in Cloud Run tutorial](/endpoints/docs/openapi/set-up-cloud-run-espv2#configure_esp) for details.\n\n- For ESP deployed on Compute Engine, see [Checking required permissions in Compute Engine tutorial](/endpoints/docs/openapi/get-started-compute-engine-docker#checking_required_permissions) for details.\n\n- For ESP deployed on GKE, see [Checking required permissions in GKE tutorial](/endpoints/docs/openapi/get-started-kubernetes-engine#checking_required_permissions) for details.\n\nChecking debug information\n--------------------------\n\nRunning the Google Cloud CLI with debug verbosity helps with\ndebugging. \n\n gcloud --verbosity=debug COMMAND\n\nThis command makes the Google Cloud CLI print a verbose log of the\nerror. Depending on the command being run, the output can include request and\nresponse information from the server.\n\nEnabling a service\n------------------\n\nYou can check whether a service is enabled using `gcloud`. \n\n gcloud services list\n\nTo display configuration for a particular service, use the following command: \n\n gcloud endpoints services describe SERVICE_NAME\n\nProxy OAuth fails yet requests pass\n-----------------------------------\n\nMake sure there is a `security` section that has your OAuth definition in your\nOpenAPI document. An example specification file is available in the\n[Getting started sample on GitHub](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/endpoints/getting-started/openapi.yaml).\n\nWhat's next\n-----------\n\n- [Monitoring your API](/endpoints/docs/openapi/monitoring-your-api)\n- [Tracing your API](/endpoints/docs/openapi/tracing)"]]