jdx/mise · error

files

Error message

files: {}

What it means

This is the aggregate pre-flight error of the dotfiles apply planner. Instead of failing on the first bad entry, the planner collects three problem classes — missing sources, entries whose rendered content/state checks failed, and existing target files that would be overwritten — and reports them all at once under a `files:` prefix so one bad entry cannot hide the rest.

Solutions

  1. Read each `files:` sub-section in the message: 'sources do not exist', 'entries with errors', and 'refusing to overwrite existing files' pinpoint the offending `[dotfiles]."<target>"` entries.
  2. Fix or remove entries with missing sources in the mise config (`[dotfiles]` section).
  3. Fix template errors (bad syntax, missing secrets referenced by the template).
  4. Back up and remove the conflicting existing files, or re-run with `--force` once you are sure overwriting them is intended.

Example fix

// before: target ~/.zshrc exists but is not managed, apply fails
mise dot apply
// files: refusing to overwrite existing files...
// after
mise dot apply --force   # or manually mv ~/.zshrc ~/.zshrc.bak first
Defensive patterns

Strategy: validation

Validate before calling

mise dot apply --dry-run  # or run apply with dry-run first; it lists all problems in one pass

Prevention

When it happens

Trigger: `mise dot apply` when any `[dotfiles]` entry has a non-existent source path, a template that fails to render or a state check failure, or an existing unmanaged target file while `--force` was not passed (mode depends: symlink/copy/template conflicts).

Common situations: A dotfile source was renamed or deleted; a template contains a bad `exec()` or secret reference; the target file already exists from a previous manual setup; dry-running with an unrenderable template.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at src/system/files.rs:2497

            missing_sources.join("\n")
        ));
    }
    if !broken.is_empty() {
        problems.push(format!("entries with errors:\n{}", broken.join("\n")));
    }
    if !conflicts.is_empty() && !opts.force {
        problems.push(format!(
            "refusing to overwrite existing files ({}):\n{}",
            opts.force_hint,
            conflicts
                .iter()
                .map(|p| format!("  {}", p.display_user()))
                .collect::<Vec<_>>()
                .join("\n")
        ));
    }
    if !problems.is_empty() {
        bail!("files: {}", problems.join("\nfiles: "));
    }
    Ok(ApplyPlan {
        todo,
        record_symlink_each,
        reconciliation: plan_symlink_each_reconciliation(active_requests, requests)?,
    })
}

fn cleanup_reconciled_directories(reconciliation: &SymlinkEachReconciliation) -> Result<()> {
    for target in &reconciliation.targets {
        for start in reconciliation
            .stale_links
            .iter()
            .filter(|link| link.target.starts_with(target))
            .filter_map(|link| link.target.parent())
            .sorted_by_key(|path| std::cmp::Reverse(path.components().count()))
            .unique()
        {

View on GitHub (pinned to 533346cc37)