JavaScript aws-sdk S3 deleteObject(s) succedes but doesn't actually delete anything JavaScript aws-sdk S3 deleteObject(s) succedes but doesn't actually delete anything express express

JavaScript aws-sdk S3 deleteObject(s) succedes but doesn't actually delete anything


Try this one. You need to use promise() to ensure that the object is deleted before ending the execution. 6 hours waiting just for a simple object deletion is not normal, even with considering S3 99.999999999% durability.

var params = {        Bucket : bucket,        Key : video};try {    await s3.deleteObject(params,function(err,data){        if (err)    console.log(err,err.stack);        else        console.log("Response:",data);    }).promise();} catch (e) {}


Looks like first comment was right, it takes some time for files to be removed from AWS S3. In this case it was over an hour until it disappeared (could have been 6 hours, I stepped away for quite a bit).


I really don't think Aws takes long that long to delete. I was having same issue and solved it by changing the file name value, I was initially using the url instead of using the filename i used in uploading the image.