{"record":{"id":"639bf1fc38f0f9a5","repo":"jdx/mise","slug":"cached-rustc-metadata-is-unsupported","errorCode":null,"errorMessage":"cached rustc metadata is unsupported","messagePattern":"cached rustc metadata is unsupported","errorType":"exception","errorClass":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/cache/rustc.rs","lineNumber":306,"sourceCode":"    let metadata_digest = result\n        .metadata\n        .ok_or_else(|| eyre::eyre!(\"cached rustc action result has no metadata\"))?;\n    let output_root_digest = result\n        .output_root\n        .ok_or_else(|| eyre::eyre!(\"cached rustc action result has no output root\"))?;\n    let roots = find_blobs(&[\n        action.digest.clone(),\n        metadata_digest.clone(),\n        output_root_digest.clone(),\n    ])?;\n    let cached_action = read_verified_blob(&roots[0], &action.digest, \"action descriptor\")?;\n    if cached_action != action.bytes {\n        bail!(\"cached rustc action descriptor does not match the invocation\");\n    }\n    let metadata: RustcMetadata =\n        read_canonical_blob(&roots[1], &metadata_digest, \"rustc metadata\")?;\n    if metadata.version != 1 || metadata.kind != \"rustc\" {\n        bail!(\"cached rustc metadata is unsupported\");\n    }\n    let directory: CacheDirectory =\n        read_canonical_blob(&roots[2], &output_root_digest, \"output directory\")?;\n    let files = validated_outputs(directory, outputs)?;\n    let cached_outputs = files\n        .iter()\n        .map(|(node, destination)| CachedOutput {\n            path: destination.clone(),\n            digest: node.digest.clone(),\n            mode: node.mode,\n        })\n        .collect();\n    let restored_output_files = files.len().try_into().unwrap_or(u64::MAX);\n    let restored_output_bytes = files.iter().fold(0_u64, |total, (node, _)| {\n        total.saturating_add(node.digest.size)\n    });\n\n    let mut digests = vec![metadata.stdout.clone(), metadata.stderr.clone()];","sourceCodeStart":288,"sourceCodeEnd":324,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/cache/rustc.rs#L288-L324","documentation":"Each cached compilation stores a RustcMetadata blob; on restore it must have version 1 and kind \"rustc\". Any other version/kind means the metadata format (or adapter) is not understood by this build of mise, so the entry is unusable and the wrapper bails rather than misinterpreting it (src/cache/rustc.rs:306).","triggerScenarios":"Reading cache entries written by a different mise version that changed the metadata schema, or an entry recorded by a different adapter kind stored under the same digest index.","commonSituations":"Long-lived shared cache store across mise upgrades; CI caches restored across toolchain image updates.","solutions":["Invalidate the cache store (delete agent-side blobs/metadata) after upgrading mise","Restart the agent so entries are re-recorded with the current metadata version","Avoid sharing one cache store between different mise versions or adapters"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"# Unsupported metadata version => invalidate store, recompile\ngrep -q 'cached rustc metadata is unsupported' build.log && {\n  rm -rf \"$MISE_CACHE_STAGING_DIR\"; cargo build;\n}","preventionTips":["Invalidate shared caches whenever mise or the adapter changes","Version cache stores by mise release in CI cache keys","Don't restore caches built by newer mise versions (forward incompatibility)"],"tags":["mise","rustc-cache","cache-corruption","metadata-version","version-mismatch"],"backgroundTag":"cache-corruption","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}