jdx/mise · warning
watch file no longer exists
Error message
watch file no longer exists: {} What it means
During env-cache validation, a watched file listed in the cache (that had a nonzero mtime when cached) no longer exists on disk. Since the environment derived from that file may no longer be valid, `load` bails and the cache is treated as stale.
Solutions
- Restore the missing file (e.g. `git checkout -- <file>`) or accept the invalidation.
- Clear the env cache and re-run so it rebuilds against current files.
- If the file is intentionally gone, re-run the mise command — a fresh cache entry will exclude it.
- Check whether a branch switch or tool run deleted the file.
Example fix
// before git status # .env missing // after git checkout -- .env # or delete stale cache and re-run
Defensive patterns
Strategy: fallback
Validate before calling
if watch_files.iter().any(|p| !p.exists()) { /* rebuild cache */ } Try / catch
match env_cache::load(...) { Err(e) if e.to_string().contains("no longer exists") => recompute_env(), other => other? } Prevention
- Avoid deleting files that are part of the tracked env while a shell session is active.
- Restore tracked dotfiles with git before relying on cached env.
- Keep cache invalidation as a normal code path, not an error.
When it happens
Trigger: Calling `load` where a watch file with a nonzero expected_mtime is missing: the file was deleted/moved between caching and now, and expected_mtime != 0.
Common situations: A dotenv/config file watched by the cache was deleted, a git checkout removed a file, or a project directory was cleaned.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
- watch file mtime changed
- action prediction payload is too large
- cache agent did not return the rustc identity
- cache agent did not store the rustc identity
- cache agent returned an incomplete blob lookup response
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/50876de85751e675.
Report an issue: GitHub.
Appendix: source
Thrown at src/toolset/env_cache.rs:69
.map_err(|e| eyre::eyre!("failed to create cipher: {}", e))?;
let plaintext = cipher
.decrypt(&nonce, ciphertext)
.map_err(|e| eyre::eyre!("decryption failed: {}", e))?;
Ok(plaintext)
}
fn validate_watch_files(watch_files: &[PathBuf], expected_mtimes: &[u64]) -> Result<()> {
if watch_files.len() != expected_mtimes.len() {
bail!("watch file count mismatch");
}
for (path, expected_mtime) in watch_files.iter().zip(expected_mtimes.iter()) {
if !path.exists() {
// mtime=0 means file didn't exist when cached - skip if still doesn't exist
if *expected_mtime == 0 {
continue;
}
bail!("watch file no longer exists: {}", path.display());
}
if let Some(current_mtime) = get_file_mtime(path) {
if current_mtime != *expected_mtime {
bail!(
"watch file mtime changed: {} (expected: {}, current: {})",
path.display(),
expected_mtime,
current_mtime
);
}
} else {
bail!("could not get mtime for watch file: {}", path.display());
}
}
Ok(())
}
/// Represents the cached environment dataView on GitHub (pinned to 533346cc37)