jdx/mise · error

remote cache blob pack content length metadata mismatch…

Error message

remote cache blob pack content length metadata mismatch: expected {}, decoded {}

What it means

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.

Solutions

  1. Retry the fetch — transient truncation through proxies is the most common cause
  2. Verify no proxy/CDN rewrites response bodies or headers
  3. Report a server bug if the mismatch is deterministic
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/mise-cache-core/src/lib.rs:294 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/80a47b48f1b97c34. Report an issue: GitHub.

Appendix: source

Thrown at crates/mise-cache-core/src/lib.rs:294

    blob_count: u64,
    payload_bytes: u64,
    framed_bytes: u64,
}

impl BlobPackResponseMetadata {
    fn from_headers(headers: &HeaderMap) -> Result<Self> {
        Ok(Self {
            content_length: optional_u64_header(headers, CONTENT_LENGTH.as_str())?,
            blob_count: optional_u64_header(headers, BLOB_PACK_BLOBS_HEADER)?,
            payload_bytes: optional_u64_header(headers, BLOB_PACK_BYTES_HEADER)?,
        })
    }

    fn validate(self, decoded: BlobPackResponseStats) -> Result<BlobPackResponseStats> {
        if let Some(content_length) = self.content_length
            && content_length != decoded.framed_bytes
        {
            bail!(
                "remote cache blob pack content length metadata mismatch: expected {}, decoded {}",
                content_length,
                decoded.framed_bytes
            );
        }
        if let Some(blob_count) = self.blob_count
            && blob_count != decoded.blob_count
        {
            bail!(
                "remote cache blob pack blob count metadata mismatch: expected {}, decoded {}",
                blob_count,
                decoded.blob_count
            );
        }
        if let Some(payload_bytes) = self.payload_bytes
            && payload_bytes != decoded.payload_bytes
        {
            bail!(

View on GitHub (pinned to 533346cc37)