jdx/mise · error

{target_raw} is not tracked

Error message

{target_raw} is not tracked

What it means

When untracking a path that is a child of an explicitly tracked directory, the code looks up which tracked entry owns the path. If no tracked entry covers it (entry_for returns None), the path is not actually enrolled in tracking and the command bails.

Source

Thrown at src/cli/dotfiles/untrack.rs:80

                            "dotfiles: {key} is declared in {}; switched off in {}",
                            display_path(declared_in),
                            display_path(&local)
                        );
                        touched.push(local.clone());
                    } else {
                        let mut doc = super::track::read_document(declared_in)?;
                        if let Some(table) = doc["dotfiles"].as_table_mut() {
                            table.remove(&req.target_raw);
                        }
                        file::write(declared_in, doc.to_string())?;
                        info!("dotfiles: {key} removed from {}", display_path(declared_in));
                        touched.push(declared_in.clone());
                    }
                }
                None => {
                    // A child of an explicitly tracked directory: exclude it.
                    let Some(owner) = tracked.entry_for(&path) else {
                        bail!("{target_raw} is not tracked");
                    };
                    if owner.path == path {
                        // Keep explicit intent visible to an enclosing capture
                        // too, even when enrollment came only from Git.
                        let mut doc = super::track::read_document(&local)?;
                        let mut table = toml_edit::InlineTable::new();
                        table.insert("mode", Value::from("track"));
                        table.insert("enabled", Value::from(false));
                        doc["dotfiles"][&key] = Item::Value(Value::InlineTable(table));
                        if let Some(parent) = local.parent() {
                            file::create_dir_all(parent)?;
                        }
                        file::write(&local, doc.to_string())?;
                        touched.push(local.clone());
                        continue;
                    }
                    let glob = if path.is_dir() {
                        format!("{key}/**")

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Run `mise dotfiles ls` and use the exact tracked target string
  2. If it lives under a tracked directory, untrack the directory entry that owns it instead
  3. Verify the path normalization (symlinks, ~ vs absolute) matches how it was tracked

Example fix

// before
mise dotfiles untrack ~/.config/nvim/lua/old.lua
// after
mise dotfiles untrack ~/.config/nvim
Defensive patterns

Strategy: validation

Validate before calling

# confirm the exact target is tracked first
mise dotfiles ls | grep -Fx -- "$target" || echo "not tracked exactly as given"

Try / catch

mise dotfiles untrack "$target" 2>&1 | grep -q 'is not tracked' && mise dotfiles ls

Prevention

When it happens

Trigger: Running `mise dotfiles untrack <path>` where the path is only a child of a tracked directory but no entry_for match exists — i.e. it was never tracked, or it was tracked under a different normalized path than requested.

Common situations: Untracking a file inside a tracked directory that was explicitly excluded; stale target name after files moved; case/symlink normalization differences between the argument and the tracked key.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


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