[GH-ISSUE #1629] Can't mount s3 bucket #858

Closed
opened 2026-03-04 01:49:25 +03:00 by kerem · 3 comments
Owner

Originally created by @waffles333 on GitHub (Apr 21, 2021).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/1629

Additional Information

I am using s3fs to mount an s3 bucket to my filesystem and it never seems to complete. I never get any errors either. I turned up as much debug as I could and will paste it below

Sorry, I had to strip out some things like region and ip's

Here's the command I am running
s3fs mybucket /mnt/s3fs/ -o passwd_file=/usr/home/myname/.passwd-s3fs -o url=https://s3.<region>.amazonaws.com -o endpoint=<region> -o dbglevel=debug -f -o curldbg -d

Here's my output

root@server:/mnt> s3fs mybucket /mnt/s3fs/ -o passwd_file=/usr/home/myname/.passwd-s3fs -o url=https://s3.<region>.amazonaws.com -o endpoint=<region> -o dbglevel=debug -f -o curldbg -d
[CRT] s3fs.cpp:set_s3fs_log_level(253): change debug level from [CRT] to [DBG]
[INF]     s3fs.cpp:set_moutpoint_attribute(4151): PROC(uid=0, gid=0) - MountPoint(uid=0, gid=0, mode=40750)
FUSE library version: 2.9.2
nullpath_ok: 0
nopath: 0
utime_omit_ok: 0
unique: 1, opcode: INIT (26), nodeid: 0, insize: 56, pid: 0
INIT: 7.22
flags=0x0000f7fb
max_readahead=0x00020000
[CRT] s3fs.cpp:s3fs_init(3334): init v1.80(commit:unknown) with OpenSSL
[INF] s3fs.cpp:s3fs_check_service(3708): check services.
[INF]       curl.cpp:CheckBucket(2860): check a bucket.
[DBG] curl.cpp:GetHandler(272): Get handler from pool: 31
[INF]       curl.cpp:prepare_url(4175): URL is https://s3.<region>.amazonaws.com/mybucket/
[INF]       curl.cpp:prepare_url(4207): URL changed is https://mybucket.s3.<region>.amazonaws.com/
[INF]       curl.cpp:insertV4Headers(2237): computing signature [GET] [/] [] []
[INF]       curl.cpp:url_to_host(100): url is https://s3.<region>.amazonaws.com
[DBG] curl.cpp:RequestPerform(1893): connecting to URL https://mybucket.s3.<region>.amazonaws.com/
* About to connect() to mybucket.s3.<region>.amazonaws.com port 443 (#0)
*   Trying <ip>...
* Connected to mybucket.s3.<region>.amazonaws.com (<ip>) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* SSL connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate:
*       subject: CN=*.s3-<region>.amazonaws.com,O="Amazon.com, Inc.",L=Seattle,ST=Washington,C=US
*       start date: Aug 28 00:00:00 2020 GMT
*       expire date: Sep 02 12:00:00 2021 GMT
*       common name: *.s3-<region>.amazonaws.com
*       issuer: <issuer>
> GET / HTTP/1.1
User-Agent: s3fs/1.80 (commit hash unknown; OpenSSL)
Accept: */*
Authorization: <auth stuff>, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=<signature>
host: mybucket.s3.<region>.amazonaws.com
x-amz-content-sha256: <sha256>
x-amz-date: 20210421T195006Z

< HTTP/1.1 200 OK
< x-amz-id-2: <id2>
< x-amz-request-id: <req id>
< Date: Wed, 21 Apr 2021 19:50:07 GMT
< x-amz-bucket-region: <region>
< Content-Type: application/xml
< Transfer-Encoding: chunked
< Server: AmazonS3
<
* Connection #0 to host mybucket.s3.<region>.amazonaws.com left intact
[INF]       curl.cpp:RequestPerform(1910): HTTP response code 200
[DBG] curl.cpp:ReturnHandler(295): Return handler to pool: 31
   INIT: 7.19
   flags=0x00000019
   max_readahead=0x00020000
   max_write=0x00020000
   max_background=0
   congestion_threshold=0
   unique: 1, success, outsize: 40
unique: 2, opcode: GETXATTR (22), nodeid: 1, insize: 68, pid: 3166
getxattr / security.capability 24
[INF] s3fs.cpp:s3fs_getxattr(3072): [path=/][name=security.capability][value=0x7f1eb80008c0][size=24]
[DBG] s3fs.cpp:check_parent_object_access(665): [path=/]
[DBG] s3fs.cpp:get_object_attribute(405): [path=/]
   unique: 2, error: -61 (No data available), outsize: 16
unique: 3, opcode: STATFS (17), nodeid: 1, insize: 40, pid: 3166
statfs /
   unique: 3, success, outsize: 96
unique: 4, opcode: GETXATTR (22), nodeid: 1, insize: 68, pid: 3280
getxattr / security.capability 24
[INF] s3fs.cpp:s3fs_getxattr(3072): [path=/][name=security.capability][value=0x7f1eb8001ff0][size=24]
[DBG] s3fs.cpp:check_parent_object_access(665): [path=/]
[DBG] s3fs.cpp:get_object_attribute(405): [path=/]
   unique: 4, error: -61 (No data available), outsize: 16
unique: 5, opcode: STATFS (17), nodeid: 1, insize: 40, pid: 3280
statfs /
   unique: 5, success, outsize: 96

It just repeats the following indefinitely. I let it go for 3 hours earlier today

statfs /
   unique: 5, success, outsize: 96
unique: 6, opcode: GETXATTR (22), nodeid: 1, insize: 68, pid: 3369
getxattr / security.capability 24
[INF] s3fs.cpp:s3fs_getxattr(3072): [path=/][name=security.capability][value=0x7f1eb8001ff0][size=24]
[DBG] s3fs.cpp:check_parent_object_access(665): [path=/]
[DBG] s3fs.cpp:get_object_attribute(405): [path=/]
   unique: 6, error: -61 (No data available), outsize: 16
unique: 7, opcode: STATFS (17), nodeid: 1, insize: 40, pid: 3369
statfs /
   unique: 7, success, outsize: 96
unique: 8, opcode: GETXATTR (22), nodeid: 1, insize: 68, pid: 3409
getxattr / security.capability 24
[INF] s3fs.cpp:s3fs_getxattr(3072): [path=/][name=security.capability][value=0x7f1ec01634d0][size=24]
[DBG] s3fs.cpp:check_parent_object_access(665): [path=/]
[DBG] s3fs.cpp:get_object_attribute(405): [path=/]
   unique: 8, error: -61 (No data available), outsize: 16
unique: 9, opcode: STATFS (17), nodeid: 1, insize: 40, pid: 3409
statfs /
   unique: 9, success, outsize: 96

Version of s3fs being used (s3fs --version)

1.80

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

2.9.2

Kernel information (uname -r)

3.10.0-957.5.1.el7.x86_64

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

NAME="Red Hat Enterprise Linux Server"
VERSION="7.6 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.6"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.6 (Maipo)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.6:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.6
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.6"

Originally created by @waffles333 on GitHub (Apr 21, 2021). Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/1629 ### Additional Information I am using s3fs to mount an s3 bucket to my filesystem and it never seems to complete. I never get any errors either. I turned up as much debug as I could and will paste it below Sorry, I had to strip out some things like region and ip's **Here's the command I am running** `s3fs mybucket /mnt/s3fs/ -o passwd_file=/usr/home/myname/.passwd-s3fs -o url=https://s3.<region>.amazonaws.com -o endpoint=<region> -o dbglevel=debug -f -o curldbg -d` **Here's my output** ``` root@server:/mnt> s3fs mybucket /mnt/s3fs/ -o passwd_file=/usr/home/myname/.passwd-s3fs -o url=https://s3.<region>.amazonaws.com -o endpoint=<region> -o dbglevel=debug -f -o curldbg -d [CRT] s3fs.cpp:set_s3fs_log_level(253): change debug level from [CRT] to [DBG] [INF] s3fs.cpp:set_moutpoint_attribute(4151): PROC(uid=0, gid=0) - MountPoint(uid=0, gid=0, mode=40750) FUSE library version: 2.9.2 nullpath_ok: 0 nopath: 0 utime_omit_ok: 0 unique: 1, opcode: INIT (26), nodeid: 0, insize: 56, pid: 0 INIT: 7.22 flags=0x0000f7fb max_readahead=0x00020000 [CRT] s3fs.cpp:s3fs_init(3334): init v1.80(commit:unknown) with OpenSSL [INF] s3fs.cpp:s3fs_check_service(3708): check services. [INF] curl.cpp:CheckBucket(2860): check a bucket. [DBG] curl.cpp:GetHandler(272): Get handler from pool: 31 [INF] curl.cpp:prepare_url(4175): URL is https://s3.<region>.amazonaws.com/mybucket/ [INF] curl.cpp:prepare_url(4207): URL changed is https://mybucket.s3.<region>.amazonaws.com/ [INF] curl.cpp:insertV4Headers(2237): computing signature [GET] [/] [] [] [INF] curl.cpp:url_to_host(100): url is https://s3.<region>.amazonaws.com [DBG] curl.cpp:RequestPerform(1893): connecting to URL https://mybucket.s3.<region>.amazonaws.com/ * About to connect() to mybucket.s3.<region>.amazonaws.com port 443 (#0) * Trying <ip>... * Connected to mybucket.s3.<region>.amazonaws.com (<ip>) port 443 (#0) * Initializing NSS with certpath: sql:/etc/pki/nssdb * CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none * SSL connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 * Server certificate: * subject: CN=*.s3-<region>.amazonaws.com,O="Amazon.com, Inc.",L=Seattle,ST=Washington,C=US * start date: Aug 28 00:00:00 2020 GMT * expire date: Sep 02 12:00:00 2021 GMT * common name: *.s3-<region>.amazonaws.com * issuer: <issuer> > GET / HTTP/1.1 User-Agent: s3fs/1.80 (commit hash unknown; OpenSSL) Accept: */* Authorization: <auth stuff>, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=<signature> host: mybucket.s3.<region>.amazonaws.com x-amz-content-sha256: <sha256> x-amz-date: 20210421T195006Z < HTTP/1.1 200 OK < x-amz-id-2: <id2> < x-amz-request-id: <req id> < Date: Wed, 21 Apr 2021 19:50:07 GMT < x-amz-bucket-region: <region> < Content-Type: application/xml < Transfer-Encoding: chunked < Server: AmazonS3 < * Connection #0 to host mybucket.s3.<region>.amazonaws.com left intact [INF] curl.cpp:RequestPerform(1910): HTTP response code 200 [DBG] curl.cpp:ReturnHandler(295): Return handler to pool: 31 INIT: 7.19 flags=0x00000019 max_readahead=0x00020000 max_write=0x00020000 max_background=0 congestion_threshold=0 unique: 1, success, outsize: 40 unique: 2, opcode: GETXATTR (22), nodeid: 1, insize: 68, pid: 3166 getxattr / security.capability 24 [INF] s3fs.cpp:s3fs_getxattr(3072): [path=/][name=security.capability][value=0x7f1eb80008c0][size=24] [DBG] s3fs.cpp:check_parent_object_access(665): [path=/] [DBG] s3fs.cpp:get_object_attribute(405): [path=/] unique: 2, error: -61 (No data available), outsize: 16 unique: 3, opcode: STATFS (17), nodeid: 1, insize: 40, pid: 3166 statfs / unique: 3, success, outsize: 96 unique: 4, opcode: GETXATTR (22), nodeid: 1, insize: 68, pid: 3280 getxattr / security.capability 24 [INF] s3fs.cpp:s3fs_getxattr(3072): [path=/][name=security.capability][value=0x7f1eb8001ff0][size=24] [DBG] s3fs.cpp:check_parent_object_access(665): [path=/] [DBG] s3fs.cpp:get_object_attribute(405): [path=/] unique: 4, error: -61 (No data available), outsize: 16 unique: 5, opcode: STATFS (17), nodeid: 1, insize: 40, pid: 3280 statfs / unique: 5, success, outsize: 96 ``` It just repeats the following indefinitely. I let it go for 3 hours earlier today ``` statfs / unique: 5, success, outsize: 96 unique: 6, opcode: GETXATTR (22), nodeid: 1, insize: 68, pid: 3369 getxattr / security.capability 24 [INF] s3fs.cpp:s3fs_getxattr(3072): [path=/][name=security.capability][value=0x7f1eb8001ff0][size=24] [DBG] s3fs.cpp:check_parent_object_access(665): [path=/] [DBG] s3fs.cpp:get_object_attribute(405): [path=/] unique: 6, error: -61 (No data available), outsize: 16 unique: 7, opcode: STATFS (17), nodeid: 1, insize: 40, pid: 3369 statfs / unique: 7, success, outsize: 96 unique: 8, opcode: GETXATTR (22), nodeid: 1, insize: 68, pid: 3409 getxattr / security.capability 24 [INF] s3fs.cpp:s3fs_getxattr(3072): [path=/][name=security.capability][value=0x7f1ec01634d0][size=24] [DBG] s3fs.cpp:check_parent_object_access(665): [path=/] [DBG] s3fs.cpp:get_object_attribute(405): [path=/] unique: 8, error: -61 (No data available), outsize: 16 unique: 9, opcode: STATFS (17), nodeid: 1, insize: 40, pid: 3409 statfs / unique: 9, success, outsize: 96 ``` #### Version of s3fs being used (s3fs --version) 1.80 #### Version of fuse being used (pkg-config --modversion fuse, rpm -qi fuse, dpkg -s fuse) 2.9.2 #### Kernel information (uname -r) 3.10.0-957.5.1.el7.x86_64 #### GNU/Linux Distribution, if applicable (cat /etc/os-release) NAME="Red Hat Enterprise Linux Server" VERSION="7.6 (Maipo)" ID="rhel" ID_LIKE="fedora" VARIANT="Server" VARIANT_ID="server" VERSION_ID="7.6" PRETTY_NAME="Red Hat Enterprise Linux Server 7.6 (Maipo)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:redhat:enterprise_linux:7.6:GA:server" HOME_URL="https://www.redhat.com/" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7" REDHAT_BUGZILLA_PRODUCT_VERSION=7.6 REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" REDHAT_SUPPORT_PRODUCT_VERSION="7.6"
kerem closed this issue 2026-03-04 01:49:25 +03:00
Author
Owner

@waffles333 commented on GitHub (Apr 22, 2021):

checked /var/logs/messages
and found this a bunch of times:
Apr 21 16:05:20 2021 lz01 CloudWatch-PutInstanceData: No IAM role is associated with this EC2 instance.

Seems related. It is looking like I might need to create a new IAM role with access to my s3 bucket and assign that role to my EC2. Strange that I am not seeing any sort of "permission denied" messages though

<!-- gh-comment-id:824793504 --> @waffles333 commented on GitHub (Apr 22, 2021): checked /var/logs/messages and found this a bunch of times: `Apr 21 16:05:20 2021 lz01 CloudWatch-PutInstanceData: No IAM role is associated with this EC2 instance.` Seems related. It is looking like I might need to create a new IAM role with access to my s3 bucket and assign that role to my EC2. Strange that I am not seeing any sort of "permission denied" messages though
Author
Owner

@waffles333 commented on GitHub (Apr 22, 2021):

it looks like the bucket is mounted, I just don't have perms to read/write to it now

here's my latest command: s3fs mybucket /mnt/s3fs/ -o passwd_file=/etc/passwd-s3fs -o url=https://s3.<region>.amazonaws.com -o endpoint=<region> -opublic_bucket=1,use_sse=1,allow_other,mp_umask=0077,umask=0077,uid=0,gid=0 -o iam_role=auto -o dbglevel=debug -f -o curldbg -d -s

root@lz01:/usr/home/myuser> df -h | grep s3fs
s3fs                                        256T     0  256T   0% /mnt/s3fs
root@lz01:/usr/home/myuser> ls /mnt/s3fs/
ls: reading directory /mnt/s3fs/: Operation not permitted
<!-- gh-comment-id:824889453 --> @waffles333 commented on GitHub (Apr 22, 2021): it looks like the bucket is mounted, I just don't have perms to read/write to it now here's my latest command: `s3fs mybucket /mnt/s3fs/ -o passwd_file=/etc/passwd-s3fs -o url=https://s3.<region>.amazonaws.com -o endpoint=<region> -opublic_bucket=1,use_sse=1,allow_other,mp_umask=0077,umask=0077,uid=0,gid=0 -o iam_role=auto -o dbglevel=debug -f -o curldbg -d -s` ``` root@lz01:/usr/home/myuser> df -h | grep s3fs s3fs 256T 0 256T 0% /mnt/s3fs root@lz01:/usr/home/myuser> ls /mnt/s3fs/ ls: reading directory /mnt/s3fs/: Operation not permitted ```
Author
Owner

@waffles333 commented on GitHub (Apr 22, 2021):

I now have the bucket mounted and can read/write to it properly. The issue was that I needed to add an access policy to it

{
    "Version": "2012-10-17",
    "Id": "test-policy",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": "*",
            "Action": [
                "s3:DeleteObject",
                "s3:GetObject",
                "s3:PutObject"
            ],
            "Resource": "arn:aws:s3:::mybucket/*"
        },
        {
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:ListBucket",
            "Resource": "arn:aws:s3:::mybucket"
        }
    ]
}
<!-- gh-comment-id:825084353 --> @waffles333 commented on GitHub (Apr 22, 2021): I now have the bucket mounted and can read/write to it properly. The issue was that I needed to add an access policy to it ``` { "Version": "2012-10-17", "Id": "test-policy", "Statement": [ { "Effect": "Allow", "Principal": "*", "Action": [ "s3:DeleteObject", "s3:GetObject", "s3:PutObject" ], "Resource": "arn:aws:s3:::mybucket/*" }, { "Effect": "Allow", "Principal": "*", "Action": "s3:ListBucket", "Resource": "arn:aws:s3:::mybucket" } ] } ```
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#858
No description provided.