
'hello world' Cloud 함수를 만들려고 하면 다음 오류 메시지가 표시됩니다.
"요청이 하나 이상의 조직 정책을 위반했습니다. 자세한 내용은 해당 위반 사항을 참조하십시오."
이제 어떤 조직 정책이 위반되었습니까? 로그 탐색기에서 다음과 같은 오류 메시지를 발견했습니다.
{
insertId: "XXX"
logName: "projects/XXX/logs/cloudaudit.googleapis.com%2Factivity"
protoPayload: {10}
receiveTimestamp: "2021-11-26T11:42:16.735011108Z"
resource: {2}
severity: "ERROR"
timestamp: "2021-11-26T11:42:16.490247Z"
}
답변1
내 문제에 대한 해결책을 찾았습니다. "함수 만들기"를 클릭한 후 "런타임, 빌드, 연결 및 보안 설정" -> "연결"을 선택하고 옵션을 선택해야 했습니다.
거기에는 옵션이 선택되지 않았습니다. 이는 내 프로젝트의 네트워크 설정 때문인 것 같습니다.
이제 배포할 수 있습니다 :)
답변2
로깅에는 세부정보가 포함됩니다.error.details[x].violations[x].type. 로그 항목에는 위반된 제약 조건이 명시되어 있습니다.
다음 로그 항목은 위치 위반을 보여줍니다.
"type": "constraints/gcp.resourceLocations"
로그 항목 예시:
"error": {
"code": 400,
"message": "The request has violated one or more Org Policies. Please refer to the respective violations for more information."
"status": "FAILED_PRECONDITION"
"details\": [
{
"@type": "type.googleapis.com/google.rpc.PreconditionFailure",
"violations": [
{
"type": "constraints/gcp.resourceLocations",
"subject": "orgpolicy:projects/<project>",
"description": "Constraint constraints/gcp.resourceLocations violated for projects/<project> attempting GenerateUploadUrlActionV1 with location set to us-central1. See https://cloud.google.com/resource-manager/docs/organization-policy/org-policy-constraints for more information."
}
]
}
]
}