【问题标题】:gcsfuse gives a Input/output error when reading or writing to mounted directory in dockergcsfuse 在 docker 中读取或写入挂载目录时出现输入/输出错误
【发布时间】:2016-04-19 05:00:05
【问题描述】:

我在 docker 容器(基本映像 centos7)中使用 gcsfuse,但无法读取或写入已挂载的目录。

我正在使用 gcsfuse 安装目录,如下所示:

[root@6c24c3a6cc28 /]# gcsfuse --foreground --key-file=/src/gcloud_service_account.json my-bucket /gcloud/
Using mount point: /gcloud
Opening GCS connection...
Opening bucket...
Mounting file system...
File system has been successfully mounted.

当我尝试读取或写入已安装的目录时,我收到此错误:
[root@6c24c3a6cc28 /]# ls -la /gcloud/ ls: 读取目录/gcloud/: 输入/输出错误 共 0

gcsfuse 打印出调试信息:

fuse: 2016/01/14 01:33:41.110260 *fuseops.ReadDirOp 错误:readAllEntries: ReadEntries: ListObjects: Get https://www.googleapis.com/storage/v1/b/my-bucket/o? delimiter=%2F&projection=full:私钥应该是 PEM 或普通 PKSC1 或 PKCS8;解析错误:asn1:结构错误:标签不匹配(16 vs {class:1 tag:27 length:123 isCompound:true}){optional:false explicit:false application:false defaultValue: tag: stringType:0 timeType: 0 set:false omitEmpty:false} pkcs1PrivateKey @2

我正在像这样运行 docker: docker run -p 3000:3000 \
--特权\ --cap-添加 SYS_ADMIN \ --设备/开发/保险丝\ --name gcsfuseTest \ gcsfuseImage

我不能 100% 确定 --cap-add SYS_ADMIN 和 --device /dev/fuse 能得到什么。我根据在 docker 上使用 fuse 安装的其他用户放置它们。

【问题讨论】:

    标签: docker fuse gcsfuse


    【解决方案1】:

    我可以通过在运行 gcsfuse 时打开一些调试标志来解决这个问题:

    gcsfuse --foreground --debug_gcs --debug_http --debug_fuse --debug_invariants --key-file=/src/gcloud_service_account.json dev-my-bucket /gcloud

    这返回了很多信息,以及:

    “代码”:403, "message": "未配置访问。您的项目未启用 API(Cloud Storage JSON API)。请使用 Google Developers Console 更新您的配置。"

    我在 Google 开发者控制台中启用了这个 API,几分钟后,vuala,它工作了。

    【讨论】:

    • 我有同样的初始错误,但遗憾的是没有这个代码。感谢您为我提供更多调试信息!
    猜你喜欢
    • 2016-07-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-31
    • 1970-01-01
    • 2013-11-02
    相关资源
    最近更新 更多