【发布时间】:2021-12-09 19:30:16
【问题描述】:
我正在使用具有公共访问权限的 Google Cloud Storage 的 gcsfuse。
当我尝试使用命令 (gcsfuse -o allow_other --implicit-dirs bucket-name /mnt/my_directory) 挂载存储时,我可以看到以下消息。
2021/10/22 09:08:46.859250 Using mount point: /mnt/my_directory
2021/10/22 09:08:46.876966 Opening GCS connection...
2021/10/22 09:08:47.408667 Mounting file system "bucket-name"...
2021/10/22 09:08:47.410248 File system has been successfully mounted.
但在那之后,当我尝试将我的文件存储在挂载目录中时,出现如下错误。
[ERROR] Error executing an HTTP request: HTTP response code 403 with body '{
"error": {
"code": 403,
"message": "Provided scope(s) are not authorized",
"errors": [
{
"message": "Provided scope(s) are not authorized",
"domain": "global",
"reason": "forbidden"
}
]
}
}
'
when initiating an upload to gs://my_bucket/static/dir/1211/53714/
我该如何解决这个问题? 3天前还好好的,突然就不行了,好尴尬。
【问题讨论】:
-
从错误消息中,它看起来与您正在使用的客户端的the auth scopes 相关,而不是对您上传到的存储桶的授权访问。您如何为 GCSfuse 创建凭据?确保包含
https://www.googleapis.com/auth/cloud-platform范围。 -
如果您在 Compute Engine 上运行此功能,则默认范围会禁用 Cloud Storage 写入。编辑您的实例并启用写入。这需要停止 VM 实例才能进行此更改。
-
@JohnHanley 我解决了问题。我检查了 k8s 节点池的范围。他们没有云存储写入权限。当我修复它时,我解决了问题。谢谢。
标签: google-cloud-platform google-cloud-storage cloud mount gcsfuse