gcloud 构建需要“serviceusage.services.use”,但我已经拥有所有者角色

问题描述 投票:0回答:3

我尝试在 gcloud CLI 中使用此命令提交构建:

gcloud builds submit --config cloudbuild.yaml .

但它返回此错误:

(gcloud.builds.submit) 禁止用户访问存储桶 [fastapi-api_cloudbuild]。请检查您组织的政策或 如果用户拥有“serviceusage.services.use”权限

我检查了 IAM 管理面板,它说我的帐户具有所有者角色并且我拥有大多数权限,并且我在 gcloud cli 中进行了身份验证,但我仍然收到所述错误,我没有尝试太多,因为我不知道什么我可以尝试一下,因为我已经担任了最高的角色。谢谢你。

gcloud google-cloud-iam
3个回答
1
投票

您是否已使用

gcloud config set project <project>
在 cli 中设置项目?

否则,此线程的答案可能会有所帮助(计费)。

或使用存储管理器


0
投票

我遇到了类似的问题(由计费帐户的更改引起),我通过禁用 Google Cloud Build API 并重新启用来修复它。

我使用了这个命令:

gcloud services disable cloudbuild.googleapis.com --project "my_project"

gcloud services enable cloudbuild.googleapis.com --project "my_project"


0
投票

我的情况是,我将 ACL(细粒度) 存储桶访问权限更改为统一。 并重新启动 GitHub 操作(无需更改代码)。 工作了。没有错误。日志会传输至 GitHub Actions。

© www.soinside.com 2019 - 2024. All rights reserved.