{"record":{"id":"6d693033eb4f5e62","repo":"jdx/mise","slug":"cache-agent-did-not-store-the-rustc-identity","errorCode":null,"errorMessage":"cache agent did not store the rustc identity","messagePattern":"cache agent did not store the rustc identity","errorType":"exception","errorClass":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/cache/rustc.rs","lineNumber":617,"sourceCode":"        let output = command\n            .output()\n            .wrap_err(\"failed to query the rustc identity\")?;\n        if !output.status.success() {\n            bail!(\n                \"rustc identity command failed: {}\",\n                String::from_utf8_lossy(&output.stderr)\n            );\n        }\n        let responses = session::request_agent(&[AgentRequest::StoreExecutableIdentity {\n            executable,\n            environment,\n            stdout: output.stdout,\n        }])?;\n        let Some(AgentResponse::ExecutableIdentity {\n            stdout: Some(stdout),\n        }) = responses.into_iter().next()\n        else {\n            bail!(\"cache agent did not store the rustc identity\");\n        };\n        stdout\n    };\n    let verbose = std::str::from_utf8(&stdout).wrap_err(\"rustc identity is not UTF-8\")?;\n    let release = identity_field(verbose, \"release\")?;\n    let host = identity_field(verbose, \"host\")?;\n    let rustc_version = verbose\n        .lines()\n        .filter(|line| {\n            line.starts_with(\"rustc \")\n                || line.starts_with(\"commit-hash:\")\n                || line.starts_with(\"commit-date:\")\n                || line.starts_with(\"LLVM version:\")\n        })\n        .collect::<Vec<_>>()\n        .join(\"; \");\n    if rustc_version.is_empty() {\n        bail!(\"rustc identity is missing its version\");","sourceCodeStart":599,"sourceCodeEnd":635,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/cache/rustc.rs#L599-L635","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Restart the mise session so shim and agent come from the same binary","Check agent-side storage health: disk space and permissions on the cache directory","Unset inherited MISE_CACHE_* environment before running mise tasks","If it persists with matched versions and a healthy disk, capture MISE_DEBUG=1 output and file a bug"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# check the cache volume is writable before a cached build:\ntouch \"$MISE_CACHE_STAGING_DIR/.probe\" 2>/dev/null \\\n  || echo 'cache staging dir not writable — identity stores will fail'","typeGuard":"fn is_stored_identity(r: &AgentResponse) -> bool {\n    matches!(r, AgentResponse::ExecutableIdentity { stdout: Some(_) })\n}","tryCatchPattern":null,"preventionTips":["Keep the cache directory writable and off full disks","One mise binary per session (shim and agent must match)","Alert on repeated 'did not store' warnings — each occurrence means every compile re-queries rustc -vV"],"tags":["rust","cache","agent","protocol","rustc"],"backgroundTag":"agent-protocol-mismatch","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}