jdx/mise · error · eyre::Report

cached rustc action result has an invalid identity

Error message

cached rustc action result has an invalid identity

What it means

A returned ActionResult must be version 1 and carry the exact action digest that was requested. A mismatch means the entry is from an incompatible cache format or points at another action, so restoring it could produce wrong outputs; the wrapper bails on identity (src/cache/rustc.rs:286).

Source

Thrown at src/cache/rustc.rs:286

    discovered: &DiscoveredInputs,
    restore_outputs: bool,
) -> Result<Option<CachedCompilation>> {
    let responses = session::request_agent(&[AgentRequest::FindActionResult {
        action: action.digest.clone(),
    }])?;
    let Some(response) = responses.into_iter().next() else {
        bail!("cache agent did not return an action lookup response");
    };
    let result = match response {
        AgentResponse::ActionResult { result } => match result {
            Some(result) => result,
            None => return Ok(None),
        },
        AgentResponse::Error { message } => bail!(message),
        _ => bail!("cache agent returned an unexpected action lookup response"),
    };
    if result.version != 1 || result.action != action.digest {
        bail!("cached rustc action result has an invalid identity");
    }
    let metadata_digest = result
        .metadata
        .ok_or_else(|| eyre::eyre!("cached rustc action result has no metadata"))?;
    let output_root_digest = result
        .output_root
        .ok_or_else(|| eyre::eyre!("cached rustc action result has no output root"))?;
    let roots = find_blobs(&[
        action.digest.clone(),
        metadata_digest.clone(),
        output_root_digest.clone(),
    ])?;
    let cached_action = read_verified_blob(&roots[0], &action.digest, "action descriptor")?;
    if cached_action != action.bytes {
        bail!("cached rustc action descriptor does not match the invocation");
    }
    let metadata: RustcMetadata =
        read_canonical_blob(&roots[1], &metadata_digest, "rustc metadata")?;

View on GitHub (pinned to 9dcfcaa0dc)

Solutions

  1. Delete the agent's cached result store so entries are re-recorded under the current schema
  2. Restart the agent and rebuild from a clean cache
  3. Pin one mise version for agent and wrappers; report if identity errors persist on a single version
Defensive patterns

Strategy: fallback

Try / catch

# Rust: on identity failure, bypass cache and compile normally
match restore_result(&action, ..) {
    Err(e) if e.to_string().contains("invalid identity") => run_plain_rustc(),
    r => r?,
}

Prevention

When it happens

Trigger: Cache entries written by a newer/older mise with a different result schema (version != 1), or an agent serving a result whose action digest differs from the query — corruption or index skew after an upgrade.

Common situations: Reusing an agent store across mise upgrades that bumped the result version; partial cache writes leaving mismatched digests.

Related errors


AI-assisted analysis of jdx/mise@9dcfcaa0dc (2026-08-17). Data as JSON: /api/errors/dbbc9aaadc799bb8. Report an issue: GitHub.