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:
software.amazon.awssdk.services.s3.model.S3Exception: The requested range is not satisfiable. (Service: S3, Status Code: 416)Reproduction
# 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 here, so I’m using the repository’s available search tools. I also found anAGENT.mdand am checking its project-specific guidance before editing. - Assistant
The failure is isolated to suffix parsing: an empty object produces no valid partial interval. I’m treating a valid suffix request on a zero-byte object as a normal successful full-object response (
200, zero-length body), while preserving416for explicit/open-ended ranges and malformed ranges. This avoids emitting an invalidContent-Range. - Assistant
The focused integration test is running now. The regression test creates a zero-byte object, requests
bytes=-1, and verifies a200response withContent-Length: 0, an empty body, and range capability headers. - Assistant
Maven reached a missing Surefire provider and attempted an external dependency download, so I stopped it immediately to honor the no-internet constraint. Compilation of all main and test sources had already succeeded; I’ll retry the focused test strictly offline and inspect the final diff.
- Assistant
The implementation and regression test compile cleanly, and the diff passes whitespace validation. The actual JUnit execution remains unavailable offline because this workspace lacks the cached
surefire-junit-platform:3.5.5artifact; no code or test compilation errors occurred.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.