【问题标题】:Setting correct permissions for gcloud storage firestore export为 gcloud storage firestore export 设置正确的权限
【发布时间】:2021-01-22 11:20:41
【问题描述】:

有人可以指出我在这里缺少什么吗?我有一个执行这段代码的云函数(按计划触发):

const client = new firestore.v1.FirestoreAdminClient()
const projectId = process.env.GCP_PROJECT || process.env.GCLOUD_PROJECT
const databaseName = client.databasePath(projectId, '(default)')
return client.exportDocuments({name: databaseName, outputUriPrefix: 'gs://BUCKET-NAME', collectionIds: [] })

并在日志中失败:

Error: 7 PERMISSION_DENIED: Service account does not have access to Google Cloud Storage file: /XXX-XXX.
Error details: SERV_ACCOUNT@appspot.gserviceaccount.com does not have storage.buckets.get access to the Google Cloud Storage bucket.

这就是该存储桶的权限设置方式(为了确认,我在大约一个小时前设置并保存了它 - 我刚刚重新打开编辑框以获取图像):

所以,据我所知,SERV_ACCOUNT@appspot.gserviceaccount.com 应该拥有对该存储桶的完全访问权限。但它声称没有。我错过了什么?

【问题讨论】:

    标签: google-cloud-firestore google-cloud-functions google-cloud-storage gcloud


    【解决方案1】:

    我想这是一个相当复杂的系统,但它非常令人沮丧。解决方案是删除该权限,保存它,然后再次添加。我猜互联网相当于更努力地按下按钮。那好吧。无论如何发布以防万一它对其他人有帮助。

    【讨论】:

      猜你喜欢
      • 2015-11-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-18
      • 2011-04-16
      • 1970-01-01
      • 2017-11-20
      相关资源
      最近更新 更多