{"record":{"id":"1501f64d88828fc4","repo":"jdx/mise","slug":"remote-cache-blob-pack-payload-byte-metadata-misma","errorCode":null,"errorMessage":"remote cache blob pack payload byte metadata mismatch: expected {}, decoded {}","messagePattern":"remote cache blob pack payload byte metadata mismatch: expected (.+?), decoded (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/mise-cache-core/src/lib.rs","lineNumber":312,"sourceCode":"            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!(\n                \"remote cache blob pack payload byte metadata mismatch: expected {}, decoded {}\",\n                payload_bytes,\n                decoded.payload_bytes\n            );\n        }\n        Ok(BlobPackResponseStats {\n            blob_count: self.blob_count.unwrap_or(decoded.blob_count),\n            payload_bytes: self.payload_bytes.unwrap_or(decoded.payload_bytes),\n            framed_bytes: self.content_length.unwrap_or(decoded.framed_bytes),\n        })\n    }\n}\n\nfn optional_u64_header(headers: &HeaderMap, name: &str) -> Result<Option<u64>> {\n    let Some(value) = headers.get(name) else {\n        return Ok(None);\n    };\n    let value = value","sourceCodeStart":294,"sourceCodeEnd":330,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/crates/mise-cache-core/src/lib.rs#L294-L330","documentation":"BlobPackResponseMetadata::validate compares the payload-bytes response header (BLOB_PACK_BYTES) with the decoded payload size. A mismatch means framing or compression altered the body relative to the server's metadata, so validation fails to avoid caching corrupt data.","triggerScenarios":"Thrown at crates/mise-cache-core/src/lib.rs:312 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the request in case of transient corruption","Ensure nothing in the network path modifies (e.g. re-encodes) the body","Report deterministic mismatches to the cache server maintainers"],"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"}