{"record":{"id":"bc8c397d5ff1e7c5","repo":"jdx/mise","slug":"unknown-history-path-root-other","errorCode":null,"errorMessage":"unknown history path root: {other}","messagePattern":"unknown history path root: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/shadow.rs","lineNumber":905,"sourceCode":"                if layout.locate(&file.path).path().is_none() {\n                    continue;\n                }\n                let label = file.path.split('/').next().unwrap_or_default().to_string();\n                let root = roots.entry(label.clone()).or_insert_with(|| RootRecord {\n                    label,\n                    ..Default::default()\n                });\n                root.files += 1;\n                root.bytes += file.size.unwrap_or_default();\n            }\n            record.tree.roots = roots.into_values().collect();\n        }\n        for root in &mut record.tree.roots {\n            root.path = match root.label.split('@').next().unwrap_or_default() {\n                \"home\" => crate::dirs::HOME.to_path_buf(),\n                \"config\" => super::tracked::global_config_dir(),\n                \"fs\" => PathBuf::from(std::path::MAIN_SEPARATOR.to_string()),\n                other => bail!(\"unknown history path root: {other}\"),\n            };\n        }\n        Ok(record)\n    }\n\n    fn gix_tree_entries(repo: &gix::Repository, tree: &gix::Tree<'_>) -> Result<Vec<TreeEntry>> {\n        let mut entries = tree\n            .traverse()\n            .breadthfirst\n            .files()?\n            .into_iter()\n            .filter(|entry| entry.mode.is_no_tree())\n            .map(|entry| {\n                let path = std::str::from_utf8(entry.filepath.as_ref())\n                    .wrap_err(\"history cannot represent a non-UTF-8 filename; refusing to change its bytes\")?\n                    .to_string();\n                let mut mode = [0; 6];\n                let mode = std::str::from_utf8(entry.mode.as_bytes(&mut mode))?.to_string();","sourceCodeStart":887,"sourceCodeEnd":923,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/history/shadow.rs#L887-L923","documentation":"`read_meta` reconstructs absolute paths for the roots stored in a history record by mapping the root label's prefix (text before '@') to a known directory: 'home', 'config', or 'fs' (filesystem root). If a record contains a label with an unrecognized prefix — typically a snapshot written by a different/older layout or hand-edited metadata — this bail fires. It is a data-integrity guard, not a user-input error.","triggerScenarios":"Reading a history record whose `tree.roots` contains a label like \"other@...\" where the prefix before '@' is not home/config/fs. Occurs in `read_meta` when deserializing older snapshots or metadata written by an incompatible version, or after manual edits to the history store.","commonSituations":"Restoring or inspecting history data created by a different mise version whose root layout names differ; copying a history repo between machines with hand-tweaked metadata; corrupted or externally modified store files.","solutions":["Upgrade or downgrade mise to the version that wrote the snapshot — the label scheme is layout-version specific.","Inspect the record's root labels (history store metadata) and rename the unknown prefix to a supported one (home/config/fs) only if you know the intended target.","Recreate the snapshot: re-capture the tracked files so fresh metadata with current labels is written.","If the store was hand-edited, restore it from backup or remove the offending root entry."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"let prefix = label.split('@').next().unwrap_or_default();\nif !matches!(prefix, \"home\" | \"config\" | \"fs\") {\n    eprintln!(\"unknown root label prefix: {prefix}\");\n}","typeGuard":"fn known_root(label: &str) -> Option<&str> {\n    match label.split('@').next()? {\n        p @ (\"home\" | \"config\" | \"fs\") => Some(p),\n        _ => None,\n    }\n}","tryCatchPattern":"// Rust\nmatch read_meta(&store, id) {\n    Ok(record) => use(record),\n    Err(e) if e.to_string().contains(\"unknown history path root\") => {\n        eprintln!(\"snapshot written by incompatible layout; re-capture\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Use the same mise version to read history data that wrote it.","Do not hand-edit history store metadata.","Back up the history store before migrating versions."],"tags":["history","metadata","migration"],"backgroundTag":"invalid-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"}