Repository navigation
Description
Problem
ErrObjectTampered is mapped to HTTP 206 Partial Content. The server detects that it cannot serve a stored object, but ordinary SDK reads can succeed and return the error XML as object content. HEAD can similarly appear to succeed for a zero-byte object.
Observed behavior
An ordinary full-object GET of an unreadable replica returned 429 bytes of XML with code XMinioObjectTampered, content type application/xml, and status 206. boto3 returned Body normally instead of raising an exception. HEAD returned 206 with ContentLength=0. The intact source returned the expected 131072 bytes.
This was independently isolated using a signed GET/HEAD handler test: derive errObjectTampered from encrypted-size validation, make the object layer return that error before the response is committed, and assert a non-2xx response. Both GET and HEAD fail that assertion on both ErasureSD and Erasure, on 0806 and 0903. The result is therefore independent of the particular storage/replication problem that made the first test object unreadable.
Cause and minimal repair
The error table entry assigns http.StatusPartialContent; normal GET/HEAD error writers use it before sending object bytes. The entry is inherited unchanged from ca6b4773ed438e46720e34b27bb90600416014f4 (2017-11-08).
Change only this entry to 500 Internal Server Error, keeping its specific error code and message. Incorrect customer keys use a separate AccessDenied/403 mapping; they do not need to change.
Acceptance
- GET and HEAD receiving
ErrObjectTamperedbefore response commitment return 500, never 2xx. - boto3 reports an error instead of returning XML as object bytes or a successful zero-length HEAD.
- Correct objects, range reads and incorrect-key behavior retain their existing outcomes.
The real unreadable-replica write path is tracked in #109. Its repair and this error-status repair can be implemented and verified independently.
Versions and verification
Reproduced in the 2026-09-05 functional review on the published SILO release RELEASE.2026-09-03T13-18-01Z (9b11dc9469e650815b775cb47b039610644f5da4), with RELEASE.2026-08-06T00-00-00Z (3be10fcc1a44f6620ded0bd303461f9d688cca23) as the baseline. The reviewed code remains unchanged on current main f0bd164b92d799c026fb1a31ad8e0df8ecb39388. Product fixes have not been applied.
Activity
Vonng commentedon Sep 5, 2026
Fix plan prepared 2026-09-05 by Claude (Fable 5.1) and reviewed in 1 round(s) of dialogue with the Codex reviewer (gpt-6-astra) that filed this issue. Local paths under
/Users/vonng/pgsty/silo-codex-triage-20260905/silo-110(plan, prototype diff, tests, Codex transcripts) and/private/tmp/silo-mcli-review-20260905.MfP8W9(review evidence) live on the maintainer's machine, not in the repository.Fix plan — #110 (Claude ⨯ Codex consensus, 2026-09-05)
1. Verdict
Confirmed. The API error table maps
ErrObjectTamperedto HTTP 206, so a server thatknows it cannot serve a stored object answers with a success status and an XML error
document that SDKs hand back as object content. Verified independently on main
f0bd164b9:git diff 9b11dc946..f0bd164b9 -- cmd/api-errors.go cmd/api-response.go cmd/object-handlers.go cmd/encryption-v1.go cmd/object-api-utils.gois empty, and the Codexrepro test
TestReviewDamagedObjectGETHEADReturnHTTPErrorfails on an unpatched worktree ofmain with
GET ... returned success HTTP 206andHEAD ... returned success HTTP 206onboth ErasureSD and Erasure. The issue text is accurate on every checked point: the
introducing commit, the affected writers, the AccessDenied separation for wrong SSE-C keys,
and the live boto3 evidence in
logs/site-ssec-compressed-get.jsonl. One clarificationworth recording: upstream
minio/miniomaster still carries 206, so this fix is adeliberate divergence rather than a missed backport.
2. Root cause
cmd/api-errors.go:1526-1530on mainf0bd164b9declaresErrObjectTampered{Code: "XMinioObjectTampered", HTTPStatusCode: http.StatusPartialContent}.toAPIErrorCodecallsunwrapAllatcmd/api-errors.go:2169and then mapserrObjectTamperedto that entry at
:2243-2244, so wrapped occurrences reach it too.writeErrorResponse(
cmd/api-response.go:982) andwriteErrorResponseHeadersOnly(cmd/api-response.go:1010)write the table status verbatim, and the GET and HEAD early-failure paths use them at
cmd/object-handlers.go:472and:910, before any status line is committed.git log -L 1526,1530:cmd/api-errors.goreturns exactly one commit: upstreamca6b4773ed438e46720e34b27bb90600416014f4(2017-11-08, "add SSE-C support for HEAD, GET,PUT (minio#4894)"). That commit added nine SSE entries at once; the other eight all use
http.StatusBadRequest, and only this one usesStatusPartialContent, with no comment,no test and no discussion. The "response already streaming" theory does not hold today or
in 2017. Today
cmd/object-handlers.go:553-557setsstatusCodeWrittenbefore writing 206for range and part reads, and both post-copy failure paths (
:562and:571) callwriteErrorResponseonly when!httpWriter.HasWritten() && !statusCodeWritten;setObjectHeaders(cmd/api-headers.go:112-258) never callsWriteHeader. In 2017 theguard was weaker, but SSE-C plus range returned
ErrNotImplemented(
ca6b4773e:cmd/object-handlers.go:174), so a committed 206 could not coexist with atampered error there either. The 206 is best read as a copy-paste slip in that batch.
3. Minimal fix
cmd/api-errors.go, theErrObjectTamperedentry only.HTTPStatusCodebecomeshttp.StatusInternalServerError.CodeandDescriptionare untouched. 1 line changedplus a 4-line comment recording the upstream divergence. S.
HTTP 500 with the existing
<Code>XMinioObjectTampered</Code>body (GET) and the existingx-minio-error-codeheader (HEAD). EveryerrObjectTamperedorigin is a stored-statedefect and not caller input:
cmd/encryption-v1.go:354and:519are the default branchesof switches on the stored SSE type,
:747,:756,:893and:903reject storedobject or part sizes that are not valid sio streams,
:778-788rejects a stored multipartETag shape, and
cmd/object-api-utils.go:578and:587reject storedactual-sizemetadata. A 5xx is therefore the honest class. S3 has no 4xx meaning "our copy is
unreadable"; AWS uses
InternalError/500 for that, 503SlowDownis reserved for load,and 422 is outside the S3 error surface and would be read by AWS SDKs as a
non-retryable caller fault. Keeping the MinIO-specific code preserves diagnosability
while only the class changes.
(
[email protected].../retry.go:118-130) and boto3 standard mode retries too, so apermanently damaged object now costs several attempts instead of one. These failures can
be reported before committing the object response. Retries repeat backend work and add
latency, bounded by the client's configured attempt limit and deadline. That is preferable
to silently returning wrong bytes.
replica (tracked in [P1] SSE-C replicas become unreadable with destination default encryption or compression #109); errors raised after the response is committed, where
cmd/object-handlers.go:562and:571deliberately do not rewrite the status and a realfix would need trailers or a connection abort; the wrong-SSE-C-key mapping to AccessDenied
at
cmd/api-errors.go:2249-2250; the separate zero-byte SSE-C key gap; and every otherentry in the error table, including any audit of other suspicious status codes.
4. Tests
(
/private/tmp/silo-mcli-review-20260905.MfP8W9/silo-state/cmd/review_object_tampered_status_repro_test.go) ascmd/object-handlers_tampered_test.go, functionTestObjectTamperedGETHEADStatus. It runsunder
ExecObjectLayerAPITest, so it covers ErasureSD and Erasure; it deriveserrObjectTamperedfromObjectInfo{Size: 31, ...}.DecryptedSize(), injects an objectlayer that returns it before any bytes, and asserts the error identity plus the status.
Three adaptations were made and validated: rename the test and its helper type off the
reviewprefix, and tightenrec.Code < http.StatusBadRequestto an exactrec.Code != http.StatusInternalServerErrorso a future silent change to another non-2xxstatus is also caught. The ready-to-copy file is at
/Users/vonng/pgsty/silo-codex-triage-20260905/silo-110/tests/object-handlers_tampered_test.go.TestAPIErrCode,TestAPIErrCodeDefinition,TestAPIHeadObjectHandler,TestAPIHeadObjectHandlerWithEncryption,TestAPIGetObjectHandler(all eight subtests, includingencryptedandcompressed+encrypted). All pass with the patch. Nothing in the tree asserts 206 for atampered object: the only
StatusPartialContentassertions incmd/are genuine rangereads (
cmd/object-handlers_test.go:460,487,589,633,782,971,cmd/server_test.go:2022,2671,2737,2804), no product code branches on this entry's status,and
getDecryptedETag(cmd/encryption-v1.go:807) swallows decryption errors, so listingpaths cannot start returning 500.
logs/site-ssec-compressed-get.jsonlonce, on one object, and confirm boto3 raisesClientErrorfor GET and HEAD instead of returning a body or a zero-length HEAD.5. Compatibility, risk, rollout
Only the status line of one MinIO-specific error code changes; no healthy-object response
and no stored data are affected, so nothing needs resync or migration. No client in the fork
special-cases the code:
XMinioObjectTampereddoes not appear inpgsty/mc,pgsty/silo-consoleorpgsty/silo-pkg. Mixed-version deployments are safe because nothingnegotiates on this status; an old client simply sees a real error where it previously saw a
bogus success. The change diverges from upstream
minio/miniomaster, which still carries206 at this entry, and the repository has no divergence ledger, so the inline comment in the
patch plus a line in the fix note on silo.pgsty.com are what will stop a future upstream sync
from silently reverting it. Operationally these requests now count as 5xx in metrics and
audit logs, which is the signal we want but may raise alerts on clusters that already hold
damaged objects.
6. Cost
S. Product: 1 line changed, 4 comment lines, one file. Test: about 60 adopted lines, one
new file. No dependency on #109; the two can land in either order and be verified separately.
Server repository only, no mc, Console or SDK change. Implementation and review well under
an hour.
7. Consensus with Codex
Rounds used: 1/3.
CONSENSUS: YESat round 1, on all five dimensions (validity, root cause,fix approach, test plan, scope). Codex independently confirmed the single introducing commit
and its eight sibling entries at 400, and confirmed upstream still maps this error to 206.
Amendments accepted from Codex (both verified before acceptance, both to supporting prose,
neither changes the patch or the test):
tampered XML as object data. Codex is right:
proxyGetToReplicationTarget(
cmd/bucket-replication.go:2334) does a HEAD first viaStatObjectat:2443, and thepinned minio-go rejects a response with no parseable
Last-Modified(
[email protected].../utils.go:348-356). The tampered HEAD inlogs/site-ssec-compressed-get.jsonlline 3 carries nolast-modified, so that proxyread already fails inside the SDK. Claim deleted.
xl.metahas already pulled the data into memory (cmd/erasure-object.go:226-234) andthe reader goroutine starts at
:302-305before later handler validation. Replaced withCodex's wording about repeated backend work and bounded retry latency.
Rejected suggestions and why: none. Codex proposed no scope beyond the issue.
Open disagreements: none.
Appendix A — prototype diff
Before, unpatched main
f0bd164b9:--- FAIL: TestReviewDamagedObjectGETHEADReturnHTTPError, GET and HEAD returned HTTP 206 on ErasureSD and Erasure.After, patched worktree:
ok github.com/minio/minio/cmd 3.390swithTestObjectTamperedGETHEADStatus,TestAPIErrCode,TestAPIErrCodeDefinition,TestAPIHeadObjectHandler,TestAPIHeadObjectHandlerWithEncryptionandTestAPIGetObjectHandlerall PASS.Vonng commentedon Sep 5, 2026
Fix record (2026-09-05)
Status: implemented, reviewed, awaiting merge. Pull request: #121 (branch
fix/issue-110-tampered-status, commit5703426b3, based on mainf0bd164b9).Root cause, as fixed.
cmd/api-errors.gomappedErrObjectTamperedtohttp.StatusPartialContent, unchanged since upstreamca6b4773e(2017), so the early GET/HEAD error writers (cmd/object-handlers.go:472,:910) emitted a 2xx status before any bytes were committed and SDKs accepted the XML error document as object content.Change. The entry now carries
http.StatusInternalServerError;Code(XMinioObjectTampered) andDescriptionare unchanged. One line of product code plus a comment above the entry recording the deliberate divergence from upstream (which still returns 206). Nothing else in the error table, the wrong-keyAccessDeniedmapping, the post-commit range paths or the replication write path (#109) is touched.Tests.
TestObjectTamperedGETHEADStatus(adopted from the Codex repro, tightened to assert exactly 500, signed GET and HEAD, ErasureSD and Erasure) fails on main withreturned HTTP 206, want 500and passes with the fix;TestAPIErrCode,TestAPIErrCodeDefinition,TestAPIHeadObjectHandler,TestAPIHeadObjectHandlerWithEncryption,TestAPIGetObjectHandlerstay green; gofmt clean; golangci-lint 0 issues on./cmd/....Live acceptance check (plan §4). The review lab's destination data directory, holding the original unreadable compressed SSE-C replica, was served by two binaries in turn and read with boto3 using the original customer key. With this branch, HEAD and GET both raise
ClientError(500; GET carriesXMinioObjectTampered). With the publishedRELEASE.2026-09-03T13-18-01Zbinary, HEAD returns normally with 206 andContent-Length: 0, and GET returns normally with 206 and the 429-byte error XML asBody. The default-SSE-S3 bucket's replica still answers 400InvalidRequestand a healthy object 200 on both binaries. Evidence (script, results, server logs) is archived on the maintainer's machine under/Users/vonng/pgsty/silo-codex-triage-20260905/silo-110/live-replay/.Adversarial Codex review (gpt-6-astra). Round 1: FAIL, one required finding, the live acceptance check had not been run. Round 2: PASS, no findings, after the replay above. Residual risks it recorded: bounded client retries and 5xx metrics/audit classification for damaged-object reads; un-upgraded nodes keep 206 during a rolling upgrade; failures after response commitment remain out of scope.
Still to do outside this repository. The release fix note on silo.pgsty.com should record the 206 → 500 divergence from upstream so a future sync does not revert it.
Vonng commentedon Sep 6, 2026
Merged — record complete (2026-09-06)
Merged via #121 (merge commit
62cce2b15) intomain. Supersedes the "awaiting merge" status above: main is green — siloe7d0e62f1, Go CI (Test cmd/, Test internal/, Race + S3 Select, Format/Build/Vet, Lint/Generated Files, Cross Compile) and VulnCheck all pass.Issue closed; fix record complete.
fix: return 500 for unreadable objects instead of 206
test: reconcile encrypted-parts attributes test with pgsty#119 write …