{"record":{"id":"80a47b48f1b97c34","repo":"jdx/mise","slug":"remote-cache-blob-pack-content-length-metadata-mis","errorCode":null,"errorMessage":"remote cache blob pack content length metadata mismatch: expected {}, decoded {}","messagePattern":"remote cache blob pack content length metadata mismatch: expected (.+?), decoded (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/mise-cache-core/src/lib.rs","lineNumber":294,"sourceCode":"    blob_count: u64,\n    payload_bytes: u64,\n    framed_bytes: u64,\n}\n\nimpl BlobPackResponseMetadata {\n    fn from_headers(headers: &HeaderMap) -> Result<Self> {\n        Ok(Self {\n            content_length: optional_u64_header(headers, CONTENT_LENGTH.as_str())?,\n            blob_count: optional_u64_header(headers, BLOB_PACK_BLOBS_HEADER)?,\n            payload_bytes: optional_u64_header(headers, BLOB_PACK_BYTES_HEADER)?,\n        })\n    }\n\n    fn validate(self, decoded: BlobPackResponseStats) -> Result<BlobPackResponseStats> {\n        if let Some(content_length) = self.content_length\n            && content_length != decoded.framed_bytes\n        {\n            bail!(\n                \"remote cache blob pack content length metadata mismatch: expected {}, decoded {}\",\n                content_length,\n                decoded.framed_bytes\n            );\n        }\n        if let Some(blob_count) = self.blob_count\n            && blob_count != decoded.blob_count\n        {\n            bail!(\n                \"remote cache blob pack blob count metadata mismatch: expected {}, decoded {}\",\n                blob_count,\n                decoded.blob_count\n            );\n        }\n        if let Some(payload_bytes) = self.payload_bytes\n            && payload_bytes != decoded.payload_bytes\n        {\n            bail!(","sourceCodeStart":276,"sourceCodeEnd":312,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/crates/mise-cache-core/src/lib.rs#L276-L312","documentation":"BlobPackResponseMetadata::validate compares the Content-Length HTTP header of a remote-cache blob pack response against the bytes actually decoded from the framed body. A mismatch means the response was truncated, corrupted, or the server's metadata headers disagree with the payload, so the whole pack is rejected.","triggerScenarios":"Thrown at crates/mise-cache-core/src/lib.rs:294 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the fetch — transient truncation through proxies is the most common cause","Verify no proxy/CDN rewrites response bodies or headers","Report a server bug if the mismatch is deterministic"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}