【问题标题】:s3fs -- bucket name contains illegal characters3fs -- 存储桶名称包含非法字符
【发布时间】:2020-10-29 04:16:32
【问题描述】:

我正在尝试将 S3 存储桶安装到我的 ubuntu 实例上。但我只想在 s3 存储桶中挂载一个“目录”或密钥。

桶名:s3://my-bucket/ 我要挂载的 s3 存储桶的目录或一部分:s3://my-bucket/test/ 挂载点:/path/to/mount/dir/

我正在使用 s3fs 来实现这一点:

 s3fs my-bucket/test/ /path/to/mount/dir 

但我一直收到以下错误: s3fs: BUCKET my-bucket/test/ -- 存储桶名称包含非法字符。

关于如何使用 s3fs 挂载 s3 存储桶的子目录有什么建议吗?

谢谢!

[CRT] s3fs_logger.cpp:LowSetLogLevel(203): change debug level from [CRT]to [INF]
[INF]     s3fs.cpp:set_mountpoint_attribute(3984): PROC(uid=1002, gid=1002) - MountPoint(uid=1002, gid=1002, mode=40777)
[INF] curl.cpp:InitMimeType(432): Loaded mime information from /etc/mime.types
[INF] fdcache_stat.cpp:CheckCacheFileStatTopDir(79): The path to cache top dir is empty, thus not need to check permission.
[INF] s3fs.cpp:s3fs_init(3295): init v1.87(commit:38e1eaa) with OpenSSL
[INF] s3fs.cpp:s3fs_check_service(3411): check services.
[INF]       curl.cpp:CheckBucket(3235): check a bucket.
[WAN] curl.cpp:ResetHandle(1875): The S3FS_CURLOPT_KEEP_SENDING_ON_ERROR option could not be set. For maximize performance you need to enable this option and you should use libcurl 7.51.0 or later.
[INF]       curl_util.cpp:prepare_url(243): URL is https://s3.amazonaws.com/my-bucket/test/
[INF]       curl_util.cpp:prepare_url(276): URL changed is https://my-bucket.s3.amazonaws.com/test/
[INF]       curl.cpp:insertV4Headers(2572): computing signature [GET] [/test/] [] []
[INF]       curl_util.cpp:url_to_host(320): url is https://s3.amazonaws.com
[ERR] curl.cpp:RequestPerform(2256): HTTP response code 400, returning EIO. Body Text: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AuthorizationHeaderMalformed</Code><Message>The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'ap-south-1'</Message><Region>ap-south-1</Region><RequestId>5366A05FF406855D</RequestId><HostId>KmvHCBnlvnNZI/g3F2p+NfS0vP1Niq0+OPCZAP9u0pCjTOvpYzXfAB9QMlgQlcei2oi+lihn7F8=</HostId></Error>
[ERR] curl.cpp:CheckBucket(3261): Check bucket failed, S3 response: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AuthorizationHeaderMalformed</Code><Message>The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'ap-south-1'</Message><Region>ap-south-1</Region><RequestId>5366A05FF406855D</RequestId><HostId>KmvHCBnlvnNZI/g3F2p+NfS0vP1Niq0+OPCZAP9u0pCjTOvpYzXfAB9QMlgQlcei2oi+lihn7F8=</HostId></Error>
[CRT] s3fs.cpp:s3fs_check_service(3444): Failed to connect region 'us-east-1'(default), so retry to connect region 'ap-south-1'.
[INF] curl_handlerpool.cpp:ReturnHandler(110): Pool full: destroy the oldest handler
[INF]       curl.cpp:CheckBucket(3235): check a bucket.
[INF]       curl_util.cpp:prepare_url(243): URL is https://s3-ap-south-1.amazonaws.com/my-bucket/test/
[INF]       curl_util.cpp:prepare_url(276): URL changed is https://my-bucket.s3-ap-south-1.amazonaws.com/test/
[INF]       curl.cpp:insertV4Headers(2572): computing signature [GET] [/test/] [] []
[INF]       curl_util.cpp:url_to_host(320): url is https://s3-ap-south-1.amazonaws.com
[INF]       curl.cpp:RequestPerform(2266): HTTP response code 404 was returned, returning ENOENT
[ERR] curl.cpp:CheckBucket(3261): Check bucket failed, S3 response: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>test/</Key><RequestId>FC8360185E0E5B79</RequestId><HostId>kwY8RPFw8d/6K9VL+cqc0KYDDgGVUVplbcvT+6PDBMvsdO0N53vQhfkfXRYzSQpy0sZ73f+er6o=</HostId></Error>
[CRT] s3fs.cpp:s3fs_check_service(3484): bucket not found(host=https://s3-ap-south-1.amazonaws.com) - result of checking service.
[ERR] s3fs.cpp:s3fs_exit_fuseloop(3285): Exiting FUSE event loop due to errors
[INF] s3fs.cpp:s3fs_destroy(3353): destroy

【问题讨论】:

    标签: s3fs


    【解决方案1】:

    尝试用冒号分隔存储桶名称和存储桶路径:

    s3fs my-bucket:/test /path/to/mount/dir
    

    s3fs 还要求存在目录对象才能挂载路径。您可以通过 AWS CLI 创建它:

    aws s3api put-object --bucket my-bucket --key test/
    

    【讨论】:

    • 不挂载。它没有抛出任何错误,但我没有看到挂载的目录
    • 请分享s3fs $BUCKET $PATH -f -d的输出
    • 正在编辑中!它找不到钥匙,但我肯定在桶里有那把钥匙。
    • s3fs 还要求存在目录对象才能挂载路径。请参阅编辑后的答案。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-12-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多