jdx/mise · error · eyre::Report

cache agent did not store the rustc identity

Error message

cache agent did not store the rustc identity

What it means

After a successful local 'rustc -vV', the shim stores the output via StoreExecutableIdentity and expects the agent to echo it back as ExececutableIdentity { stdout: Some(..) } (src/cache/rustc.rs:608-618). Anything else — no response, a different variant, or stdout: None — throws: the identity could not be recorded, so every future compilation pays a fresh -vV run. Note that an AgentResponse::Error also fails this pattern-match and lands here.

Source

Thrown at src/cache/rustc.rs:617

        let output = command
            .output()
            .wrap_err("failed to query the rustc identity")?;
        if !output.status.success() {
            bail!(
                "rustc identity command failed: {}",
                String::from_utf8_lossy(&output.stderr)
            );
        }
        let responses = session::request_agent(&[AgentRequest::StoreExecutableIdentity {
            executable,
            environment,
            stdout: output.stdout,
        }])?;
        let Some(AgentResponse::ExecutableIdentity {
            stdout: Some(stdout),
        }) = responses.into_iter().next()
        else {
            bail!("cache agent did not store the rustc identity");
        };
        stdout
    };
    let verbose = std::str::from_utf8(&stdout).wrap_err("rustc identity is not UTF-8")?;
    let release = identity_field(verbose, "release")?;
    let host = identity_field(verbose, "host")?;
    let rustc_version = verbose
        .lines()
        .filter(|line| {
            line.starts_with("rustc ")
                || line.starts_with("commit-hash:")
                || line.starts_with("commit-date:")
                || line.starts_with("LLVM version:")
        })
        .collect::<Vec<_>>()
        .join("; ");
    if rustc_version.is_empty() {
        bail!("rustc identity is missing its version");

View on GitHub (pinned to 6f52dcdf99)

Solutions

  1. Restart the mise session so shim and agent come from the same binary
  2. Check agent-side storage health: disk space and permissions on the cache directory
  3. Unset inherited MISE_CACHE_* environment before running mise tasks
  4. If it persists with matched versions and a healthy disk, capture MISE_DEBUG=1 output and file a bug
Defensive patterns

Strategy: validation

Validate before calling

# check the cache volume is writable before a cached build:
touch "$MISE_CACHE_STAGING_DIR/.probe" 2>/dev/null \
  || echo 'cache staging dir not writable — identity stores will fail'

Type guard

fn is_stored_identity(r: &AgentResponse) -> bool {
    matches!(r, AgentResponse::ExecutableIdentity { stdout: Some(_) })
}

Prevention

When it happens

Trigger: Same protocol-skew causes as the other agent mismatches (stale socket, version-skewed agent), plus agent-side storage failures: CAS write errors, disk full, or the agent returning Error/empty for StoreExecutableIdentity.

Common situations: Mixed mise versions on one machine; inherited MISE_CACHE_SOCKET from an old session; cache dir becoming read-only or full between the lookup and the store.

Related errors


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