이 페이지에서는 Cloud Endpoints 구성을 배포할 때 발생할 수 있는 오류의 문제해결 방법을 설명합니다. 표시되는 오류 메시지에는 프로젝트 관련 정보가 포함됩니다. 예를 들어 프로젝트 ID가 포함된 오류 메시지가 표시될 수 있습니다. 이 페이지에서는 YOUR_PROJECT_ID와 같은 자리표시자 값이 사용됩니다.
각 단계 이후에 gcloud endpoints services deploy 명령어를 다시 실행하여 오류가 해결되었는지 확인하세요.
서비스 구성으로 변환할 수 없음
ERROR: (gcloud.endpoints.services.deploy) INVALID_ARGUMENT: Cannot convert to service config. http: undefined field <unknown>
on message <RequestType>
.proto 파일에서 프로토콜 버퍼 메시지와 트랜스코딩 매핑 사이에 일치하지 않는 필드를 확인합니다.
예를 들어 .proto 파일에서 다음 항목은 이 오류를 일으킵니다. Unary의 매핑 옵션은 Request 메시지 정의에 없는 이름이 undefined인 필드를 지정합니다.
rpc Unary(Request) Response {
option (google.api.http) { get : "/{undefined}" };
}
message Request {
string defined = 1;
}
프로젝트 설정을 가져올 수 없음
ERROR: (gcloud.endpoints.services.deploy) PERMISSION_DENIED: Not allowed to get project settings for project YOUR_PROJECT_ID
gcloud CLI에서 다시 인증하여 오류 메시지에 표시된 프로젝트에 대한 액세스 권한이 있는 계정으로 인증되었는지 확인합니다.
gcloud auth login
새 브라우저 탭이 열리고 계정을 선택하라는 메시지가 나타납니다.
오류 메시지에 표시된 프로젝트 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 구성을 다시 배포하기 위해 필요한 최소 권한은 서비스에 대한 서비스 구성 편집자 역할(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
api_config.yaml 파일의 name 필드에 구성된 커스텀 도메인(예: example.com)이 구성되어 있으면 서비스 구성을 배포하기 전에 먼저 도메인 이름을 확인해야 합니다.
cloud.goog 도메인을 사용 중이면 name 필드가 다음 형식이고 프로젝트 ID가 올바른지 확인합니다.
API_NAME.endpoints.YOUR_PROJECT_ID.cloud.goog
기타 오류 해결
여기에 나열되지 않은 오류가 발생하거나 정보로 문제를 해결할 수 없는 경우에는 플래그와 함께 gcloud 명령어를 다시 실행하여 디버그 정보를 표시합니다.
[[["이해하기 쉬움","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 page provides guidance on troubleshooting common errors encountered when deploying Cloud Endpoints configurations, specifically with gRPC.\u003c/p\u003e\n"],["\u003cp\u003eMismatched fields between protocol buffer messages and transcoding mappings in your \u003ccode\u003e.proto\u003c/code\u003e file can lead to a "Cannot convert to service config" error.\u003c/p\u003e\n"],["\u003cp\u003ePermission errors such as "Not allowed to get project settings" or "Caller does not have permission" may be resolved by re-authenticating with \u003ccode\u003egcloud\u003c/code\u003e, verifying the correct project ID is selected, and ensuring appropriate roles are granted.\u003c/p\u003e\n"],["\u003cp\u003eIf using a custom domain, "Ownership for domain name cannot be verified" errors require domain verification, and if utilizing the \u003ccode\u003ecloud.goog\u003c/code\u003e domain, confirm the correct formatting and project ID within your \u003ccode\u003eapi_config.yaml\u003c/code\u003e file.\u003c/p\u003e\n"],["\u003cp\u003eFor any unlisted errors, running the \u003ccode\u003egcloud\u003c/code\u003e command with the \u003ccode\u003e--verbosity=debug\u003c/code\u003e flag will display debug information to aid in resolving the problem.\u003c/p\u003e\n"]]],[],null,["# Troubleshooting Cloud Endpoints configuration deployment\n\n[OpenAPI](/endpoints/docs/openapi/troubleshoot-config-deployment \"View this page for the Cloud Endpoints OpenAPI docs\") \\| gRPC\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: (gcloud.endpoints.services.deploy) INVALID_ARGUMENT:` \n\n`Cannot convert to service config. http: undefined field \u003cunknown\u003e\non message \u003cRequestType\u003e`\n\nCheck your `.proto` file for mismatched fields between your\nprotocol buffer messages and [transcoding mappings](/endpoints/docs/grpc/transcoding).\n\nFor example, the following in a `.proto` file produces this\nerror. The mapping option on `Unary` specifies a field named\n`undefined` that isn't in the `Request` message\ndefinition. \n\n```\nrpc Unary(Request) Response {\n option (google.api.http) { get : \"/{undefined}\" };\n}\n\nmessage Request {\n string defined = 1;\n}\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/grpc/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 (for example, `example.com`) configured in the `name` field of your `api_config.yaml` file, you must [verify the\n domain name](/endpoints/docs/grpc/verify-domain-name) before you can deploy the service configuration.\n- If you are using the `cloud.goog` domain, confirm that the value for the `name` 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\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```scdoc\ngcloud --verbosity=debug endpoints services deploy api_descriptor.pb api_config.yaml api_config_http.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/grpc/api-access-overview)"]]