jdx/mise · error
unknown history path root
Error message
unknown history path root: {other} What it means
`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.
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.
Defensive patterns
Strategy: fallback
Validate before calling
let prefix = label.split('@').next().unwrap_or_default();
if !matches!(prefix, "home" | "config" | "fs") {
eprintln!("unknown root label prefix: {prefix}");
} Type guard
fn known_root(label: &str) -> Option<&str> {
match label.split('@').next()? {
p @ ("home" | "config" | "fs") => Some(p),
_ => None,
}
} Try / catch
// Rust
match read_meta(&store, id) {
Ok(record) => use(record),
Err(e) if e.to_string().contains("unknown history path root") => {
eprintln!("snapshot written by incompatible layout; re-capture");
}
Err(e) => return Err(e),
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- this store uses the old unreleased checkpoint format; use a…
- a process it started kept its output open
- an operation record always has an operation
- another history operation is running
- another history operation is running
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/bc8c397d5ff1e7c5.
Report an issue: GitHub.
Appendix: source
Thrown at src/system/history/shadow.rs:905
if layout.locate(&file.path).path().is_none() {
continue;
}
let label = file.path.split('/').next().unwrap_or_default().to_string();
let root = roots.entry(label.clone()).or_insert_with(|| RootRecord {
label,
..Default::default()
});
root.files += 1;
root.bytes += file.size.unwrap_or_default();
}
record.tree.roots = roots.into_values().collect();
}
for root in &mut record.tree.roots {
root.path = match root.label.split('@').next().unwrap_or_default() {
"home" => crate::dirs::HOME.to_path_buf(),
"config" => super::tracked::global_config_dir(),
"fs" => PathBuf::from(std::path::MAIN_SEPARATOR.to_string()),
other => bail!("unknown history path root: {other}"),
};
}
Ok(record)
}
fn gix_tree_entries(repo: &gix::Repository, tree: &gix::Tree<'_>) -> Result<Vec<TreeEntry>> {
let mut entries = tree
.traverse()
.breadthfirst
.files()?
.into_iter()
.filter(|entry| entry.mode.is_no_tree())
.map(|entry| {
let path = std::str::from_utf8(entry.filepath.as_ref())
.wrap_err("history cannot represent a non-UTF-8 filename; refusing to change its bytes")?
.to_string();
let mut mode = [0; 6];
let mode = std::str::from_utf8(entry.mode.as_bytes(&mut mode))?.to_string();View on GitHub (pinned to 533346cc37)