jdx/mise · error

remote cache capability protocol

Error message

remote cache capability protocol {} is incompatible with client protocol {PROTOCOL_VERSION}

What it means

When the client fetches the server's capability document for blob packs, it compares the server's protocol major version against PROTOCOL_VERSION and bails if they differ. The wire protocol is not compatible across major versions, so the client refuses to proceed rather than misinterpreting responses. This indicates a client/server version skew.

Solutions

  1. Upgrade the remote cache server to a version speaking the client's protocol major version, or vice versa (upgrade the client)
  2. Check the server's deployed version and the client's PROTOCOL_VERSION to confirm the skew
  3. If both sides are current, clear any stale capabilities cache and retry; if it persists, file an issue — a same-version mismatch is a bug
Defensive patterns

Strategy: try-catch

Validate before calling

// Fetch capabilities first and compare majors yourself:
let caps: RemoteCacheCapabilities =
    client.get(capabilities_url).send().await?.json().await?;
if caps.protocol.major != PROTOCOL_VERSION { /* fail fast with a clear upgrade message */ }

Try / catch

match client.get_blob_pack(&digests, staging).await {
    Err(e) if e.to_string().contains("incompatible with client protocol") => {
        eprintln!("cache server protocol mismatch; upgrade server or client");
        // fall back to local cache
    }
    other => other?,
}

Prevention

When it happens

Trigger: Calling get_blob_pack (which triggers blob_pack_limits) against a remote cache server whose capabilities document reports a protocol.major different from the client's PROTOCOL_VERSION — typically after upgrading one side but not the other.

Common situations: Deploying a newer mise client against an older self-hosted cache server (or vice versa); pinning an old cache service image; a server admin bumping the protocol without notice.

Understand the failure class

Background: "invalid response format", "malformed payload", "missing data field": when an API returns 200 but the response shape is wrong — this error's family across 23 libraries.

Related errors


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

Appendix: source

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

            .get_or_try_init(|| async {
                let url = self.capabilities_endpoint()?;
                let response = self
                    .request(reqwest::Method::GET, url, "application/json")
                    .await?
                    .send()
                    .await?;
                if matches!(
                    response.status(),
                    StatusCode::NOT_FOUND
                        | StatusCode::METHOD_NOT_ALLOWED
                        | StatusCode::NOT_IMPLEMENTED
                ) {
                    return Ok(None);
                }
                let capabilities: RemoteCacheCapabilities =
                    response.error_for_status()?.json().await?;
                if capabilities.protocol.major != PROTOCOL_VERSION {
                    bail!(
                        "remote cache capability protocol {} is incompatible with client protocol {PROTOCOL_VERSION}",
                        capabilities.protocol.major
                    );
                }
                if !capabilities.features.blob_packs {
                    return Ok(None);
                }
                let max_items = usize::try_from(capabilities.limits.max_batch_items)
                    .ok()
                    .filter(|limit| *limit > 0)
                    .ok_or_else(|| {
                        eyre!("remote cache blob packs require a positive max_batch_items limit")
                    })?;
                if capabilities.limits.max_pack_bytes == 0 {
                    bail!("remote cache blob packs require a positive max_pack_bytes limit");
                }
                Ok(Some(BlobPackLimits {
                    max_items: max_items.min(MAX_STAGED_BLOB_PACK_ITEMS),

View on GitHub (pinned to 533346cc37)