{"record":{"id":"323b7ddc813a5309","repo":"jdx/mise","slug":"managed-directory-paths-previous-and-path","errorCode":null,"errorMessage":"managed directory paths '{previous}' and '{path}' normalize to the same target '{}'","messagePattern":"managed directory paths '(.+?)' and '(.+?)' normalize to the same target '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/managed_files.rs","lineNumber":369,"sourceCode":"                        target.display()\n                    );\n                }\n                merged.entry(target).or_insert_with(|| (file, base.clone()));\n            }\n        }\n    }\n    Ok(merged)\n}\n\nfn directories_from_config(config: &Config) -> Result<Vec<ManagedDirectoryRequest>> {\n    let mut merged: IndexMap<PathBuf, ManagedDirectoryTomlConfig> = IndexMap::new();\n    for cf in config.config_files.values() {\n        if let Some(bootstrap) = cf.bootstrap_config() {\n            let mut layer_paths = IndexMap::new();\n            for (path, directory) in bootstrap.directories {\n                let target = absolute_target(&path)?;\n                if let Some(previous) = layer_paths.insert(target.clone(), path.clone()) {\n                    bail!(\n                        \"managed directory paths '{previous}' and '{path}' normalize to the same target '{}'\",\n                        target.display()\n                    );\n                }\n                merged.entry(target).or_insert(directory);\n            }\n        }\n    }\n    merged\n        .into_iter()\n        .map(|(path, config)| ManagedDirectoryRequest::from_toml(path, config))\n        .collect()\n}\n\nfn validate_requests(\n    files: &[ManagedFileRequest],\n    directories: &[ManagedDirectoryRequest],\n) -> Result<()> {","sourceCodeStart":351,"sourceCodeEnd":387,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/system/managed_files.rs#L351-L387","documentation":"Same-layer duplicate detection as error 604, but for the `[bootstrap.directories]` table: two directory entries in one config file whose declared paths normalize to the same absolute target via absolute_target() (managed_files.rs:364-371). Because directory entries carry owner/group/mode/state, two conflicting declarations cannot be merged field-wise, so mise refuses rather than picking one arbitrarily.","triggerScenarios":"A single mise.toml with `[bootstrap.directories.\"/srv/app\"]` and `[bootstrap.directories.\"/srv/./app\"]` (or `\"srv/app\"` and `\"./srv/app\"` relative to the config dir) — string-distinct keys whose normalized absolute targets are identical.","commonSituations":"Generated config emitted by templates that join paths inconsistently (with/without leading `./` or redundant separators); incrementally appended entries during bootstrap development where the earlier spelling was forgotten; refactors that changed from relative to absolute paths without removing old entries.","solutions":["Delete one of the colliding entries and keep the fully-specified one","Normalize path spellings to absolute paths throughout the table to make future collisions obvious at a glance","If duplicate intent was layering (base + override), split the entries across different config files so the merge logic (later layer wins) applies"],"exampleFix":"# before\n[bootstrap.directories.\"/srv/app\"]\nowner = \"app\"\n[bootstrap.directories.\"/srv/./app\"]\nowner = \"app\"\n\n# after\n[bootstrap.directories.\"/srv/app\"]\nowner = \"app\"","handlingStrategy":"validation","validationCode":"// Same check as 604 but for the directories table\nlet mut seen = HashSet::new();\nfor key in bootstrap_directories_keys(config_file) {\n    let t = absolute(base_dir, normalize(key));\n    assert!(seen.insert(t), \"duplicate directory target in this config file\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer absolute paths in [bootstrap.directories]","When generating directories programmatically, key the generator on the normalized path, not the raw string","CI lint: fail on normalized-path duplicates within each layer"],"tags":["bootstrap","config-validation","path-normalization","duplicate-key","managed-files"],"backgroundTag":"path-normalization-collision","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}