Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
All solutions
    • All solutions for Object Storage
    • Resolving the Bucket not empty error when deleting a bucket from Object Storage
    • Resolving errors of access to a bucket with an assigned security policy
    • Resolving error 429
    • Resolving the "409 BucketAlreadyExists" error
    • Resolving the error of access to S3 buckets from a DataProc 1.4 cluster
    • Resolving error 403 (header is not provided when using the OPTION method)
    • Resolving certificate error
    • Resolving GATEWAY_REQUEST_ERROR
    • Resolving issues with incorrect MIME-types of objects when uploading them to Object Storage
    • Moving data from an Object Storage bucket to an ice storage
    • Restricting access to an Object Storage bucket using an IP range from Cloud CDN
    • Moving bucket contents to another bucket in the same the folder
    • Accessing Object Storage API directly, bypassing the SDK
    • Viewing and deleting incomplete uploads
    • 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

In this article:

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

Resolving the "Bucket not empty" error when deleting a bucket from Object Storage

Written by
Yandex Cloud
Updated at November 27, 2023
  • Issue description
  • Solution

Issue descriptionIssue description

  • When attempting to delete a bucket, you see this error: Bucket is not empty

SolutionSolution

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

  • The bucket has incomplete multipart uploads
  • The bucket still contains uploaded objects
  • All objects have been deleted from the bucket, but versioning is enabled, and 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's lifecycle rule.
Lifecycle rules are processed at 00:00 UTC once a day.

Management console
AWS CLI

You can view and delete incomplete uploads from the management console following this guide:

Deleting all objects from a bucket using the management console is described at this link:

  • You can check for incomplete multipart uploads by running the following command:

    aws --endpoint <https://storage.yandexcloud.net> s3api list-multipart-uploads \
    --bucket \<bucket_name\>
    
  • You can abort such uploads with 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 with the delete-object command:

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

    aws --endpoint <https://storage.yandexcloud.net> s3api delete-objects \
    --bucket \<bucket_name\> --delete '\{ "Objects": \[ \{ "Key": \}, \{ "Key": \}, ...\] \}'
    
  • If versioning is enabled in your bucket, then even after the objects are deleted from the folder (bucket), their old versions are still retained. You need to delete them as well. You can view the old versions by 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
Resolving errors of access to a bucket with an assigned security policy
© 2025 Direct Cursus Technology L.L.C.