{"record":{"id":"7140d021071bbc52","repo":"jdx/mise","slug":"dotfiles-is-still-tracked","errorCode":null,"errorMessage":"dotfiles: {} is still tracked","messagePattern":"dotfiles: (.+?) is still tracked","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/dotfiles/untrack.rs","lineNumber":169,"sourceCode":"                table.insert(\"enabled\", Value::Boolean(toml_edit::Formatted::new(false)));\n                doc[\"dotfiles\"][&key] = Item::Value(Value::InlineTable(table));\n                file::write(&local, doc.to_string())?;\n                info!(\n                    \"dotfiles: {key} is also declared in {}; switched off in {}\",\n                    entry\n                        .declared_in\n                        .as_deref()\n                        .map(display_path)\n                        .unwrap_or_else(|| \"another layer\".into()),\n                    display_path(&local)\n                );\n                config = Config::reset().await?;\n                tracked = TrackedSet::from_config(&config)?;\n                if tracked\n                    .entry_for(&path)\n                    .is_some_and(|entry| entry.path == path)\n                {\n                    bail!(\"dotfiles: {} is still tracked\", display_path(&path));\n                }\n            }\n        }\n        // A capture command may invoke untrack itself. Its parent holds the\n        // operation lock and records the new enrollment in its outcome; do\n        // not wait on that parent or commit a competing boundary here.\n        if std::env::var_os(crate::system::history::scope::ENV_VAR).is_some()\n            || crate::system::history::scope::is_active()\n        {\n            info!(\n                \"dotfiles: tracking stopped; the enclosing operation will record the change. Live files and earlier committed versions remain\"\n            );\n            return Ok(());\n        }\n        let store = crate::system::history::checkpoint::Store::open()?;\n        let mut draft = crate::system::history::checkpoint::Draft::new(\n            crate::system::history::store::Trigger::Save,\n        );","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cli/dotfiles/untrack.rs#L151-L187","documentation":"After attempting to remove tracking (rewinding config and reloading TrackedSet), untrack verifies the path is genuinely gone from the tracked set. If an entry still exists for the exact path, the untrack did not take effect and the command fails rather than leaving inconsistent state.","triggerScenarios":"`mise dotfiles untrack` re-reads config (Config::reset) and finds entry_for(path) still matching the exact path — the removal from config did not persist or a parent/sibling declaration still tracks the exact path.","commonSituations":"Concurrent dotfiles command rewrote the config; the path was declared in multiple config layers (local + global); a capture command re-enrolled it during the operation.","solutions":["Re-run `mise dotfiles untrack` (transient reload race resolves itself)","Inspect all config layers (`~/.config/mise/config.toml`, project config, config.local.toml) for a duplicate declaration of the target and remove the extra one","Check for other running mise dotfiles processes that may re-enroll the path"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"# no tracked entry should exist for the path before untrack\n! mise dotfiles ls | grep -Fx -- \"$path\" || echo \"already declared elsewhere\"","typeGuard":null,"tryCatchPattern":"mise dotfiles untrack \"$path\" || {\n  sleep 1\n  mise dotfiles untrack \"$path\"   # retry once; config reload race\n}","preventionTips":["Avoid running concurrent mise dotfiles commands","Keep target declarations in one config layer to prevent duplicates","After failure, grep all mise config files for the target"],"tags":["dotfiles","state","config","consistency"],"backgroundTag":"invalid-state-transition","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}