-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
delete_object() does not delete object (or seem to do anything) #2290
Comments
@crooksey - Thank you for your post. S3 delete requests are eventually consistent, which means the delete request can be successful but may not be reflected right away since the delete has to propagate across the region. Its detailed further here https://docs.aws.amazon.com/AmazonS3/latest/dev/Introduction.html#ConsistencyModel Anyway i am not able to reproduce the issue. Can you please provide me full debug logs ? You can enable log by adding |
Ok, so this is the exact code used, as deleting via an object seems the most widely used way. This is tested on a brand new bucket, all I did was create it, then enable public access. This is the code used to add the item to the bucket:
Then I checked the console, my object is there, I then deleted with the following code:
And this is my output:
The file still shows in the S3 console. The files I deleted in my other bucket yesterday, are still showing there this morning some 16 hours later. |
@crooksey - Thank you for providing me the debug logs. please make sure if your object is inside a folder then you have to provide the entire path in order to successfully delete the object. For example if your object path is s3.delete_object(Bucket = 'bucketname', Key = 'folder/object') I suspect this can be the cause of issue. if this is not the issue i would recommend contacting the s3 team either on their forum or creating a ticket to AWS Support. |
Thanks, I can confirm this was the issue. |
I am using the boto3 libary, and trying to delete objects. Note, I am not using versioning.
So I have a simple function:
And an example response:
I check the S3 console after performing the above, and the file still shows. What am I doing wrong? Also if I then click the tags of the item, there are no tags associated with it.
Note: My API User has full S3 Full Access
I have also tired deleting via an object which has the same results:
The text was updated successfully, but these errors were encountered: