{"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/533346cc374382b41ec5ff70536252b2e96e725c/src/task/task_cache_store.rs#L705-L741","documentation":"Each remote directory blob carries a version field; the restore walker only understands version 1. If a directory blob declares any other version, mise bails because its parsing and validation rules may not apply to that format.","triggerScenarios":"get_blob returns a directory blob whose `version` field is not exactly 1 — e.g. a blob written by a newer mise or a custom producer using a different schema version.","commonSituations":"Remote cache populated by a newer/other tool version with an evolved on-disk format; hand-written blobs with a wrong or missing-defaulted version field; mixed-version cache stores.","solutions":["Upgrade mise to a version that supports the directory format version present in the remote store.","Purge the incompatible cache entries (or the whole remote cache) and repopulate with the current mise version.","Align the custom cache producer on version 1 of the RemoteDirectory schema.","Pin the team to one mise version so all writers and readers agree on the format."],"exampleFix":"// before\n{\"version\": 2, \"directories\": [], ...}\n// after\n{\"version\": 1, \"directories\": [], ...}","handlingStrategy":"validation","validationCode":"if (blob.version !== 1) throw new Error(`unsupported directory version: ${blob.version}`);","typeGuard":"const isV1 = (b) => b?.version === 1;","tryCatchPattern":null,"preventionTips":["Keep all cache writers and readers on the same mise version.","Purge the remote cache when upgrading to a format change.","Reject blobs with unknown version fields at write time."],"tags":["task-cache","remote-cache","versioning","schema"],"backgroundTag":"unsupported-enum-value","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}