写入挂载文件系统时出现 OSError input/output 错误

OSError input/output error when writing to mounted filesystem

我已经创建了 Google 云存储桶并使用以下方法将其安装到我的虚拟机:
gcsfuse my-bucket /path/to/mount/point
当我键入 df -H 时,它被列为已安装的文件系统。
我有以下问题:

如果我使用 GCP Web 控制台将文件上传到存储桶,我可以从 VM 中看到它。但是,如果我尝试创建一个从 VM 到挂载文件系统的目录 mkdir /path/to/mount/point/test,它会显示:

mkdir: cannot create directory ‘/path/to/mount/point/test’: Input/output error

尝试使用以下命令,它会显示更多信息。

gcsfuse --foreground --debug_gcs --debug_http \
        --debug_fuse --debug_invariants \
        --key-file=/src/gcloud_service_account.json \
        my-bucket /path/to/mount/point

您可能会看到这样的错误信息

"code": 403, "message": "Access Not Configured. The API (Cloud Storage JSON API) is not enabled for your project. Please use the Google Developers Console to update your configuration."

如果是这样,您需要为此实例启用此 API。

我找到了原因。我按照其他人的建议启用了调试选项。谢谢你。不幸的是,日志并没有告诉我太多信息。幸运的是,我还有一个 VM,我在那里进行了测试,它工作正常(mount + read/write 到 bucket)。我知道它不是存储桶端的权限。 VM 是使用 "Allow default access" 创建的,它只读 "Storage"。我授予 read/write 存储权限。也可以指定 "Allow full access to all Cloud APIs",但如果不需要,最好不要授予所有权限。