jdx/mise · error

no watch could be installed for the tracked set

Error message

no watch could be installed for the tracked set

What it means

After attempting to install watches for all anchors, install checks that at least one watch succeeded while something wanted watching. If none could be installed, no event would ever arrive, so it fails fast instead of running blind; the service layer restarts the watcher later.

Solutions

  1. Check that the anchor paths still exist and are real directories tracked under home/config.
  2. Raise OS watch limits (fs.inotify.max_user_watches on Linux) if watches failed for MaxFilesWatch.
  3. Restart the history watcher service after fixing conditions; it retries installation.
  4. Ensure watched paths are not on network/unsupported filesystems (NFS, some FUSE mounts).

Example fix

// before: anchor directory removed but still tracked
rm -rf ~/config-dir
// after: recreate or untrack it
mkdir -p ~/config-dir && mise history track ~/config-dir
Defensive patterns

Strategy: retry

Validate before calling

// verify at least one anchor exists before installing
if wanted.iter().all(|a| !a.path.exists()) { eprintln!("no watchable anchors exist"); return; }

Try / catch

loop {
  match install_watches() {
    Ok(()) => break,
    Err(e) if e.to_string().contains("no watch could be installed") => { fix_conditions(); sleep(BACKOFF); }
    Err(e) => return Err(e),
  }
}

Prevention

When it happens

Trigger: install (called by run/reinstall) ends with `current.is_empty() && !wanted.is_empty()` — every debouncer.watch() call failed (e.g. all MaxFilesWatch after a partial install, paths deleted, or permission errors) while anchors were requested.

Common situations: System-wide watch exhaustion combined with transient anchor deletion; watched paths on network mounts that don't support inotify; every anchor directory removed while tracked.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/c255edeb9f682d5f. Report an issue: GitHub.

Appendix: source

Thrown at src/system/history/watch/runtime.rs:1442

            Err(err) => {
                let message = format!(
                    "cannot watch {}: {err}; reconciliation still saves it",
                    display_path(&anchor.path)
                );
                capture.health.watcher.degraded.push(message.clone());
                capture.out.emit(
                    "degraded",
                    &message,
                    json!({ "path": display_path(&anchor.path), "message": err.to_string() }),
                );
            }
        }
    }
    // nothing watched while something should be: no event would ever
    // arrive, so the caller stops (and the service restarts it) instead of
    // running blind until a reconciliation that may be disabled
    if current.is_empty() && !wanted.is_empty() {
        bail!("no watch could be installed for the tracked set");
    }
    capture.anchor_ids = current
        .iter()
        .filter_map(|anchor| {
            file_id::get_file_id(&anchor.path)
                .ok()
                .map(|id| (anchor.path.clone(), id))
        })
        .collect();
    Ok(current)
}

fn anchor_replaced(
    ids: &std::collections::BTreeMap<PathBuf, file_id::FileId>,
    path: &Path,
) -> bool {
    ids.get(path)
        .is_some_and(|before| file_id::get_file_id(path).ok().as_ref() != Some(before))

View on GitHub (pinned to 533346cc37)