Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursive removal of folder works but throws error #1194

Open
stecca21 opened this issue Dec 9, 2024 · 1 comment
Open

Recursive removal of folder works but throws error #1194

stecca21 opened this issue Dec 9, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@stecca21
Copy link

stecca21 commented Dec 9, 2024

Mountpoint for Amazon S3 version

mount-s3 1.13.0

AWS Region

us-east-1

Describe the running environment

EC2 instance running Ubuntu 22.04
Mountpoint started with service that sets the needed AWS credentials to the S3 bucket

Mountpoint options

mount-s3 --force-path-style --allow-delete --allow-overwrite --incremental-upload --allow-other --prefix=<prefix_path> <bucketname> <local_mountpoint>

What happened?

Running a recursive removal on a directory works, but also throws an error "Cannot remove <DIR>: No such file or directory where <DIR> is the path specified for removal:
ex: rm -R /This_is/My_path
output: cannot remove My_path: No such file or directory.

Relevant log output

No response

@stecca21 stecca21 added the bug Something isn't working label Dec 9, 2024
@c-hagem
Copy link
Contributor

c-hagem commented Dec 13, 2024

Hi, thanks for sharing this.

Most likely, this is expected behaviour, as Mountpoint removes implicit directories (for more context, see SEMANTICS.MD): Once the last file in the directory is deleted (i.e. if a directory blue is visible because of keys that are mapped to files blue/a.txt and blue/b.txt, the directory will cease to exist once the two objects are deleted from S3 or the two files are removed).
Thus, when rm tries to delete the directory, it will already be considered to not exist by Mountpoint, as all files in the directory will have been deleted before.
There already is an issue about changing this behaviour and we are considering revisiting our current semantics decision, but we don't have anything concrete to share on that yet.

As a workaround, at least in my testing, the issue didn't occur when i used rm -Rf DIR on the directory, alternatively, only removing the files in the directory, i.e. using something along the lines of find DIR -type f -delete should also work without throwing an error.

Please let us know, if that doesn't work in your use-case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants