{"record":{"id":"15135e0abe55815d","repo":"jdx/mise","slug":"target-overrides-are-not-supported-with-mode-track","errorCode":null,"errorMessage":"target overrides are not supported with mode = \"track\"","messagePattern":"target overrides are not supported with mode = \"track\"","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/files.rs","lineNumber":217,"sourceCode":"            .map_err(serde::de::Error::custom)?;\n        Ok(Self { target, selector })\n    }\n}\n\n/// Validate selector combinations and destination syntax before selecting a variant.\n/// Returns a `dotfiles.root`-relative implied source for a logical entry key.\nfn validate_file_variants(\n    target: &str,\n    source: Option<&str>,\n    content: Option<&str>,\n    mode: Option<&str>,\n    variants: &[FileVariant],\n) -> Result<Option<PathBuf>> {\n    let selectors: Vec<_> = variants.iter().map(|v| v.selector.clone()).collect();\n    crate::system::history::select::validate(&selectors)?;\n    let has_target_override = variants.iter().any(|v| v.target.is_some());\n    if has_target_override && mode == Some(\"track\") {\n        bail!(\"target overrides are not supported with mode = \\\"track\\\"\");\n    }\n    if has_target_override && content.is_some() {\n        bail!(\"destination variants with inline content are not supported\");\n    }\n    let implied_source = if has_target_override && source.is_none() {\n        if !variants.iter().all(|v| v.target.is_some()) {\n            bail!(\n                \"destination variants require an explicit source when any variant uses the entry key as its target\"\n            );\n        }\n        Some(logical_source_path(target)?)\n    } else {\n        None\n    };\n    if variants.is_empty() && resolve_target_arg(target).is_relative() {\n        bail!(\"target must be absolute or start with ~/\");\n    }\n    for variant in variants {","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/files.rs#L199-L235","documentation":"Thrown by `validate_file_variants` when a file entry that uses `mode = \"track\"` (tracking an existing destination file) also declares one or more `target` overrides on its variants. Target overrides redirect where a variant is written, which is incompatible with tracking mode, so the combination is rejected at config validation time.","triggerScenarios":"Declaring a file entry with mode = \"track\" where any variant sets a `target` field — detected by `variants.iter().any(|v| v.target.is_some())` combined with `mode == Some(\"track\")`, during validate_incoming_files or merge_file_entry.","commonSituations":"Copy-pasting a variants block from a symlink/managed entry into a tracked entry; intending to track one file but additionally deploy a variant elsewhere and assuming both features compose; migrating an entry from managed to track mode without cleaning up target overrides.","solutions":["Remove the `target` overrides from all variants of the tracked entry.","If the variant truly needs a different destination, split it into a separate non-track file entry.","If you need per-variant destinations, switch the entry out of track mode to the appropriate managed/symlink mode."],"exampleFix":"// before\n[[files]]\nsource = \"gitconfig\"\nmode = \"track\"\n[[files.variants]]\ntarget = \"~/.config/git/config\"\n// after\n[[files]]\nsource = \"gitconfig\"\nmode = \"track\"\n# no per-variant target overrides","handlingStrategy":"validation","validationCode":"// config-time check before loading entries\nif entry.mode == \"track\" && entry.variants.iter().any(|v| v.target.is_some()) {\n    bail!(\"tracked entry {} has variant target overrides\", entry.key);\n}","typeGuard":"fn track_entry_has_target_overrides(entry: &FileEntry) -> bool {\n    entry.mode.as_deref() == Some(\"track\")\n        && entry.variants.iter().any(|v| v.target.is_some())\n}","tryCatchPattern":null,"preventionTips":["Keep tracked entries variant-free or override-free by convention.","Split tracking entries and deployment entries into separate keys.","Validate config with a lint pass before running apply/sync."],"tags":["config","validation","dotfiles"],"backgroundTag":"conflicting-config-options","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}