{"record":{"id":"e453ffc53a00c0b1","repo":"jdx/mise","slug":"target-raw-is-not-tracked","errorCode":null,"errorMessage":"{target_raw} is not tracked","messagePattern":"(.+?) is not tracked","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/dotfiles/untrack.rs","lineNumber":80,"sourceCode":"                            \"dotfiles: {key} is declared in {}; switched off in {}\",\n                            display_path(declared_in),\n                            display_path(&local)\n                        );\n                        touched.push(local.clone());\n                    } else {\n                        let mut doc = super::track::read_document(declared_in)?;\n                        if let Some(table) = doc[\"dotfiles\"].as_table_mut() {\n                            table.remove(&req.target_raw);\n                        }\n                        file::write(declared_in, doc.to_string())?;\n                        info!(\"dotfiles: {key} removed from {}\", display_path(declared_in));\n                        touched.push(declared_in.clone());\n                    }\n                }\n                None => {\n                    // A child of an explicitly tracked directory: exclude it.\n                    let Some(owner) = tracked.entry_for(&path) else {\n                        bail!(\"{target_raw} is not tracked\");\n                    };\n                    if owner.path == path {\n                        // Keep explicit intent visible to an enclosing capture\n                        // too, even when enrollment came only from Git.\n                        let mut doc = super::track::read_document(&local)?;\n                        let mut table = toml_edit::InlineTable::new();\n                        table.insert(\"mode\", Value::from(\"track\"));\n                        table.insert(\"enabled\", Value::from(false));\n                        doc[\"dotfiles\"][&key] = Item::Value(Value::InlineTable(table));\n                        if let Some(parent) = local.parent() {\n                            file::create_dir_all(parent)?;\n                        }\n                        file::write(&local, doc.to_string())?;\n                        touched.push(local.clone());\n                        continue;\n                    }\n                    let glob = if path.is_dir() {\n                        format!(\"{key}/**\")","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cli/dotfiles/untrack.rs#L62-L98","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Run `mise dotfiles ls` and use the exact tracked target string","If it lives under a tracked directory, untrack the directory entry that owns it instead","Verify the path normalization (symlinks, ~ vs absolute) matches how it was tracked"],"exampleFix":"// before\nmise dotfiles untrack ~/.config/nvim/lua/old.lua\n// after\nmise dotfiles untrack ~/.config/nvim","handlingStrategy":"validation","validationCode":"# confirm the exact target is tracked first\nmise dotfiles ls | grep -Fx -- \"$target\" || echo \"not tracked exactly as given\"","typeGuard":null,"tryCatchPattern":"mise dotfiles untrack \"$target\" 2>&1 | grep -q 'is not tracked' && mise dotfiles ls","preventionTips":["Use exact tracked names from `mise dotfiles ls`","Untrack the owning directory entry for files inside tracked directories","Watch for symlink/case normalization differences"],"tags":["dotfiles","not-tracked","cli","path"],"backgroundTag":"record-not-found","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}