jdx/mise · error
conflicting managed directory declarations for
Error message
conflicting managed directory declarations for {}
first:
{}
second:
{} What it means
Thrown when merging managed directory declarations across config layers for the same path whose declaration values differ (e.g. different create/remove semantics or attributes), while composing directories from bootstrap config maps. Exactly-equal duplicate declarations are deduplicated silently; a real conflict stops validation with both declarations' conflict descriptions in the message.
Solutions
- Read the 'first'/'second' conflict descriptions to identify the differing attribute.
- Align the declarations across layers or delete one of them.
- Concentrate the authoritative directory declaration in the most specific layer intended to own it.
Example fix
# before: global says {create=true}, project says {create=false} for /var/log/myapp
# after: single declaration in the owning layer
[bootstrap.directories]
"/var/log/myapp" = { create = true } Defensive patterns
Strategy: validation
Validate before calling
seen = {}
for layer in layers:
for path, decl in layer.directories.items():
if path in seen and seen[path] != decl:
raise SystemExit(f'conflicting directory decl for {path}')
seen[path] = decl Prevention
- Declare each managed directory once, in its owning layer.
- Keep directory options identical across layers if duplication is required.
- Review directory overrides when adding new config layers.
When it happens
Trigger: The same directory path declared in multiple bootstrap config layers with differing flags/attributes; an environment-specific config overriding a directory declaration's settings unintentionally.
Common situations: Global config declares `/var/log/myapp` as managed and a project config redeclares it with different options; refactors that change directory semantics in one layer only; two included config files diverging over time.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- conflicting managed file declarations for
- managed directory paths
- bootstrap service ' ' cannot be both masked and running
- bootstrap service ' ' cannot be both masked and enabled
- conflicting bootstrap secret declarations for
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/cbc337413d8a3c1e.
Report an issue: GitHub.
Appendix: source
Thrown at src/system/managed_files.rs:455
merged
.entry(target)
.or_insert_with(|| (file, base.clone(), file_origin));
}
}
}
Ok(merged)
}
fn directories_from_config(config: &Config) -> Result<Vec<ManagedDirectoryRequest>> {
let mut composed: IndexMap<PathBuf, (ManagedDirectoryTomlConfig, ResourceOrigin)> =
IndexMap::new();
for config_files in config.bootstrap_config_maps() {
for (path, declaration) in directories_from_config_files(config_files)? {
if let Some(existing) = composed.get(&path) {
if existing.0 == declaration.0 {
continue;
}
bail!(
"conflicting managed directory declarations for {}\n\n first:\n {}\n\n second:\n {}",
path.display(),
existing.1.conflict_description(),
declaration.1.conflict_description(),
);
}
composed.insert(path, declaration);
}
}
composed
.into_iter()
.map(|(path, (config, origin))| ManagedDirectoryRequest::from_toml(path, config, origin))
.collect()
}
/// Merges managed directories within one config hierarchy using normal precedence.
fn directories_from_config_files(
config_files: &ConfigMap,View on GitHub (pinned to 533346cc37)