jdx/mise · error

conflicting managed file declarations for

Error message

conflicting managed file declarations for {}

  first:
    {}

  second:
    {}

What it means

Thrown when two config layers declare the same managed file path with declarations whose relevant attributes differ (e.g. different content source, mode, or ownership), detected while merging bootstrap config maps. Identical duplicate declarations are tolerated and deduplicated; only genuine conflicts bail. The error prints both conflicting declarations' conflict descriptions.

Solutions

  1. Compare the 'first' and 'second' descriptions in the error to see which attributes differ.
  2. Make the declarations identical across layers (if duplication is intentional) or remove one.
  3. Move the differing declaration to the single most-specific layer that should own the file.
  4. If both are needed, use different target paths for the two files.

Example fix

# before (project overrides user with different mode)
# user: /etc/motd mode=0644 ; project: /etc/motd mode=0600
# after: keep one authoritative declaration
[bootstrap.files."/etc/motd"]
mode = "0644"
Defensive patterns

Strategy: validation

Validate before calling

merged = {}
for layer in layers:
  for path, decl in layer.files.items():
    if path in merged and merged[path] != decl:
      raise SystemExit(f'conflicting managed file decl for {path}')
    merged[path] = decl

Prevention

When it happens

Trigger: The same file path appearing in multiple `bootstrap_config_maps()` layers (user, global, project, environment-specific configs) with differing file settings; an environment override changing a managed file's content or mode without intending to conflict.

Common situations: A project mise.toml overriding a managed file also declared in the user's global config with different permissions; team config drift where two environments redefine the same managed path; refactor leftovers duplicating a file declaration.

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


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/b9d8a152aba2ad8e. Report an issue: GitHub.

Appendix: source

Thrown at src/system/managed_files.rs:379

        .into_iter()
        .map(|(path, (file, base, origin))| {
            ManagedFileRequest::from_toml(config, path, file, &base, origin, secrets)
        })
        .collect()
}

fn merged_files_from_config(
    config: &Config,
) -> Result<IndexMap<PathBuf, (ManagedFileTomlConfig, PathBuf, ResourceOrigin)>> {
    let mut composed: IndexMap<PathBuf, (ManagedFileTomlConfig, PathBuf, ResourceOrigin)> =
        IndexMap::new();
    for config_files in config.bootstrap_config_maps() {
        for (path, declaration) in merged_files_from_config_files(config_files)? {
            if let Some(existing) = composed.get(&path) {
                if managed_file_declarations_match(existing, &declaration) {
                    continue;
                }
                bail!(
                    "conflicting managed file declarations for {}\n\n  first:\n    {}\n\n  second:\n    {}",
                    path.display(),
                    existing.2.conflict_description(),
                    declaration.2.conflict_description(),
                );
            }
            composed.insert(path, declaration);
        }
    }
    Ok(composed)
}

/// Returns whether sibling declarations produce the same managed file.
fn managed_file_declarations_match(
    first: &(ManagedFileTomlConfig, PathBuf, ResourceOrigin),
    second: &(ManagedFileTomlConfig, PathBuf, ResourceOrigin),
) -> bool {
    first.0 == second.0

View on GitHub (pinned to 533346cc37)