Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
All solutions
    • All solutions for Object Storage
    • Resolving the `Bucket is not empty` error when deleting a bucket
    • Troubleshooting access to a bucket with an assigned security policy
    • Fixing error 429
    • Fixing error 409: `BucketAlreadyExists`
    • Resolving the error of access to S3 buckets from a Yandex Data Processing 1.4 cluster
    • Fixing error 403 (header is not retrieved when using the `OPTION` method)
    • Resolving certificate error
    • Resolving the `GATEWAY_REQUEST_ERROR` error
    • Fixing issues with incorrect MIME types of objects when uploading them to Object Storage
    • Troubleshooting issues with uploading new objects to a bucket
    • How to migrate data from an Object Storage bucket to ice storage
    • How to restrict Object Storage bucket access to a specific Cloud CDN IP address range
    • How to move bucket contents to another bucket in the same folder
    • How to directly access the Object Storage API without using SDK
    • How to view and delete incomplete downloads
    • How to determine the speed of data upload and download
    • How to configure `Cache-Control` headers for objects in a bucket during HTTP requests
    • How to restrict access to a bucket for a user
    • How to connect your own domain to a bucket
    • How to change the storage class
    • How to recover data deleted from a bucket

In this article:

  • Issue description
  • Solution
  1. Object Storage
  2. Resolving the `Bucket is not empty` error when deleting a bucket

Fixing the Bucket is not empty error when deleting a bucket

Written by
Yandex Cloud
Updated at December 17, 2025
  • Issue description
  • Solution

Issue descriptionIssue description

You get the Bucket is not empty error when trying to delete a bucket.

SolutionSolution

To delete a folder or bucket, you need to first delete all objects from it. Here are the most common reasons why you cannot delete a bucket:

  • Some multipart uploads are incomplete in the bucket.
  • The bucket still contains uploaded objects.
  • All objects have been deleted from the bucket but since versioning is enabled, the old versions of the deleted objects still exist.

You can delete all old versions of objects and incomplete uploads by setting up automatic deletion of all these entities in the bucket lifecycle rule.

Note

Lifecycle rules are processed at 00:00 UTC every day.

Management console
AWS CLI

You can view and delete incomplete uploads using the management console following this guide.

Learn how to delete all objects from a bucket using the management console in this article.

  • You can check for incomplete multipart uploads using this command:

    aws --endpoint <https://storage.yandexcloud.net> s3api list-multipart-uploads \
    --bucket \<bucket_name\>
    
  • You can abort such uploads using the abort-multipart-upload command:

    aws --endpoint <https://storage.yandexcloud.net> s3api abort-multipart-upload \
    --bucket \<bucket_name\> --key \<object_key\> --upload-id \<upload_id\>
    
  • You can check for objects in the bucket using the list-objects command:

    aws --endpoint <https://storage.yandexcloud.net> s3api list-objects \
    --bucket \<bucket_name\>
    
  • You can delete a single object using the delete-object command:

    aws --endpoint <https://storage.yandexcloud.net> s3api delete-object \
    --bucket \<bucket_name\> --key
    
  • You can delete multiple objects using the delete-object command:

    aws --endpoint <https://storage.yandexcloud.net> s3api delete-objects \
    --bucket \<bucket_name\> --delete '\{ "Objects": \[ \{ "Key": \}, \{ "Key": \}, ...\] \}'
    
  • If you have versioning enabled in your bucket, the old versions are still retained even after you delete all objects from your folder or bucket. You need to delete them as well. You can view the old versions by running this command:

    aws --endpoint <https://storage.yandexcloud.net> s3api list-object-versions \
    --bucket \<bucket_name\>
    
    
  • You can delete a specific version of an object with this command:

    aws --endpoint <https://storage.yandexcloud.net> s3api delete-object \
    --bucket \<bucket_name\> --key \<key_name\> --version-id \<version_id\>
    

Was the article helpful?

Previous
All solutions for Object Storage
Next
Troubleshooting access to a bucket with an assigned security policy
© 2025 Direct Cursus Technology L.L.C.