jdx/mise · error

remote cache blob pack failed digest verification

Error message

remote cache blob pack failed digest verification

What it means

After fully writing a blob from the remote cache pack to disk, the client hashes the streamed bytes and compares against the digest sent by the server. A mismatch means the payload content differs from what the pack promised, so the blob is rejected. This protects against corruption and tampering.

Solutions

  1. Retry the fetch; if it fails consistently the server copy is corrupt and must be repopulated
  2. Force the server to re-upload/rebuild the affected cache entry
  3. Use HTTPS for the cache URL so payloads cannot be modified in transit
  4. Verify no storage layer (NFS/S3 sync tools) is silently corrupting blob files
Defensive patterns

Strategy: retry

Try / catch

match unpack_blob_pack(...).await {
    Err(e) if e.to_string().contains("digest verification") => {
        eprintln!("cache entry corrupt; refetching from origin");
        // evict entry and repopulate
    }
    other => other,
}

Prevention

When it happens

Trigger: hasher.matches(&digest.hash) is false after unpacking a blob — streamed content hash does not equal the digest hash declared in the pack framing.

Common situations: Bit-rot or disk corruption on the server, corrupted transfer, MITM modification on plain-HTTP cache connections, server storing wrong bytes under a digest.

Understand the failure class

Background: Checksum mismatch errors: "checksum verification failed", "digest mismatch", "expected vs actual checksum" — what they mean and how to fix them — this error's family across 41 libraries.

Related errors


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

Appendix: source

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

        let path = directory.path().join(blobs.len().to_string());
        let mut output = tokio::fs::File::create(&path).await?;
        let mut remaining = digest.size;
        let mut buffer = [0_u8; 64 * 1024];
        while remaining > 0 {
            let limit = usize::try_from(remaining.min(buffer.len() as u64)).unwrap();
            let count = reader.read(&mut buffer[..limit]).await?;
            if count == 0 {
                bail!("remote cache blob pack ended before a blob was complete");
            }
            output.write_all(&buffer[..count]).await?;
            hasher.update(&buffer[..count]);
            remaining -= count as u64;
        }
        output.flush().await?;
        drop(output);
        if !hasher.matches(&digest.hash) {
            bail!("remote cache blob pack failed digest verification");
        }
        blobs.push((digest, path));
    }
    let blob_count = blobs.len().try_into().unwrap_or(u64::MAX);
    let metadata = metadata.validate(BlobPackResponseStats {
        blob_count,
        payload_bytes,
        framed_bytes,
    })?;
    Ok(DownloadedBlobPack {
        directory,
        blobs,
        metadata,
    })
}

enum BlobPackHasher {
    Blake3(Box<blake3::Hasher>),

View on GitHub (pinned to 533346cc37)