火箱功能:云存储触发器由于权限不足而无法工作
我有一个云功能,该功能是由对存储更新触发的。当我部署使用云存储的任何功能时,我将获得错误代码7和功能日志中的消息不足消息。
我尝试按照上面的页面上的建议,并将云功能服务代理授予我创建的一个帐户,称为< project_id>@appspot.gserviceaccount.com-我相信这是故障排除页面所含义的“运行时服务帐户”,例如这就是我在网上讨论的内容。我还给了它存储遗留存储桶所有者访问权限。
另外,我在网上找到的建议(例如此处和在这里)似乎已经过时了,因为它们对我不起作用或Invlove帐户命名格式不存在 - 我什至不确定是否如上所述创建一个新的服务帐户是正确的举动。
在我开发时,我的存储规则也完全打开:
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write;
}
}
}
所有其他功能都可以正常运行,因此,jsut可以使用存储,这是一个问题。如何授予正确的权限?
I have a cloud function that is triggered by updates to storage. when I deploy any function that utilises cloud storage, I get an error code 7 and an insufficient permissions message in the functions logs.
I have tried following the advice ont he above page and granted Cloud Functions Service Agent to an account I created called <PROJECT_ID>@appspot.gserviceaccount.com - I believe this is what the troubleshooting page means by "runtime service account", as that's what I've seen discussed online. I've also given it Storage Legacy Bucket Owner access.
Also the advice I've found online (like here and here) seems to be outdated as they did not work for me or invlove account naming formats that don't exist - I'm not even sure if creating a new service account as described above was the right move.
My storage rules are also completely open while I'm developing:
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write;
}
}
}
All other functions work fine, so it's jsut working with storage that's an issue. How do I grant the correct permissions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
crevulus试图使用:
storege.object()。桶('my_bucket_name')
将目录作为目录作为目录
通过 作为目录一个水桶,他试图访问不存在的GCP存储桶/资源。
解决方案是删除水桶部分并解决了问题。
crevulus was trying to access the bucket using:
storage.object().bucket('MY_BUCKET_NAME')
There was an error entering the bucket (He used the directory as the bucket name)
By using the directory as a bucket, he was trying to access a GCP bucket/resource that did not exist.
The solution was to remove the bucket part and that solved the problem.