Joe*_*ery 1 google-cloud-platform google-cloud-functions google-iam
我正在一个Google Cloud项目中处理一系列Cloud Functions,由于某种原因,我突然收到此错误:
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'
Run Code Online (Sandbox Code Playgroud)
当我尝试运行修订的命令时,除了格式错误的错误响应(您不能拥有--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
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
The requested URL <code>/v1/projects/la-cloud-functions/serviceAccounts/projects/la-cloud-functions:getIamPolicy?alt=json</code> was not found on this server.
Run Code Online (Sandbox Code Playgroud)
最后,尝试通过控制台分配Cloud Functions Server Agent角色给了我另一个惊喜-该角色从列表中丢失了,应该在服务管理下:
我尝试通过使用以下命令重新启用Cloud Functions API来重置服务帐户:
gcloud services enable cloudfunctions.googleapis.com
但同样,没有成功。
任何人都对如何解决此问题并使Cloud Functions Service Agent角色再次可用有任何想法?
TIA-乔
请尝试以下步骤解决此问题:
禁用云功能API:
gcloud services disable cloudfunctions.googleapis.com --project la-cloud-functions
Run Code Online (Sandbox Code Playgroud)
等待约一分钟以完成禁用。
使用CLI或IAM下的GCP控制台删除云功能成员帐户。
gcloud projects remove-iam-policy-binding la-cloud-functions --member="serviceAccount:service-1092904037961@gcf-admin-robot.iam.gserviceaccount.com" --role="roles/cloudfunctions.serviceAgent"
Run Code Online (Sandbox Code Playgroud)
等一下 然后,验证该成员已在IAM下的GCP控制台中删除。
启用Cloud Functions API:
gcloud services enable cloudfunctions.googleapis.com --project la-cloud-functions
Run Code Online (Sandbox Code Playgroud)
返回GCP控制台。您应该找到一个新的Google Cloud Functions Service代理成员。
注意:
您使用错误的命令添加cloudfunctions.serviceAgent。这是正确的命令:
gcloud projects add-iam-policy-binding la-cloud-functions --member="serviceAccount:service-1092904037961@gcf-admin-robot.iam.gserviceaccount.com" --role="roles/cloudfunctions.serviceAgent"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
841 次 |
| 最近记录: |