【发布时间】:2023-03-22 12:34:01
【问题描述】:
我最近一直在使用 Google Cloud 端点,旧项目 ID 没有问题。现在我创建了一个新的项目 ID,但是在部署我的旧端点定义 (openapi.yaml) 时,我不断收到权限被拒绝错误。请注意,我已遵循所有身份验证指南,并成功创建了 GKE 集群并部署了我的 docker 容器,但只有创建端点失败。
这些是 openapi.yaml 的内容:
type: google.api.Service
config_version: 3
name: myendpoints.endpoints.my-project-id.cloud.goog
title: Hello gRPC API
apis:
- name: helloworld.Greeter
我用来部署它的命令是:
gcloud service-management deploy openapi.yaml --log-http --verbosity=debug
详细日志的输出太多了,无法打印,但重要的sn-p在最后:
HttpError: HttpError accessing <https://servicemanagement.googleapis.com/v1/services/myendpoints.endpoints.my-project-id.cloud.goog?alt=json>: response: <{'status': '403', 'content-length': '179', 'x-xss-protection': '1; mode=block', 'x-content-type-options': 'nosniff', 'transfer-encoding': 'chunked', 'vary': 'Origin, X-Origin, Referer', 'server': 'ESF', '-content-encoding': 'gzip', 'cache-control': 'private', 'date': 'Sun, 09 Apr 2017 22:55:53 GMT', 'x-frame-options': 'SAMEORIGIN', 'alt-svc': 'quic=":443"; ma=2592000; v="37,36,35"', 'content-type': 'application/json; charset=UTF-8'}>, content <{
"error": {
"code": 403,
"message": "Service 'myendpoints.endpoints.my-project-id.cloud.goog' not found or permission denied.",
"status": "PERMISSION_DENIED"
}
}
>
请注意,我的命令中的“my-project-id”已被替换,但此处仅出于说明目的而替换。
以前有没有人遇到过这个问题,如果有,是如何解决的? 我尝试过的事情:
这是我在项目之间交换时运行的命令:
> gcloud config set project <project-id>
> gcloud auth login
> gcloud auth application-default login
同样,创建任何其他资源都有效,只是 Google Cloud Endpoints 失败并出现 403。
我正在使用的地区是:“asia-northeast1-a”,我正在使用所有者帐户来执行这些任务。
【问题讨论】:
标签: google-compute-engine google-cloud-endpoints permission-denied