findify / s3mock

Embedded S3 server for easy mocking
MIT License
387 stars 107 forks source link

Error when deleting non-existing key #97

Open sgraca opened 6 years ago

sgraca commented 6 years ago

According to documentation for Java SDK client, deleteObject succeeds when object with a given key does not exist.

However when the mock is used it fails with AmazonS3Exception: Not Found (Service: Amazon S3; Status Code: 404; Error Code: 404 Not Found; Request ID: null), S3 Extended Request ID: null error.

When used with S3 service the client behaves as expected.

rtvlad commented 6 years ago

This also happens for multi-object delete requests. It throws a MultiObjectDeleteException with the code null and message One or more objects could not be deleted (Service: null; Status Code: 200; Error Code: null; Request ID: null; S3 Extended Request ID: null).

The DeleteError objects contained by the exception are all like this: code=InternalError, message=Cannot delete.

Expected would be to return a successful result where the missing keys are still included as deleted objects, at least this is the current S3 behaviour.

manuelcueto commented 6 years ago

Hey guys, just submitted a pull request ( #109 ) addressing this issue. cheers!, Manuel.

rtvlad commented 5 years ago

Hi! Added a comment on that PR, hopefully it can be merged soon.