jdx/mise · error
path is not in either snapshot
Error message
path is not in either snapshot
What it means
decrypted_diff decrypts the compared snapshots and diffs them as temporary plaintext files. It collects the set of changed entries; when a path filter is supplied but the filtered path matches no entry in either snapshot, the diff cannot proceed and bails.
Source
Thrown at src/system/history/shadow.rs:949
(b, opts.paths.as_ref().map(|p| p.1.as_str())),
] {
for entry in self.ls_tree(tree)? {
if entry.path.starts_with(".mise-history/") {
continue;
}
if let Some(prefix) = prefix {
if entry.path == prefix {
paths.insert(String::new());
} else if let Some(relative) = entry.path.strip_prefix(&format!("{prefix}/")) {
paths.insert(relative.to_string());
}
} else {
paths.insert(entry.path);
}
}
}
if paths.is_empty() && opts.paths.is_some() {
bail!("path is not in either snapshot");
}
let mut output = vec![];
let mut changed = false;
for relative in paths {
let path = |prefix: &str| {
if relative.is_empty() {
prefix.to_string()
} else {
format!("{prefix}/{relative}")
}
};
let (left_path, right_path) = opts.paths.as_ref().map_or_else(
|| (relative.clone(), relative.clone()),
|(left, right)| (path(left), path(right)),
);
let left = self.restored_object_at(a, &left_path)?;
let right = self.restored_object_at(b, &right_path)?;
if left == right {View on GitHub (pinned to afd2eddd3a)
Solutions
- Confirm the exact snapshot-relative path (list entries of the snapshots) and retry
- Remove the path filter to see all changed paths
- Pick a different pair of snapshots where the file actually changed
Example fix
// before decrypted diff a b --path "home/.bashrc " (trailing space) // after decrypted diff a b --path "home/.bashrc"
Defensive patterns
Strategy: validation
Validate before calling
// Rust: verify the filtered path occurs in decrypted snapshot entries first
let entries: Vec<String> = decrypted_entries(&from, &to);
anyhow::ensure!(
opts.paths.as_ref().map_or(true, |p| p.iter().all(|q| entries.iter().any(|e| e.contains(q)))),
"filtered path not present in either decrypted snapshot"
); Try / catch
match differ.decrypted_diff(from, to, &opts) {
Err(e) if e.to_string().contains("path is not in either snapshot") => {
eprintln!("no decrypted entry matched the filter; drop --path to list changes");
}
other => other?,
} Prevention
- List decrypted snapshot entries to confirm exact path spelling before filtering
- Watch for trailing whitespace and leading-slash differences in path filters
- If the file is identical in both snapshots it will not appear as an entry; use plain diff with paths instead
When it happens
Trigger: Calling decrypted_diff (via diff, when decryption is required) with opts.paths set to a path that appears in neither snapshot's entry list.
Common situations: Path filter typo; the file is identical/untracked in both snapshots so no entry exists for it; passing a path rooted differently than snapshot-relative entries (leading slash or drive-letter differences).
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- {path} is not in either snapshot
- remote task path is not a regular file or directory: {}
- {raw}: target must be absolute or start with ~/
- {target_raw}: target must be absolute or start with ~/
- {target_raw}: target must be absolute or start with ~/
AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09).
Data as JSON: /api/errors/0e4e6ba2ae5609fe.
Report an issue: GitHub.