I found the solution which relates to this topic More R2 ghost objects/files
The solution is to abort incomplete multipart uploads that still in-progress
I will provide steps to solve my problem below
ListMultipartUploads
aws s3api list-multipart-uploads --bucket <bucketname> --endpoint-url <your R2 endpoint>
If you find any run the following command to abort AbortMultipartUpload
aws s3api abort-multipart-upload --bucket <bucketname> --key <key that you found on the previous command> --upload-id <UploadId that you found on the previous command> --endpoint-url <your R2 endpoint>
Or if you’d like to abort all multipart uploads
Set your bucket name
BUCKETNAME=xxxxx
then run
aws s3api list-multipart-uploads --bucket $BUCKETNAME --endpoint-url | jq -r ‘.Uploads | “–key "(.Key)" --upload-id (.UploadId)”’ | while read -r line; do eval “aws s3api abort-multipart-upload --bucket $BUCKETNAME $line --endpoint-url ”; done