确认错误消息中显示的项目 ID 与您要在其中部署 Endpoints 配置的 Google Cloud 项目对应:
gcloud projects list
确认 gcloud CLI 已将正确的项目 ID 设置为当前项目:
gcloud config set project YOUR_PROJECT_ID
调用者没有权限
ERROR: (gcloud.endpoints.services.deploy) PERMISSION_DENIED: Caller does not have permission 'servicemanagement.services.create' on
project YOUR_PROJECT_ID
当您首次部署 Endpoints 配置时,Service Management 会为您的 API 创建托管式服务。如需创建托管式服务,您必须至少拥有项目级层的 Editor 角色。在 Service Management 创建托管式服务后,您必须至少具备该服务的 Service Config Editor 角色 (roles/servicemanagement.configEditor) 才能重新部署 Endpoints 配置。如需了解详情,请参阅授予对 API 的访问权限。
无法验证域名所有权
ERROR: (gcloud.endpoints.services.deploy) PERMISSION_DENIED: Ownership for domain name YOUR_DOMAIN_NAME on project
YOUR_PROJECT_ID cannot be verified
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[[["\u003cp\u003eThis guide helps troubleshoot common errors encountered when deploying Cloud Endpoints configurations, offering solutions specific to issues like trailing slashes in paths, permission errors, and domain name verification problems.\u003c/p\u003e\n"],["\u003cp\u003eErrors such as "Cannot convert to service config" due to trailing slashes in OpenAPI paths can be resolved by removing the trailing slash from the specified paths in the document.\u003c/p\u003e\n"],["\u003cp\u003ePermission issues like "Not allowed to get project settings" or "Caller does not have permission" are often fixed by re-authenticating with \u003ccode\u003egcloud\u003c/code\u003e and ensuring the correct project ID and roles are set, with appropriate user permissions.\u003c/p\u003e\n"],["\u003cp\u003eDomain verification problems, such as "Ownership for domain name cannot be verified," require verifying custom domain names or confirming that the \u003ccode\u003ehost\u003c/code\u003e field in the OpenAPI document correctly uses the appropriate format, whether it be \u003ccode\u003ecloud.goog\u003c/code\u003e or \u003ccode\u003eappspot.com\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eFor unlisted errors, users are instructed to use the \u003ccode\u003egcloud --verbosity=debug endpoints services deploy openapi.yaml\u003c/code\u003e command to get debug information and obtain details that are not in this document.\u003c/p\u003e\n"]]],[],null,[]]