mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2026-04-25 21:35:58 +03:00
[GH-ISSUE #2022] A subdirectory is not accessible just after mounting S3 bucket #1015
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#1015
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 @Mage152 on GitHub (Aug 12, 2022).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/2022
Additional Information
The following information is very important in order to help us to help you. Omission of the following details may delay your support request or receive no attention at all.
Keep in mind that the commands we provide to retrieve information are oriented to GNU/Linux Distributions, so you could need to use others if you use s3fs on macOS or BSD
Version of s3fs being used (s3fs --version)
Version of fuse being used (pkg-config --modversion fuse, rpm -qi fuse, dpkg -s fuse)
Kernel information (uname -r)
GNU/Linux Distribution, if applicable (cat /etc/os-release)
s3fs command line used, if applicable
/etc/fstab entry, if applicable
s3fs syslog messages (grep s3fs /var/log/syslog, journalctl | grep s3fs, or s3fs outputs)
I specified into /etc/fstab the options
Details about issue
Just after mount /s3/my_directory directory, the following command does not work
It works, if I do this:
When it works, I get this into the /var/log/s3fs.log file
When it does not work, I get this into the /var/log/s3fs.log file
Is somebody can tell me why I cannot access to the /s3/my_directory/DATA/SUBDIR/ directory just after mount /s3/my_directory directory?
Thanks for your help!
@ggtakec commented on GitHub (Aug 14, 2022):
Are the
DATA/VISION1/***files uploaded from other than s3fs?If a file is uploaded under a directory path that does not exist using the aws command, etc., the directory may not be visible from s3fs.
For example, if you upload
myfileunder the directorynodir(<bucket>/nodir/myfile), the files in the directory cannot be listed because there is no stat information for thenodirdirectory.A workaround is to access the file directly. (e.g.
ls nodir/myfile)Alternatively, update the stat information of the directory so that the directory has stat information that s3fs can recognize. (e.g.
touch nodir)I'll try to fix this issue so that it can be listed by specifying options.
(There is a
compat_diroption in the code of the master branch. I will modify it so that even if the stat of the directory does not exist when this option is specified, it will be listed.)@Mage152 commented on GitHub (Aug 16, 2022):
Thank you for your reply ggtakec !
Here is the test you ask me to do.
If I try to list file.tar immediately after mount, I cannot access to the file.
But, if I list DATA directory, I can access to file.tar once again.
I still don't understand what happen.
@ggtakec commented on GitHub (Aug 16, 2022):
Thanks for the detailed information.
Maybe your condition is the same as the cause I mentioned.
As a directory, s3fs needs an object (
<dirname>/) to get its attributes.However, if you directly upload files under a directory using the aws command, the object in that directory does not exist.
In your case there is a
DATA/SUBDIR/file.tarobject, but noDATA/orDATA/SUBDIR/objects.I think this can be worked around by specifying the compat_dir option once the code currently in PR is merged.
(still subject to change if this PR gets merged or not)
@Mage152 commented on GitHub (Aug 19, 2022):
The issue is due to the presence of two S3 objects with the same name:
This is possible since those two objects have two different keys, one with a trailing / and the other without.
When s3fuse try to access to a file in the SUBDIR directory, it tests all the hierarchy. During this test, s3fuse see that SUBDIR is also a file and stop.
For SUBDIR, we find 2 objects !
The solution is to rename SUBDIR file
$ aws s3 mv s3://my_bucket/DATA/SUBDIR s3://my_bucket/DATA/SUBDIR.fileThanks a lot @ggtakec for your help !
@ggtakec commented on GitHub (Aug 20, 2022):
@Mage152 Thanks for contacting me about the detailed cause.
We can certainly expect problems with s3fs if there is a file with the same name as the directory.
s3fs in its modification history has seen
DIRas a directory object in the past, and keep a compatibility code as failsafe now.Also, in your case you also have a
DIR/object (I thinkDIR/takes precedence) and I think you had a behavioral problem.Thank you again for your kindness.