mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2026-04-25 05:16:00 +03:00
[GH-ISSUE #2151] Issue mounting with prefix and federation token #1098
Labels
No labels
bug
bug
dataloss
duplicate
enhancement
feature request
help wanted
invalid
need info
performance
pull-request
question
question
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/s3fs-fuse#1098
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nchaly on GitHub (Apr 19, 2023).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/2151
Additional Information
Version of s3fs being used (
s3fs --version)Amazon Simple Storage Service File System V1.91 (commit:c4f95f1) with OpenSSL
(manually built from master).
Version of fuse being used (
pkg-config --modversion fuse,rpm -qi fuseordpkg -s fuse)2.9.9
Kernel information (
uname -r)5.19.0-1022-aws
GNU/Linux Distribution, if applicable (
cat /etc/os-release)PRETTY_NAME="Ubuntu 22.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.2 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
Details about issue
Scenario: one of our services issues to clients federation tokens to access specified prefix ("folder"). Credentials consists of key id, key, session token, and limit access only to specified prefix for certain amount of time.
Client mounts specified prefix with the command:
Credentials are passed via environment. Result is that bucket is not mounted. Checking s3fs logfiles shows the following sequence of requests (with retry added in https://github.com/s3fs-fuse/s3fs-fuse/pull/2087 ):
(detailed logs below).
Note that using the same credentials, the
aws s3 ls ${BUCKET}${PREFIX}returns list of files correctly.So the question is - is there something wrong with my scenario or permissions?
Otherwise - does this second retry with prefix work as expected? Because it does not match S3 api methods:
s3fs logs (grep s3fs /var/log/syslog) (shortened):
Just in case, permissions used for the role:
@nchaly commented on GitHub (Apr 21, 2023):
An update: probably this is by design. Here is what it says in the code:
So it looks like it fails by design (but does not state this explicitly).
The question is that this approach does not look reasonable, especially in read-only scenarios. It may be because I am not really aware about specifics of "folder objects" usage -- but before s3fs had been working rather fine for me in scenarios, where the whole bucket is being used, and no directories had been made by s3fs.
I've added a rather clumsy commit -
github.com/nchaly/s3fs-fuse@5670dd9dab- which does what I need in principle.In fact the check "make sure remote mountpath exists and is a directory" - https://github.com/s3fs-fuse/s3fs-fuse/blob/master/src/s3fs.cpp#L4379 - may be relaxed a little, and just make sure the key does not exist.
Are there scenarios that actually require that s3 mountpath is a "folder object"?
@ggtakec commented on GitHub (May 4, 2023):
@nchaly I'm sorry for my late reply.
I believe your code is working correctly.
I made #2153 based on that.
The difference between them is that they take advantage of the
compat_diroption that s3fs already has.Try using the code from that PR and specifying the
compat_diroption to mount the directory in error.I think it works fine.
If there are no problems, I will merge it.
Thanks in advance for your assistance.
@ggtakec commented on GitHub (May 7, 2023):
#2153 has been merged, so I'm closing this issue.
If you still have problems, please reopen.