jdx/mise · error

remote cache blob pack payload byte metadata mismatch: expec

Error message

remote cache blob pack payload byte metadata mismatch: expected {}, decoded {}

What it means

Thrown while validating a blob-pack download (crates/mise-cache-core/src/lib.rs:339): the payload-bytes metadata header (BLOB_PACK_BYTES_HEADER) disagrees with decoded.payload_bytes — the sum of raw blob payload sizes actually decoded. Note this checks payload bytes, distinct from framed_bytes (which includes magic, digests, and per-record framing), so it catches servers that report content size rather than framed size or vice versa.

Source

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

            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!(
                "remote cache blob pack payload byte metadata mismatch: expected {}, decoded {}",
                payload_bytes,
                decoded.payload_bytes
            );
        }
        Ok(BlobPackResponseStats {
            blob_count: self.blob_count.unwrap_or(decoded.blob_count),
            payload_bytes: self.payload_bytes.unwrap_or(decoded.payload_bytes),
            framed_bytes: self.content_length.unwrap_or(decoded.framed_bytes),
        })
    }
}

fn optional_u64_header(headers: &HeaderMap, name: &str) -> Result<Option<u64>> {
    let Some(value) = headers.get(name) else {
        return Ok(None);
    };
    let value = value

View on GitHub (pinned to 6f52dcdf99)

Solutions

  1. Retry once to rule out a transient race between header computation and body write
  2. Disable blob packs for this remote to fall back to individually verified per-blob GETs (each blob is digest-checked independently)
  3. If you operate the server, make the payload-bytes header equal the exact sum of decoded blob payload lengths, and content length equal the framed size — match the semantics in BlobPackResponseMetadata::validate
  4. Report/fix version skew: align client and server on the same pack wire format
Defensive patterns

Strategy: retry

Try / catch

match client.get_blob_pack(&digests, &staging).await {
    Err(e) if e.to_string().contains("payload byte metadata mismatch") => {
        client.disable_blob_packs();
        fallback_per_blob(&client, &digests)
    }
    other => other?,
}

Prevention

When it happens

Trigger: Calling get_blob_pack/decode_blob_pack (lib.rs:899) where the server's payload-bytes header counts something other than the sum of blob payloads — e.g. it reports total framed size, uncompressed vs compressed size, or includes record headers in the count.

Common situations: A custom or third-party cache server implementing the pack format from ambiguous docs; version skew after a pack-format change; compression applied in transit changing perceived payload sizes.

Related errors


AI-assisted analysis of jdx/mise@6f52dcdf99 (2026-08-22). Data as JSON: /api/errors/1501f64d88828fc4. Report an issue: GitHub.