mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2026-04-25 21:35:58 +03:00
[GH-ISSUE #1973] Some Nested Directories Are Inaccessible #997
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#997
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 @evanlalo on GitHub (Jun 29, 2022).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/1973
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)
1.91Version of fuse being used (pkg-config --modversion fuse, rpm -qi fuse, dpkg -s fuse)
2.9.4Kernel information (uname -r)
4.14.200-116.320.amzn1.x86_64GNU/Linux Distribution, if applicable (cat /etc/os-release)
s3fs command line used, if applicable
s3fs {bucket} {path} -o passwd_file=/etc/passwd-s3fss3fs unmount {path}Details about issue
Running into a couple of issues.
For starters, we had a recent security issue which resulted in our account being temporarily blocked. We had unauthorized EC2 usage. Our account was blocked but we went through the remediation steps AWS support asked for and our account in now unblocked. Immediately after getting unblocked, we started experiencing issues. I'm not sure if this is related but the timing is suspicious. I have verified that all necessary roles and permissions are configured as needed.
Issue 1
Our mounted bucket shows up with the all of the directories and files as expected, but a few of them say
no such file or directory.The directories definitely exist in the bucket and they are listed in the mounted directory, I just cannot access them in the EC2.
Issue 2
In an effort to troubleshoot, I tried to unmount the bucket. I ran
s3fs unmount {path}I didn't get any errors but the mount path still shows the mounted bucket and I am able to add files to the bucket from the EC2 with basic commands like
touch test.txt.My assumption would be that after running
unmountI would not be able to see the bucket contents.S3FS has been working perfectly for over a year and we would love to be able to keep using it. Any advise would be greatly appreciated.
Thank you,
@evanlalo commented on GitHub (Jun 29, 2022):
Update
With not having much to loose at this point, I tried recreating one of the inaccessible directories in the mounted path.
For example, in my bucket, I had a directory called
styles. This was one of the directories that s3fs said it could not accessls: cannot access styles: No such file or directorySo I ran
mkdir stylesand it seemed to relink the existing directory from the bucket meaning that I could now go into that directory and see the contents and verify that it matched what was in the bucket.The only issue is that all of the directories inside were also listed as
no such file or directory.@ggtakec commented on GitHub (Jun 29, 2022):
@evanlalo
I think this may be the case where the directory object(
<dirname>/) does not exist and some file objects exist under that directory path.(S3fs needs an object called
<dirname>/to recognize it as a directory, but this problem can occur because the object doesn't exist.)In this case, try starting s3fs with the
compat_diroption (if you are using the currentmaster branch).If you are using up to v1.91, this function should be working by default, so I think you can not identify the cause without investigating logs etc.
(Until v1.91, there is an option
notsup_compat_dirto not check the case where the directory object does not exist, contrary to the current master)If you can see the directory on s3fs, you will be able to create a directory object by carefully manipulating permissions etc. with the touch command, chmod/chown, etc.
Once the directory object is created, I don't think this issue will occur anymore.
(Alternatively, you may be able to avoid it by creating an empty object called
<dirname>/from the S3 console.)First of all, please check if you can refer to it without operating the directory.
@evanlalo commented on GitHub (Jun 29, 2022):
@ggtakec thanks for your reply but I'm not sure I understand your instructions.
Here are the contents of my mounted directory.
The
vehiclesdirectory exists in S3 and is filled with literally millions of records.If I try to perform any command on the directory (cd, chown, chmod, etc..), I get an error
cannot access vehicles: No such file or directory.Just out of curiosity, I created
vehicles_testin the s3 console and then copied a sub directory from thevehiclesdirectory.I can see the
vehicles_testdirectory in my EC2 and I can navigate to the copied sub directory. However, that copied directory also has directories and I get the same errorcannot access {directory name}: No such file or directory.@ggtakec commented on GitHub (Jul 3, 2022):
@evanlalo It looks like the operation method is a little different.
First, I explain about what seems to be the cause of this problem.
s3fs background operation about directories
s3fs sets attributes(http headers : x-amz-mod/gid/uid/*time) for S3 objects in order to treat them as files and directories.
However, directories are treated specially.
For example, if you create a
<bucket>/<dir>/<file>object with awscli or S3 console, the only<dir>/<file>object is created on S3.The
<dir>object does not exist.In order for s3fs to behave like a file system, directories also need attributes.
s3fs creates the directory object with attribute if user create files(directory) through s3fs.
In the above example, s3fs will create an object called
<dir>/. (Note that there is a/at the end)This
<dir>/object is 0 bytes and only the attributes are set.I think your this issue is most likely due to the absence of the
<dir>/object.How to check if directory object is existed(from s3fs)
s3fs has features and options that allow you to access the above
<dir>/even if it doesn't exist.Check if your problem is due to the absence of this
<dir>/object as follows:Check the directory for inaccessibility
If your s3fs is v1.91 or lower, start it with
notsup_compat_dir.If you're using s3fs built from the code in current master branch, you don't need to add any options.
The result of the ls command is displayed as follows:
The directories(likely)
no_folderandno_infoare visible, but the permissions and other attributes are unknown.This result looks the same as your problem right now.
How to make it accessible
If your s3fs is v1.91 or lower, you don't need to add any options.
If you are using s3fs built from the code in your current master branch, start it with the
compat_diroption.The result of the ls command is displayed as follows:
In this way, you can see the directories, and you can also refer to the files under those directories.
What you can do (if the cause is the same as above)
By adding(not adding)
compat_dir(notsup_compat_dir) as in the above example, you can refer to it even if the directory object does not exist.Please check the version of s3fs and check the above exmaples.
Permanent response
If the cause is that the
<dir>/object doesn't exist, you can make it create a<dir>/object for a permanent response.(notsup_)compat_diroption)chmod/chown/chgrp/touch(for update time)/etc.<dir>/object for that directory.Thanks in advance for your assistance.
@pedhenrique commented on GitHub (Jul 12, 2022):
@ggtakec This worked for me. Thanks
@gaul commented on GitHub (Jul 16, 2022):
Does #1986 fix this?
@gaul commented on GitHub (Jul 27, 2022):
Please reopen if symptoms persist.