{"record":{"id":"d28796e30a6aee34","repo":"jdx/mise","slug":"unsupported-remote-cache-directory-version","errorCode":null,"errorMessage":"unsupported remote cache directory version","messagePattern":"unsupported remote cache directory version","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/task_cache_store.rs","lineNumber":723,"sourceCode":"}\n\nasync fn materialize_remote_tree(\n    store: &HttpTaskCacheStore,\n    root: &CacheDigest,\n) -> Result<tempfile::NamedTempFile> {\n    let mut pending = vec![(PathBuf::new(), root.clone(), BTreeSet::new())];\n    let mut nodes = BTreeMap::<PathBuf, RestoredNode>::new();\n    while let Some((path, digest, mut ancestors)) = pending.pop() {\n        if !ancestors.insert(digest.clone()) {\n            bail!(\"remote cache directory graph contains a cycle\");\n        }\n        let bytes = store.client.get_blob(&digest, DIRECTORY_MEDIA_TYPE).await?;\n        let directory: RemoteDirectory = serde_json::from_slice(&bytes)?;\n        if canonical_json(&serde_json::to_value(&directory)?)? != bytes {\n            bail!(\"remote cache directory is not canonical JSON\");\n        }\n        if directory.version != 1 {\n            bail!(\"unsupported remote cache directory version\");\n        }\n        let mut names = BTreeSet::new();\n        for directory in directory.directories {\n            validate_cache_name(&directory.name)?;\n            if !names.insert(directory.name.clone()) {\n                bail!(\"remote cache directory contains duplicate names\");\n            }\n            let child = path.join(&directory.name);\n            validate_cache_path(&child)?;\n            nodes.insert(\n                child.clone(),\n                RestoredNode::Directory {\n                    mode: directory.mode,\n                },\n            );\n            pending.push((child, directory.digest, ancestors.clone()));\n        }\n        for file in directory.files {","sourceCodeStart":705,"sourceCodeEnd":741,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/task/task_cache_store.rs#L705-L741","documentation":"Every RemoteDirectory proto carries a version field and this mise restores only version 1. A directory blob with any other version bails with 'unsupported remote cache directory version' before any node of the restore tree is created.","triggerScenarios":"materialize_remote_tree fetches a directory proto whose version field is not 1 - cache entries written by a newer mise that bumped the schema, or a hand-crafted blob.","commonSituations":"Shared CI cache across teams on different mise versions; upgrading mise and restoring entries written by a newer client; rollback after a schema change.","solutions":["Upgrade mise to at least the version that wrote the cache (mise use -g mise@<version>)","Or clear the remote cache entries and repopulate with the current version","Pin one mise version for all CI cache writers and readers"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// if you cache RemoteDirectory protos yourself, check before restore:\nlet dir: RemoteDirectory = serde_json::from_slice(&bytes)?;\nif dir.version != 1 {\n    return Ok(None); // treat as a miss and rebuild\n}","typeGuard":"fn directory_version_supported(bytes: &[u8]) -> Option<bool> {\n    serde_json::from_slice::<RemoteDirectory>(bytes)\n        .ok()\n        .map(|d| d.version == 1)\n}","tryCatchPattern":"match restore_from_remote(&key).await {\n    Ok(hit) => hit,\n    Err(err) if err.to_string().contains(\"unsupported remote cache directory version\") => {\n        warn!(\"cache entry written by a different mise version; rebuilding\");\n        purge_action_result(&key).await.ok();\n        run_task_uncached(&task).await?\n    }\n    Err(err) => return Err(err),\n}","preventionTips":["Pin one mise version for all machines sharing a remote cache","After upgrading mise, expect old-format entries to miss; purge rather than retry","Roll back clients and cache together when downgrading mise"],"tags":["mise","remote-cache","task-cache","version","schema"],"backgroundTag":"unsupported-version","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}