Untitled conversation
- User
[BUG] S3 GetObject suffix range fails for empty objects
Service
S3
AWS API Action
GetObject with the
Rangeheader set to a suffix byte range, for examplebytes=-1.Expected behavior
A suffix range request against an existing empty object should not fail the read. This is exercised by Trino's S3 filesystem compatibility test for empty files, where
TrinoInput.readTail(...)reads an existing zero-byte S3 object and expects an empty successful read.Actual behavior
Floci returns
416 InvalidRangefor the same request becauseS3Controller.handleRangeRequestcomputesstart = 0andend = -1for an empty object, then rejects the range.In Trino's Floci-backed S3 filesystem test this surfaces as:
textsoftware.amazon.awssdk.services.s3.model.S3Exception: The requested range is not satisfiable. (Service: S3, Status Code: 416)Reproduction
bash# Start Floci on localhost:4566 first. aws --endpoint-url http://localhost:4566 s3 mb s3://range-empty-repro printf '' > /tmp/empty-object aws --endpoint-url http://localhost:4566 s3 cp /tmp/empty-object s3://range-empty-repro/empty aws --endpoint-url http://localhost:4566 s3api get-object \ --bucket range-empty-repro \ --key empty \ --range 'bytes=-1' \ /tmp/range-empty-outputEnvironment
- Floci version / image tag:
floci/floci:1.5.21 - Java SDK version (if applicable): observed with Trino's AWS SDK v2 S3 client tests
- How you're running Floci (Docker / native /
mvn quarkus:dev): Docker via Testcontainers
Interface
No new interfaces are introduced.
- Floci version / image tag:
- Assistant
I’ll trace the S3 range handling and its tests, then patch the empty-object suffix case and run the focused test suite.
- Assistant
rgisn’t installed in this checkout, so I’m using the repository’s available search tools and keeping the scope focused on S3 range code. - Assistant
The compatible response should be a normal
200with a zero-length body: a206cannot express a validContent-Rangefor an empty representation. I’m factoring the existing full-object response builder so this special case preserves the same S3 metadata headers. - Assistant
The implementation and regression test are in place. The focused S3 integration suite is running now; I’ll use its result to catch any HTTP-framework edge cases around empty response entities.
- Assistant
Maven reached for a missing Surefire provider artifact, so I stopped it and am rerunning strictly offline. Compilation already completed; the offline run will show whether the cached local test dependencies are sufficient.
- Assistant
Offline compilation and packaging pass. The integration runner itself is blocked only by an uncached Surefire provider, so I’m doing a local end-to-end HTTP check against the built Quarkus app as the final behavioral verification.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.