我正在一个 Google Cloud 项目中处理一系列云功能,由于某种原因,我突然收到此错误:
Deployment failure:
Missing necessary permission resourcemanager.projects.getIamPolicy for service-1092904037961@gcf-admin-robot.iam.gserviceaccount.com on resource projects/la-cloud-functions. Please grant service-1092904037961@gcf-admin-robot.iam.gserviceaccount.com the Cloud Functions Service Agent role. You can do that by running 'gcloud iam service-accounts add-iam-policy-binding projects/la-cloud-functions --member=service-1092904037961@gcf-admin-robot.iam.gserviceaccount.com --role=Cloud Functions Service Agent'
除了格式错误的错误响应(你不能--role=Cloud Functions Service Agent
- 它应该是--role=roles/cloudfunctions.serviceAgent
),当我尝试运行修改后的命令时:
gcloud iam service-accounts add-iam-policy-binding projects/la-cloud-functions --member=service-1092904037961@gcf-admin-robot.iam.gserviceaccount.com --role=roles/cloudfunctions.serviceAgent
我收到此错误:
The requested URL <code>/v1/projects/la-cloud-functions/serviceAccounts/projects/la-cloud-functions:getIamPolicy?alt=json</code> was not found on this server.
最后,尝试通过控制台分配 Cloud Functions 服务器代理角色给了我另一个惊喜 - 列表中缺少该角色,它应该在服务管理下:
我尝试通过使用以下命令重新启用 Cloud Functions API 来重置服务帐户:
gcloud services enable cloudfunctions.googleapis.com
但同样,没有成功。
有人对如何解决此问题并使 Cloud Functions 服务代理角色再次可用有任何想法吗?
TIA-乔