エラー メッセージに表示されたプロジェクト 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 のマネージド サービスが作成されます。マネージド サービスを作成するには、ユーザーに少なくともプロジェクト レベルで編集者の役割が付与されている必要があります。Service Management によってマネージド サービスが作成された後、Endpoints 構成を再デプロイするために必要な最小限の権限は、サービスに対する Service Config 編集者の役割(roles/servicemanagement.configEditor)です。詳細については、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"]],["最終更新日 2024-12-21 UTC。"],[[["\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,["# Troubleshooting Cloud Endpoints configuration deployment\n\nOpenAPI \\| [gRPC](/endpoints/docs/grpc/troubleshoot-config-deployment \"View this page for the Cloud Endpoints gRPC docs\")\n\n\u003cbr /\u003e\n\nThis page describes how to troubleshoot errors that you might encounter when you\ndeploy your Cloud Endpoints configuration. The error messages that you see\ncontain information specific to your project. For example, you might see an\nerror message that has your project ID in it. On this page you'll see\nplaceholder values such as \u003cvar translate=\"no\"\u003eYOUR_PROJECT_ID\u003c/var\u003e.\n\nAfter each step, run the `gcloud endpoints services deploy` command again to see\nif the error is resolved.\n\nCannot convert to service config\n--------------------------------\n\n`ERROR: unknown location: http: In path template '[PATH]':\nunexpected end of input '/'.'`\n\nThis error is displayed when one or more paths in your OpenAPI document\nincludes a trailing slash (`/`) character. To fix this issue, remove the\ntrailing slash from all paths. For example, the following snippet in\nan OpenAPI document results in this error:\n\n```\npaths:\n \"/echo/\":\n post:\n description: \"Echo back a given message.\"\n```\n\nTo fix this, remove the trailing slash from `/echo/`: \n\n```\npaths:\n \"/echo\":\n post:\n description: \"Echo back a given message.\"\n```\n\nNot allowed to get project settings\n-----------------------------------\n\n`ERROR: (gcloud.endpoints.services.deploy) PERMISSION_DENIED:` \n\n`Not allowed to get project settings for project `\u003cvar translate=\"no\"\u003eYOUR_PROJECT_ID\u003c/var\u003e`\n`\n\n1. Authenticate with gcloud CLI again to confirm that you authenticated with an account that has permission to access the project displayed in the error message: \n\n ```text\n gcloud auth login\n ```\n\n A new browser tab opens and you are prompted to choose an account.\n2. Confirm that the project ID displayed in the error message corresponds to the Google Cloud project that you intend to deploy the Endpoints configuration to: \n\n ```text\n gcloud projects list\n ```\n3. Confirm that gcloud CLI has the correct project ID set as the current project: \n\n ```scdoc\n gcloud config set project YOUR_PROJECT_ID\n ```\n\nCaller does not have permission\n-------------------------------\n\n`ERROR: (gcloud.endpoints.services.deploy) PERMISSION_DENIED:` \n\n`Caller does not have permission 'servicemanagement.services.create' on\nproject `\u003cvar translate=\"no\"\u003eYOUR_PROJECT_ID\u003c/var\u003e\n\nWhen you first deploy the Endpoints configuration,\nService Management creates a managed service for your API. To create a managed\nservice, at a minimum you must have the **Editor** role at the project level.\nAfter Service Management creates the managed service, the minimum required\npermissions to redeploy an Endpoints configuration is the\n**Service Config Editor** role (**roles/servicemanagement.configEditor** )\non the service. For more information, see\n[Granting access to the API](/endpoints/docs/openapi/control-api-access).\n\nOwnership for domain name cannot be verified\n--------------------------------------------\n\n`ERROR: (gcloud.endpoints.services.deploy) PERMISSION_DENIED:` \n\n`Ownership for domain name `\u003cvar translate=\"no\"\u003eYOUR_DOMAIN_NAME\u003c/var\u003e` on project\n`\u003cvar translate=\"no\"\u003eYOUR_PROJECT_ID\u003c/var\u003e` cannot be verified`\n\n- If you have a custom domain (such as `example.com`) configured in the `host` field of your OpenAPI document, you must [verify the domain name](/endpoints/docs/openapi/verify-domain-name) before you can deploy your OpenAPI document.\n- If you are using the `cloud.goog` domain, confirm that the value for the `host` field is in the following format, and that the project ID is correct: \n\n ```scdoc\n API_NAME.endpoints.YOUR_PROJECT_ID.cloud.goog\n ```\n- If you are using the `appspot.com` domain (supported for App Engine only), confirm that the `host` field is in the following format, and that the project ID is correct: \n\n ```scdoc\n YOUR_PROJECT_ID.appspot.com\n ```\n\nTroubleshooting other errors\n----------------------------\n\nIf you received an error not listed here, or if the information didn't\nsolve your problem, run the `gcloud` command again with the flag\nto display debug information: \n\n```text\ngcloud --verbosity=debug endpoints services deploy openapi.yaml\n```\n\nWhat's next\n-----------\n\n- [`gcloud endpoints services deploy`](/sdk/gcloud/reference/endpoints/services/deploy)\n- [Overview of API access](/endpoints/docs/openapi/api-access-overview)"]]