简体   繁体   English

Firebase存储错误的云功能

[英]Cloud Functions for Firebase Storage Error

I am using Cloud Functions for Firebase and have had success uploading files to storage. 我将Cloud Functions用于Firebase,并成功将文件上传到存储。 But today I am getting this error 但是今天我得到这个错误

Caller does not have storage.objects.create access to bucket. 调用者没有storage.objects.create对存储区的访问权限。

Does this have something to do with my storage rules I have set up? 这与我设置的存储规则有关吗?

It's possible that the ACLs for your buckets aren't set up properly. 存储桶的ACL可能设置不正确。 We're working on ways to automagically fix them if we notice they're wrong, but it may take a little to roll that out. 如果我们发现它们有误,我们正在研究自动修复它们的方法,但可能需要花费一些时间才能推出。

In the mean time, install the latest Cloud SDK: https://cloud.google.com/sdk/docs/ and run these in your favorite terminal: 同时,安装最新的Cloud SDK: https//cloud.google.com/sdk/docs/并在您喜欢的终端中运行它们:

gsutil defacl ch -p viewers-<PROJECT-ID>:R gs://<BUCKET-ID>
gsutil defacl ch -p editors-<PROJECT-ID>:O gs://<BUCKET-ID>
gsutil defacl ch -p owners-<PROJECT-ID>:O gs://<BUCKET-ID>
gsutil -m acl -r ch -p owners-<PROJECT-ID>:O gs://<BUCKET-ID>
gsutil -m acl -r ch -p viewers-<PROJECT-ID>:R gs://<BUCKET-ID>
gsutil -m acl -r ch -p editors-<PROJECT-ID>:O gs://<BUCKET-ID>

It's likely you'll only need to run the top three to set the default ACLs, rather than the per object ACLs (as per the bottom three). 您可能只需要运行前三个来设置默认ACL,而不是每个对象的ACL(按照后三个)。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM