Skip to content

Conversation

mosiac1
Copy link
Contributor

@mosiac1 mosiac1 commented Sep 18, 2024

Reading a missing bucket/key will result in a 500 with the error "Insufficient content written 0 < x" (where X is a the expected content size) which seems to be a Jetty error.

The aws-proxy correctly logs that the response from MinIO has status 404 and the Content-Length header is set. With a breakpoint I confirmed that the response from MinIO has the same size as Content-Length, so I'm not sure why Jetty doesn't get any content.

Will continue investigating.

@cla-bot cla-bot bot added the cla-signed label Sep 18, 2024
@mosiac1 mosiac1 force-pushed the feat/fix-500-on-404 branch 2 times, most recently from 6164141 to 9828ce4 Compare September 19, 2024 11:21
@mosiac1
Copy link
Contributor Author

mosiac1 commented Sep 19, 2024

Found that StreamingResponseHandler did not stream the body of non-2XX responses but would send the original Content-Length header which would have a non-0 value, triggering the Jetty error that not enough content was written.

Updated StreamingResponseHandler to always include the body and added tests for all status codes that the S3 spec lists.

Created #154

Copy link
Member

@vagaerg vagaerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mosiac1 mosiac1 changed the title Add test for missing bucket or key Return proxied response body for all status codes Sep 19, 2024
@mosiac1 mosiac1 merged commit 3cd6897 into trinodb:main Sep 23, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants