jdx/mise · error · eyre::Report

source directory is missing, so managed children cannot be i

Error message

source directory is missing, so managed children cannot be identified

What it means

For a `copy`-mode entry whose target is a directory, mise must walk the source directory to know which target children it owns. If the source directory no longer exists, managed children cannot be identified and the unapply aborts; only `--force` (which removes the target without per-child verification) proceeds.

Source

Thrown at src/system/files.rs:1581

            }
        }
        FileMode::Copy | FileMode::SymlinkEach if req.source.is_dir() => {
            if req.target.is_symlink() || (req.target.exists() && !req.target.is_dir()) {
                if opts.force {
                    paths.insert(req.target.clone(), ());
                } else {
                    bail!("target is not the managed directory, use --force to remove it");
                }
            } else if req.target.is_dir() {
                for (source, target) in walk_source_files(req)? {
                    plan_regular_file(&source, &target, opts.force, &mut paths)?;
                }
                cleanup_empty_dirs = true;
            }
        }
        FileMode::Copy => {
            if req.target.is_dir() && !req.source.exists() {
                bail!("source directory is missing, so managed children cannot be identified");
            }
            plan_single_file(req, opts, &mut paths)?;
        }
        FileMode::Content => {
            if !req.target.exists() && !req.target.is_symlink() {
                return Ok(None);
            }
            if opts.force {
                paths.insert(req.target.clone(), ());
            } else {
                plan_inline_file(req, &mut paths)?;
            }
        }
        FileMode::Symlink => {
            plan_single_file(req, opts, &mut paths)?;
        }
        FileMode::SymlinkEach => {
            bail!("mode symlink-each requires the source to be a directory");

View on GitHub (pinned to 6f52dcdf99)

Solutions

  1. Restore or re-point the source directory (git checkout, fix the `source` path in mise.toml), then unapply
  2. If the copied tree is disposable, `mise bootstrap dotfiles unapply --force`
  3. Delete the `[dotfiles]` entry if you no longer manage that target

Example fix

# before: source dir was moved in the dotfiles repo
$ ls ~/dotfiles/ssh-old   # config still says source = "~/dotfiles/ssh-old"
ls: cannot access '~/dotfiles/ssh-old': No such file or directory
$ mise bootstrap dotfiles unapply
Error: source directory is missing, so managed children cannot be identified

# after: fix the path (or restore the dir), then unapply
$ sed -i 's#~/dotfiles/ssh-old#~/dotfiles/ssh#' mise.toml
$ mise bootstrap dotfiles unapply --dry-run && mise bootstrap dotfiles unapply
Defensive patterns

Strategy: validation

Validate before calling

# Verify every dotfiles source path exists before unapplying.
mise config ls 2>/dev/null || true
for p in ~/dotfiles/ssh ~/dotfiles/nvim; do
  [ -e "$p" ] || { echo "missing source: $p"; exit 1; }
done

Type guard

fn is_missing_source_dir(err: &miette::Report) -> bool {
    err.to_string().contains(
        "source directory is missing, so managed children cannot be identified",
    )
}

Prevention

When it happens

Trigger: `unapply` of a copy entry where `req.target.is_dir()` and `!req.source.exists()` — the source directory was deleted or moved, its path in mise.toml is wrong (typo, machine-specific absolute path), or it lives in an uncloned submodule.

Common situations: Dotfiles repo reorganized (dir renamed) without updating mise.toml; source in a submodule that was not initialized; absolute path from another machine.

Related errors


AI-assisted analysis of jdx/mise@6f52dcdf99 (2026-08-22). Data as JSON: /api/errors/26f8d49270917d74. Report an issue: GitHub.