R2, Ghost file phenomenon

I created an r2 bucket, uploaded and deleted files on the dashboard of Cloudflare, and then uploaded several files through the S3 API.
After a few hours I deleted all the uploaded files and tried to delete a bucket,
but it says “The bucket you tried to delete is not empty.” encountered the error.Also, the dashboard showed that 500MB of files were stored.

Have you ever experienced something like this? If so, how did you deal with it?

2 Likes

Me too.
I have deleted all the files, but it still prompts:
Bucket ***** cannot be deleted because it isn’t empty.

Can you please email me your account ids to vlovich at cloudflare.com so I can check? This is a known issue and we’ve fixed it a bit last week and this week we’re cleaning up the usage reported.

3 Likes

Same issue.

You can install and use the aws cli to list all of the objects in your Cloudflare r2 bucket

aws s3api list-objects-v2 --endpoint-url https://<<account_id>>.r2.cloudflarestorage.com/ --bucket <<bucket_name>>

https://docs.aws.amazon.com/cli/latest/reference/s3api/list-objects-v2.html

Then re-format the output into a JSON file name list.json e.g.

{ "Objects": [
  { "Key": "" },
  { "Key": "" }
]}

Then delete up to 63 objects at one time listed in json file

aws s3api delete-objects --endpoint-url https://<<account_id>>.r2.cloudflarestorage.com/ --bucket <<bucket_name>> --delete file://list.json
1 Like

Same issue for me. I was testing the ArqBackup client. Did a backup to an R2 bucket for a few days, and then deleted everything from the arqbackup tool. After 24hours the R2 page still shows 51 GB, even though zero objects. Cannot delete the bucket because it says the same “not empty” message.

ArqBackup is a stable tool which I have used without issue with S3 B2 Backblaze and S3 AWS.

Exactly the same issue, which seems to be reproducible when trying to delete objects using S3 API.

I used the S3 API using the aws s3api command one week before to delete-objects from a similar sized bucket in another account. Then I was able to delete the bucket from the r2 UI without problem. Only this week I am I having this problem deleting a bucket.

I created an r2 bucket, uploaded and deleted files. After tried to delete the empty bucket
but it says “The bucket you tried to delete is not empty.” error. The dashboard shows the bucket as empty, though total r2 bucket size shows 51GB. S3 API list-objects-v2 shows zero objects.

This has been stuck for over 10 days. I do not want to pay $ for 50GB of data which I am not able to access. Support does not resolve ticket which I created.

I am trying to delete an empty R2 bucket from my account but I keep getting the “Bucket prepros-downloads cannot be deleted because it isn’t empty” message.
Also the bucket stats is showing 83.78 GB usage even though it’s completely empty.

Have you already opened a ticket with support?

Yes I have this same problem.
This has been stuck for over 10 days. I do not want to pay $ for 50GB of data which I am not able to access. Support does not resolve ticket which I created.

What’s the ticket number?

[2478187]

My ticket is #2479355.

I’ve escalated these two tickets.

2 Likes

I am glad I did a test of this R2 beta product before uploading TBs of data. I am fine to test beta product, though I am not happy to get a bill from Cloudflare for storing GBs data which cannot be deleted. The worst case would be, as proven with this test, no response or resolution from the support team for weeks while TB per day costs accrue.

Update from the R2 team.

On that front, we’re testing the rollout of the cleanup code today so you should see usages dropping to 0 (assuming you don’t have live objects / uploads that are starting today). This should also let you delete buckets that are unable to delete due to having in-progress uploads.

3 Likes

thanks!