[GH-ISSUE #1203] Mounting non-AWS bucket? #638

Closed
opened 2026-03-04 01:47:26 +03:00 by kerem · 7 comments
Owner

Originally created by @RalfJung on GitHub (Nov 21, 2019).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/1203

We are hosting our own S3-compatible storage and I would like to use s3fs with that. Unfortunately, s3fs insists on connecting to Amazon, and I was unable to find any hint in the documentation how one would specify a different provider. I tried -o endpoint=OUR_SERVER to no avail, and I also tried using something like https://OUR_SERVER/BUCKET_NAME, which did not work either.

I am sure there is something very simple I am doing wrong here, but alas, I can't figure out what, and the docs I found so far are not helping either.

Additional Information

Version of s3fs being used (s3fs --version)

Amazon Simple Storage Service File System V1.80(commit:unknown) with GnuTLS(gcrypt)

Version of fuse being used (pkg-config --modversion fuse, rpm -qi fuse, dpkg -s fuse)

2.9.7-1+deb9u2

Kernel information (uname -r)

4.9.0-8-amd64

GNU/Linux Distribution, if applicable (cat /etc/os-release)

Debian GNU/Linux 9 (stretch)

s3fs command line used, if applicable

s3fs https://OUR_SERVER/fp-science-ci s3 -d -f

s3fs output

[CRT] s3fs.cpp:set_s3fs_log_level(253): change debug level from [CRT] to [INF] 
[INF]     s3fs.cpp:set_moutpoint_attribute(4151): PROC(uid=0, gid=0) - MountPoint(uid=0, gid=0, mode=40755)
[CRT] s3fs.cpp:s3fs_init(3334): init v1.80(commit:unknown) with GnuTLS(gcrypt)
[INF] s3fs.cpp:s3fs_check_service(3708): check services.
[INF]       curl.cpp:CheckBucket(2860): check a bucket.
[INF]       curl.cpp:prepare_url(4175): URL is http://s3.amazonaws.com/https//OUR_SERVER/fp-science-ci/
[INF]       curl.cpp:prepare_url(4207): URL changed is http://https.s3.amazonaws.com//OUR_SERVER/fp-science-ci/
[INF]       curl.cpp:insertV4Headers(2237): computing signature [GET] [//OUR_SERVER/fp-science-ci/] [] []

This is clearly nonsense, it is still using Amazon AWS.

Details about issue

Originally created by @RalfJung on GitHub (Nov 21, 2019). Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/1203 We are hosting our own S3-compatible storage and I would like to use s3fs with that. Unfortunately, s3fs insists on connecting to Amazon, and I was unable to find any hint in the documentation how one would specify a different provider. I tried `-o endpoint=OUR_SERVER` to no avail, and I also tried using something like `https://OUR_SERVER/BUCKET_NAME`, which did not work either. I am sure there is something very simple I am doing wrong here, but alas, I can't figure out what, and the docs I found so far are not helping either. ### Additional Information #### Version of s3fs being used (s3fs --version) _Amazon Simple Storage Service File System V1.80(commit:unknown) with GnuTLS(gcrypt)_ #### Version of fuse being used (pkg-config --modversion fuse, rpm -qi fuse, dpkg -s fuse) _2.9.7-1+deb9u2_ #### Kernel information (uname -r) _4.9.0-8-amd64_ #### GNU/Linux Distribution, if applicable (cat /etc/os-release) _Debian GNU/Linux 9 (stretch)_ #### s3fs command line used, if applicable ``` s3fs https://OUR_SERVER/fp-science-ci s3 -d -f ``` #### s3fs output ``` [CRT] s3fs.cpp:set_s3fs_log_level(253): change debug level from [CRT] to [INF] [INF] s3fs.cpp:set_moutpoint_attribute(4151): PROC(uid=0, gid=0) - MountPoint(uid=0, gid=0, mode=40755) [CRT] s3fs.cpp:s3fs_init(3334): init v1.80(commit:unknown) with GnuTLS(gcrypt) [INF] s3fs.cpp:s3fs_check_service(3708): check services. [INF] curl.cpp:CheckBucket(2860): check a bucket. [INF] curl.cpp:prepare_url(4175): URL is http://s3.amazonaws.com/https//OUR_SERVER/fp-science-ci/ [INF] curl.cpp:prepare_url(4207): URL changed is http://https.s3.amazonaws.com//OUR_SERVER/fp-science-ci/ [INF] curl.cpp:insertV4Headers(2237): computing signature [GET] [//OUR_SERVER/fp-science-ci/] [] [] ``` This is clearly nonsense, it is still using Amazon AWS. ### Details about issue
kerem closed this issue 2026-03-04 01:47:26 +03:00
Author
Owner

@RalfJung commented on GitHub (Nov 21, 2019):

I ended up looking at the source code and found the undocumented option -o host. That gets me a bit further, but it still does not list any files, strangely enough. But I see this in the syslog:

Nov 21 11:09:15 coop s3fs[6131]: s3fs.cpp:get_base_exp(2701): marker_xp->nodesetval is empty.
Nov 21 11:09:15 coop s3fs[6131]: s3fs.cpp:append_objects_from_xml_ex(2531): contents_xp->nodesetval is empty.
Nov 21 11:09:15 coop s3fs[6131]: s3fs.cpp:append_objects_from_xml_ex(2531): contents_xp->nodesetval is empty.
Nov 21 11:09:15 coop s3fs[6131]: s3fs.cpp:get_base_exp(2701): marker_xp->nodesetval is empty.
<!-- gh-comment-id:557013742 --> @RalfJung commented on GitHub (Nov 21, 2019): I ended up looking at the source code and found the undocumented option `-o host`. That gets me a bit further, but it still does not list any files, strangely enough. But I see this in the syslog: ``` Nov 21 11:09:15 coop s3fs[6131]: s3fs.cpp:get_base_exp(2701): marker_xp->nodesetval is empty. Nov 21 11:09:15 coop s3fs[6131]: s3fs.cpp:append_objects_from_xml_ex(2531): contents_xp->nodesetval is empty. Nov 21 11:09:15 coop s3fs[6131]: s3fs.cpp:append_objects_from_xml_ex(2531): contents_xp->nodesetval is empty. Nov 21 11:09:15 coop s3fs[6131]: s3fs.cpp:get_base_exp(2701): marker_xp->nodesetval is empty. ```
Author
Owner

@BattleMetalChris commented on GitHub (Nov 21, 2019):

You can use the 'url' option to point it at different places. -o url=

<!-- gh-comment-id:557040636 --> @BattleMetalChris commented on GitHub (Nov 21, 2019): You can use the 'url' option to point it at different places. -o url=<someURL>
Author
Owner

@RalfJung commented on GitHub (Nov 21, 2019):

@BattleMetalChris thanks, that also works, like -o host! (I had searched for "server" and "host", but not "url" it seems).

The folder remains empty though. I have by now done what I wanted to do using s3cmd instead, but it might still be useful to get s3fs to work as well.

<!-- gh-comment-id:557041553 --> @RalfJung commented on GitHub (Nov 21, 2019): @BattleMetalChris thanks, that also works, like `-o host`! (I had searched for "server" and "host", but not "url" it seems). The folder remains empty though. I have by now done what I wanted to do using `s3cmd` instead, but it might still be useful to get `s3fs` to work as well.
Author
Owner

@BattleMetalChris commented on GitHub (Nov 21, 2019):

You can use -o dbglevel=info -f -o curldbg to show the debug output as it tries to connect, that may show what the issue is.

<!-- gh-comment-id:557051779 --> @BattleMetalChris commented on GitHub (Nov 21, 2019): You can use -o dbglevel=info -f -o curldbg to show the debug output as it tries to connect, that may show what the issue is.
Author
Owner

@RalfJung commented on GitHub (Nov 21, 2019):

The connection looks fine, but getting the path does not work:

[INF] s3fs.cpp:s3fs_getattr(808): [path=/]
[INF] s3fs.cpp:s3fs_opendir(2237): [path=/][flags=100352]
[INF] s3fs.cpp:s3fs_readdir(2388): [path=/]
[INF]   s3fs.cpp:list_bucket(2433): [path=/]
[INF]       curl.cpp:ListBucketRequest(2906): [tpath=/]
[INF]       curl.cpp:prepare_url(4175): URL is https://SERVER/fp-science-ci?delimiter=/&max-keys=1000&prefix=
[INF]       curl.cpp:prepare_url(4207): URL changed is https://fp-science-ci.SERVER?delimiter=/&max-keys=1000&prefix=
[INF]       curl.cpp:insertV4Headers(2237): computing signature [GET] [/] [delimiter=/&max-keys=1000&prefix=] []
[INF]       curl.cpp:url_to_host(100): url is https://SERVER
* Rebuilt URL to: https://fp-science-ci.SERVER/?delimiter=/&max-keys=1000&prefix=
* Connection 1 seems to be dead!
* Closing connection 1
* Hostname fp-science-ci.SERVER was found in DNS cache
*   Trying IP...
* TCP_NODELAY set
* Connected to fp-science-ci.SERVER (IP) port 443 (#2)
* found 157 certificates in /etc/ssl/certs/ca-certificates.crt
* found 628 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL re-using session ID
* SSL connection using TLS1.2 / ECDHE_RSA_AES_256_GCM_SHA384
*        server certificate verification OK
*        server certificate status verification SKIPPED
*        common name: SERVER (matched)
*        server certificate expiration date OK
*        server certificate activation date OK
*        certificate public key: RSA
*        certificate version: #3
*        subject: ...
*        start date: Wed, 11 Jul 2018 15:12:34 GMT
*        expire date: Tue, 13 Oct 2020 15:12:34 GMT
*        issuer: ...
*        compression: NULL
* ALPN, server did not agree to a protocol
> GET /?delimiter=/&max-keys=1000&prefix= HTTP/1.1
host: fp-science-ci.SERVER
User-Agent: s3fs/1.80 (commit hash unknown; GnuTLS(gcrypt))
Accept: */*
REDACTED

< HTTP/1.1 200 OK
< Transfer-Encoding: chunked
< x-amz-request-id: tx00000000000000000c3f5-005dd680c2-683dfbd-default
< Content-Type: application/xml
< Date: Thu, 21 Nov 2019 12:19:14 GMT
< 
* Curl_http_done: called premature == 0
* Connection #2 to host fp-science-ci.SERVER left intact
[INF]       curl.cpp:RequestPerform(1910): HTTP response code 200
[ERR] s3fs.cpp:get_base_exp(2701): marker_xp->nodesetval is empty.
[WAN] s3fs.cpp:append_objects_from_xml_ex(2531): contents_xp->nodesetval is empty.
[WAN] s3fs.cpp:append_objects_from_xml_ex(2531): contents_xp->nodesetval is empty.
[ERR] s3fs.cpp:get_base_exp(2701): marker_xp->nodesetval is empty.

If I had to guess, the problem is likely that it uses the subdomain fp-science-ci.SERVER when really everything should just go through SERVER directly. (For s3cmd I had to set --host-bucket=SERVER.)

<!-- gh-comment-id:557061349 --> @RalfJung commented on GitHub (Nov 21, 2019): The connection looks fine, but getting the path does not work: ``` [INF] s3fs.cpp:s3fs_getattr(808): [path=/] [INF] s3fs.cpp:s3fs_opendir(2237): [path=/][flags=100352] [INF] s3fs.cpp:s3fs_readdir(2388): [path=/] [INF] s3fs.cpp:list_bucket(2433): [path=/] [INF] curl.cpp:ListBucketRequest(2906): [tpath=/] [INF] curl.cpp:prepare_url(4175): URL is https://SERVER/fp-science-ci?delimiter=/&max-keys=1000&prefix= [INF] curl.cpp:prepare_url(4207): URL changed is https://fp-science-ci.SERVER?delimiter=/&max-keys=1000&prefix= [INF] curl.cpp:insertV4Headers(2237): computing signature [GET] [/] [delimiter=/&max-keys=1000&prefix=] [] [INF] curl.cpp:url_to_host(100): url is https://SERVER * Rebuilt URL to: https://fp-science-ci.SERVER/?delimiter=/&max-keys=1000&prefix= * Connection 1 seems to be dead! * Closing connection 1 * Hostname fp-science-ci.SERVER was found in DNS cache * Trying IP... * TCP_NODELAY set * Connected to fp-science-ci.SERVER (IP) port 443 (#2) * found 157 certificates in /etc/ssl/certs/ca-certificates.crt * found 628 certificates in /etc/ssl/certs * ALPN, offering http/1.1 * SSL re-using session ID * SSL connection using TLS1.2 / ECDHE_RSA_AES_256_GCM_SHA384 * server certificate verification OK * server certificate status verification SKIPPED * common name: SERVER (matched) * server certificate expiration date OK * server certificate activation date OK * certificate public key: RSA * certificate version: #3 * subject: ... * start date: Wed, 11 Jul 2018 15:12:34 GMT * expire date: Tue, 13 Oct 2020 15:12:34 GMT * issuer: ... * compression: NULL * ALPN, server did not agree to a protocol > GET /?delimiter=/&max-keys=1000&prefix= HTTP/1.1 host: fp-science-ci.SERVER User-Agent: s3fs/1.80 (commit hash unknown; GnuTLS(gcrypt)) Accept: */* REDACTED < HTTP/1.1 200 OK < Transfer-Encoding: chunked < x-amz-request-id: tx00000000000000000c3f5-005dd680c2-683dfbd-default < Content-Type: application/xml < Date: Thu, 21 Nov 2019 12:19:14 GMT < * Curl_http_done: called premature == 0 * Connection #2 to host fp-science-ci.SERVER left intact [INF] curl.cpp:RequestPerform(1910): HTTP response code 200 [ERR] s3fs.cpp:get_base_exp(2701): marker_xp->nodesetval is empty. [WAN] s3fs.cpp:append_objects_from_xml_ex(2531): contents_xp->nodesetval is empty. [WAN] s3fs.cpp:append_objects_from_xml_ex(2531): contents_xp->nodesetval is empty. [ERR] s3fs.cpp:get_base_exp(2701): marker_xp->nodesetval is empty. ``` If I had to guess, the problem is likely that it uses the subdomain `fp-science-ci.SERVER` when really everything should just go through `SERVER` directly. (For s3cmd I had to set `--host-bucket=SERVER`.)
Author
Owner

@gaul commented on GitHub (Feb 3, 2020):

Please test with a more recent s3fs. 1.80 is several years old and 1.85 is the latest.

<!-- gh-comment-id:581285604 --> @gaul commented on GitHub (Feb 3, 2020): Please test with a more recent s3fs. 1.80 is several years old and 1.85 is the latest.
Author
Owner

@gaul commented on GitHub (Apr 22, 2020):

Please reopen if symptoms persist.

<!-- gh-comment-id:617749298 --> @gaul commented on GitHub (Apr 22, 2020): Please reopen if symptoms persist.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#638
No description provided.