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

[Bug] - with versioning, object lock enabled, deleted file with '/' in middle leaves phantom folder in gateway #1030

Open
lrm25 opened this issue Jan 15, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@lrm25
Copy link
Contributor

lrm25 commented Jan 15, 2025

Describe the bug
If:

  • versitygw is started with versioning enabled
  • a bucket is created with object lock enabled
  • a file with a folder is added, e.g. "one/two"
  • the file is then deleted
  • the versions and delete markers are deleted

Then a phantom folder ("one/" in this case) is left in the bucket. This folder does not show up in either list-objects, or list-object-versions, but prevents the bucket from being deleted with a "bucket is not empty" error.

To Reproduce

  1. Start versitygw with versioning enabled, e.g.: ./versitygw --access=**** --secret=**** --region=us-east-1 --iam-dir=/Users/lukemccrone/devel/versitygw/iam --cert /Users/lukemccrone/devel/versitygw/cert.pem --key /Users/lukemccrone/devel/versitygw/versitygw.pem posix --versioning-dir /tmp/versioning /tmp/gw
  2. Create bucket with object lock enabled, e.g.: aws --no-verify-ssl s3api create-bucket --bucket lrm25-test-bucket --object-lock-enabled-for-bucket
  3. Create a test file and copy it, adding a '/' in the middle, e.g.: aws --no-verify-ssl s3 cp test-file s3://lrm25-test-bucket/one/two
  4. Remove the file, e.g.: aws --no-verify-ssl s3 rm s3://lrm25-test-bucket/one/two
  5. List the old version and delete marker with aws --no-verify-ssl s3api list-object-versions --bucket lrm25-test-bucket
  6. Delete these with aws --no-verify-ssl s3api delete-object --bucket lrm25-test-bucket --key one/two --version-id {ID}
  7. Verify that nothing is listed with aws --no-verify-ssl s3api list-objects --bucket lrm25-test-bucket and aws --no-verify-ssl s3api list-object-versions --bucket lrm25-test-bucket
  8. Attempt to delete the bucket with aws --no-verify-ssl s3api delete-bucket --bucket lrm25-test-bucket

Expected behavior
The bucket is able to be deleted, and no error: An error occurred (BucketNotEmpty) when calling the DeleteBucket operation: The bucket you tried to delete is not empty.

Server Version
Version : v1.0.9
Build : 06d25af
BuildTime: 2025-01-15_05:58:36PM
Darwin Lukes-MacBook-Pro.local 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:25 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6030 arm64

@lrm25 lrm25 added the bug Something isn't working label Jan 15, 2025
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
Status: No status
Development

No branches or pull requests

1 participant