jdx/mise · error

remote cache blob failed digest verification

Error message

remote cache blob failed digest verification

What it means

get_blob downloads a CAS blob into memory and verifies its bytes against the requested CacheDigest before returning them. If the downloaded content does not hash to the expected digest, the client bails rather than returning corrupted data. This catches truncated, tampered-with, or wrongly-keyed blobs from the server or an intermediary.

Solutions

  1. Retry the fetch — transient corruption may resolve; the library already retries, so repeated failure indicates real corruption
  2. Delete the corrupted blob from the remote cache and re-upload it (put_blob) from a trusted source
  3. Check the cache server's storage health (disk errors, truncation)
  4. If using a proxy, bypass it to determine whether the intermediary is serving bad bodies

Example fix

// caller-side re-upload repair
match client.get_blob(&digest, BLOB_MEDIA_TYPE).await {
    Err(e) if e.to_string().contains("digest verification") => {
    client.put_blob(&BlobUpload { digest: digest.clone(), source: BlobSource::Bytes(good_bytes) }).await?;
    }
    ok => ok?,
}
Defensive patterns

Strategy: retry

Validate before calling

// Caller can verify after receipt as a second line of defense:
let bytes = client.get_blob(&digest, media_type).await?;
assert!(digest.matches_bytes(&bytes)?, "blob failed local verification");

Try / catch

let bytes = loop {
    match client.get_blob(&digest, BLOB_MEDIA_TYPE).await {
        Ok(b) => break b,
        Err(e) if e.to_string().contains("digest verification") && attempts < 3 => { attempts += 1; }
        Err(e) => return Err(e),
    }
};

Prevention

When it happens

Trigger: Calling get_blob and receiving bytes whose blake3/sha256 (and size) do not match the digest in the request URL — including via retry_async, which will retry before surfacing the error.

Common situations: Bit-flipping network corruption (rare with TLS but possible via broken caches); a server that stored an object under the wrong key; an intermediary cache serving stale/truncated bodies; disk corruption on the cache server.

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/429ffb4bb406a3b6. Report an issue: GitHub.

Appendix: source

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

    }

    pub async fn get_blob(
        &self,
        digest: &CacheDigest,
        media_type: &'static str,
    ) -> Result<Vec<u8>> {
        digest.validate()?;
        let url = self.blob_endpoint(digest)?;
        retry_async("GET", &url, self.retries, || async {
            let response = self
                .request(reqwest::Method::GET, url.clone(), media_type)
                .await?
                .send()
                .await?
                .error_for_status()?;
            let bytes = response.bytes().await?.to_vec();
            if !digest.matches_bytes(&bytes)? {
                bail!("remote cache blob failed digest verification");
            }
            Ok(bytes)
        })
        .await
    }

    pub async fn get_blob_file(
        &self,
        digest: &CacheDigest,
        staging_dir: &Path,
    ) -> Result<tempfile::NamedTempFile> {
        let url = self.blob_endpoint(digest)?;
        let download = retry_async("GET", &url, self.retries, || async {
            let mut response = self
                .request(reqwest::Method::GET, url.clone(), BLOB_MEDIA_TYPE)
                .await?
                .send()
                .await?;

View on GitHub (pinned to 533346cc37)