s3proxy icon indicating copy to clipboard operation
s3proxy copied to clipboard

PUT request stores data but returns HTTP 404

Open Bierkai opened this issue 8 months ago • 0 comments

When my test code tries to store a new object by means of a PUT request, it receives a 404 Not Found response from s3proxy with e.g. the following body: <?xml version='1.0' encoding='UTF-8'?><Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><RequestId>4442587FB7D0A2F9</RequestId></Error> . The file does appear on my HDD, and I can subsequently retrieve it by means of a followup GET request.

So apparently s3proxy processes my upload correctly but nevertheless returns a 404 for the PUT request. This is corroborated by TRACE logging from the Docker container:

[s3proxy] D 05-07 13:11:37.908 S3Proxy-Jetty-18 o.gaul.s3proxy.S3ProxyHandler:304 |::] request: Request(PUT [http://localhost/myBucket2/4EDE04DB9A)@22e7fbbb⁠](http://localhost/myBucket2/4EDE04DB9A)@22e7fbbb)
[s3proxy] T 05-07 13:11:37.908 S3Proxy-Jetty-18 o.gaul.s3proxy.S3ProxyHandler:329 |::] header: Authorization: [REDACTED]
[s3proxy] T 05-07 13:11:37.908 S3Proxy-Jetty-18 o.gaul.s3proxy.S3ProxyHandler:329 |::] header: X-Amz-Date: 20250507T131137Z
[s3proxy] T 05-07 13:11:37.908 S3Proxy-Jetty-18 o.gaul.s3proxy.S3ProxyHandler:329 |::] header: Connection: close
[s3proxy] T 05-07 13:11:37.909 S3Proxy-Jetty-18 o.gaul.s3proxy.S3ProxyHandler:329 |::] header: X-Forwarded-For: 172.17.0.1
[s3proxy] T 05-07 13:11:37.909 S3Proxy-Jetty-18 o.gaul.s3proxy.S3ProxyHandler:329 |::] header: Host: localhost
[s3proxy] T 05-07 13:11:37.909 S3Proxy-Jetty-18 o.gaul.s3proxy.S3ProxyHandler:329 |::] header: X-Amz-Content-Sha256: b24a23ef8a3041cf0bc72b0b6e46bdc59fb76354fcc62aa1a016f21ca93b01a4
[s3proxy] T 05-07 13:11:37.909 S3Proxy-Jetty-18 o.gaul.s3proxy.S3ProxyHandler:329 |::] header: Content-Length: 10
[s3proxy] T 05-07 13:11:37.909 S3Proxy-Jetty-18 o.gaul.s3proxy.S3ProxyHandler:329 |::] header: X-Real-IP: 172.17.0.1
[s3proxy] D 05-07 13:11:37.914 S3Proxy-Jetty-18 o.g.s.n.AbstractNio2BlobStore:534 |::] Creating blob at: /data/myBucket2/4EDE04DB9A
[s3proxy] D 05-07 13:11:37.932 S3Proxy-Jetty-18 o.g.s.n.AbstractNio2BlobStore:348 |::] Getting blob at: /data/myBucket2/4EDE04DB9A
[s3proxy] D 05-07 13:11:37.935 S3Proxy-Jetty-18 o.gaul.s3proxy.S3ProxyHandler:3002 |::] sendSimpleErrorResponse: 404 NoSuchKey The specified key does not exist. {}

Looks like creation of the blob succeeds, but lookup/retrieval of that same blob subsequently fails. This happens on s3proxy Docker images going back to this one. The problem does not occur when using the image published just before that. I therefore think that the problem was introduced by this commit, which is described as

Change Docker storage backend to filesystem-nio2

Could you please investigate and let me know how to fix (or work around) the issue? Thanks.

Bierkai avatar May 07 '25 13:05 Bierkai