简体   繁体   English

部署 Gen2 云时出现权限被拒绝错误 Function

[英]Permission Denied Error while deploying Gen2 Cloud Function

We have developed a cloud function based on given requirements and did initial verification with 1st Gen and it went fine.我们根据给定的要求开发了一个云 function,并用第一代进行了初步验证,结果很好。 But there were few modifications required which required additional processing time.但是需要额外处理时间的修改很少。 Hence we had to switch to --gen2因此我们不得不切换到 --gen2

Below is gcloud function deploy command.下面是 gcloud function 部署命令。

gcloud functions deploy gen2-function \
    --entry-point gen2 --runtime python37 --trigger-http --allow-unauthenticated \
    --service-account=<> --region=<> --project=<> --timeout=3600s --gen2

This command deploys the function and internally cloud run service successfully, but it fails in the end with below error此命令部署 function 和内部云运行服务成功,但最终失败并出现以下错误

[INFO] A new revision will be deployed serving with 100% traffic.
ERROR: (gcloud.functions.deploy) PERMISSION_DENIED: Permission 'run.services.setIamPolicy' denied on resource 'projects/<project>/locations/<region>/services/gen2-function' (or resource may not exist).

When we checked on cloud run, service name "gen2-function" does exist.当我们检查云运行时,服务名称“gen2-function”确实存在。

Can someone guide on this?有人可以指导吗?

The account deploying the function is missing the permission run.services.setIamPolicy .部署 function 的账户缺少run.services.setIamPolicy权限。 That permission is required to specify the command argument --allow-unauthenticated .指定命令参数--allow-unauthenticated需要该权限。

That permission is in the role roles/run.admin .该权限位于角色roles/run.admin中。

Refer to this documentation on how to add a role to the account:有关如何将角色添加到帐户的信息,请参阅此文档:

Grant a single role using the GUI 使用 GUI 授予单个角色

Grant or revoke multiple roles 授予或撤销多个角色

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 云 Function 部署 gen2 - function 已经存在错误? - Cloud Function deploy gen2 - function already exist error? firebase 路由上 golang 中的 google cloud function gen2 的身份验证问题 - Authentication problem with google cloud function gen2 in golang on firebase routing Firebase 云功能:部署 function 时出错 - Firebase Cloud Functions: Error while deploying function 部署第一代云函数时获取 function.js 不存在错误 - Getting function.js does not exist error when deploying 1st gen cloud function 部署时如何解决 GCP Cloud Function (Gen2) 缺少端口的问题? - How to fix missing port issue with GCP Cloud Function (Gen2) when deployed? ADLS Gen2 操作因以下原因失败:发送请求时发生错误。 用户错误 2011 - ADLS Gen2 operation failed for: An error occurred while sending the request. User error 2011 从云调度程序调用谷歌云 function 时获取权限被拒绝错误 - Getting permission denied error when calling Google cloud function from Cloud scheduler Cloud Run - 部署时出现“./mvnw: permission denied”错误 - Cloud Run - "./mvnw: permission denied" error on deployment 从 GitLab CI 将应用程序部署到 App Engine 时权限被拒绝 - Permission denied while deploying an app to App Engine from GitLab CI 在 Google 云上部署 django 应用程序时出错“google.api_core.exceptions.PermissionDenied: 403 Permission denied on resource project” - Error in deploying django app on Google cloud "google.api_core.exceptions.PermissionDenied: 403 Permission denied on resource project "
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM