Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Empty Folder on Delete with ONTAP S3 multiprotocol
2025-01-31
02:19 AM
1,735 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have bucket named xyz, inside which there are following objects
a/b/obj1.doc
a/b/obj2.doc
a/b/c/obj3.doc
a/b/c/obj4.doc
On deleting all the above 4 objects, folders a, b and c are not deleted and they are empty
Why are the folders not deleted when there are no objects?
9 REPLIES 9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello there,
- Is deleting the bucke the ultimate objective here?
- What error do we see when the folder is being deleted?
- I understand, you must have followed the below document for deleting the objects.
https://docs.netapp.com/us-en/storagegrid/tenant/deleting-s3-bucket-objects.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't want to delete the bucket. Objective is to delete the objects are its folders if its empty.
Objects are getting deleted without error but folders are not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Again,
What error do you see when you delete the folders?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As mentioned above there are no errors when deleting the objects
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, versioning is not enabled
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
• In S3, what appears as folders in the AWS Management Console are actually prefixes in the object key names.
• Since folders are not actual entities but part of the object keys, deleting all objects within a prefix does not result in the deletion of the prefix itself.
• The prefix will simply not be displayed in the console once all objects under it are deleted.
• To ensure that folders (prefixes) disappear from the S3 console when there are no objects:
1. Delete All Objects:
Ensure that all objects within the prefix are deleted, including any placeholder objects.
2. Use AWS CLI or SDK:
You can use the AWS CLI or SDK to delete all objects within a prefix, including any empty placeholder objects.
• Example: Deleting All Objects in a Prefix Using AWS CLI:
1. List Objects: First, list all objects within the prefix to ensure you know what will be deleted.
aws s3 ls s3://your-bucket/folder1/ --recursive
2. Delete Objects: Use the aws s3 rm command to delete all objects within the prefix.
aws s3 rm s3://your-bucket/folder1/ --recursive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We are using S3 multiprotocol with ONTAP. With this option we have folders, right? How does folders get deleted in this option?
What are placeholder objects?
Here is our configuration for the bucket
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@ChLokesh Any update on this?
