jdx/mise · error

cannot verify ; use --force to remove it

Error message

cannot verify {}; use --force to remove it

What it means

`plan_expected_content` for a directory-source entry: if the source entry is not a regular file, mise has no content to compare against, and the only safe path is an explicit `--force` (remove without verification). Without `--force` it bails, naming the target, because it cannot prove the target is mise-managed.

Solutions

  1. Re-run unapply with `--force` to remove the unverifiable target
  2. Restore the source entry to a regular file so its content can be compared
  3. Manually inspect and remove the target if unsure

Example fix

// before
$ mise files unapply
error: cannot verify /home/u/.config/foo; use --force to remove it

// after
$ mise files unapply --force
Defensive patterns

Strategy: validation

Validate before calling

if !source.is_file() {
    warn(`source '${source}' is not a regular file; removal cannot be verified, --force required`);
}

Prevention

When it happens

Trigger: Unapply planning of an entry whose source is a directory/symlink/special file (not `is_file()`), `force` is false, and the target exists — e.g. symlink-each enumerating an entry backed by a non-regular file.

Common situations: A source entry became a symlink or directory after being applied (type changed on disk or in git), so the content-verification path no longer applies during unapply.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


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

Appendix: source

Thrown at src/system/files.rs:2898

    Ok(())
}

fn plan_regular_file(
    source: &Path,
    target: &Path,
    force: bool,
    paths: &mut IndexMap<PathBuf, ()>,
) -> Result<()> {
    if !target.exists() && !target.is_symlink() {
        return Ok(());
    }
    if source.is_file() {
        plan_expected_content(&file::read(source)?, target, force, paths)
    } else if force {
        paths.insert(target.to_path_buf(), ());
        Ok(())
    } else {
        bail!(
            "cannot verify {}; use --force to remove it",
            target.display_user()
        )
    }
}

fn plan_expected_content(
    expected: &[u8],
    target: &Path,
    force: bool,
    paths: &mut IndexMap<PathBuf, ()>,
) -> Result<()> {
    if force || (target.is_file() && !target.is_symlink() && file::read(target)? == expected) {
        paths.insert(target.to_path_buf(), ());
        Ok(())
    } else {
        bail!(
            "{} differs from its managed source; use --force to remove it",

View on GitHub (pinned to 533346cc37)