{"record":{"id":"83110bbed5f493d0","repo":"jdx/mise","slug":"target-raw-target-must-be-absolute-or-start-wit-83110b","errorCode":null,"errorMessage":"{target_raw}: target must be absolute or start with ~/","messagePattern":"(.+?): target must be absolute or start with ~/","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/dotfiles/untrack.rs","lineNumber":38,"sourceCode":"    #[usage(value_name = \"PATH\", required = true)]\n    targets: Vec<String>,\n}\n\nimpl DotfilesUntrack {\n    pub(crate) async fn run(self) -> Result<()> {\n        let _declarations = super::track::declaration_lock()?;\n        let config = Config::get().await?;\n        let managed = crate::system::files::files_from_config(&config)?;\n        let tracked = TrackedSet::effective().await?;\n        let global = crate::config::global_shared_config_path();\n        let local = super::track::declaration_file(true)?;\n        let mut touched: Vec<PathBuf> = vec![];\n        for target_raw in &self.targets {\n            let target = crate::system::files::resolve_target_arg(target_raw)\n                .components()\n                .collect::<PathBuf>();\n            if target.is_relative() {\n                bail!(\"{target_raw}: target must be absolute or start with ~/\");\n            }\n            let key = super::track::normalized_target(&target);\n            let path = normalize_target(&target);\n            match managed\n                .iter()\n                .find(|req| req.target == target && req.mode == FileMode::Track)\n            {\n                Some(req) => {\n                    let declared_in = &req.origin.config;\n                    if crate::config::is_system_config(declared_in)\n                        || !crate::config::is_global_config(declared_in)\n                    {\n                        // inherited: switch it off on this machine\n                        let mut doc = super::track::read_document(&local)?;\n                        let mut table = toml_edit::InlineTable::new();\n                        table.insert(\n                            \"mode\",\n                            Value::String(toml_edit::Formatted::new(\"track\".into())),","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cli/dotfiles/untrack.rs#L20-L56","documentation":"untrack resolves each target argument via resolve_target_arg and requires the result to be absolute (possibly via ~/ expansion). Relative targets cannot be mapped onto the tracked set unambiguously, so the command rejects them before doing work.","triggerScenarios":"Running `mise dotfiles untrack <target>` where the target neither is an absolute path nor begins with `~/` — e.g. `mise dotfiles untrack .vimrc` or `untrack src/../dotfiles` after component normalization resolves to a relative path.","commonSituations":"Typing a bare filename because `track` accepted a relative-ish form interactively; running from the dotfiles directory and assuming relative paths work; shell expansion stripping the leading `~`.","solutions":["Use an absolute path: `mise dotfiles untrack /home/me/.vimrc`","Use `~/` expansion: `mise dotfiles untrack ~/.vimrc`","Quote the argument so the shell does not mangle `~`"],"exampleFix":"// before\nmise dotfiles untrack .config/starship.toml\n// after\nmise dotfiles untrack ~/.config/starship.toml","handlingStrategy":"validation","validationCode":"# validate target before calling untrack\ncase \"$target\" in\n  /*|~/*) mise dotfiles untrack \"$target\" ;;\n  *) echo \"use absolute or ~/ path\" ;;\nesac","typeGuard":null,"tryCatchPattern":"mise dotfiles untrack \"$target\" || echo \"provide an absolute or ~/-prefixed path\"","preventionTips":["Always pass absolute or ~/ paths to untrack","Quote arguments so ~ reaches mise unexpanded-or-expanded consistently","Test the path with `realpath -m` first"],"tags":["cli","dotfiles","path","argument"],"backgroundTag":"invalid-argument-format","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"}