jdx/mise · error
target symlink points to
Error message
target symlink points to {}, use --force to remove it What it means
During `mise dot unapply` planning for symlink-mode entries, the target IS a symlink but its destination differs from the configured source. Because the link cannot be proven to be mise-owned, removing it could destroy a user-created link, so mise refuses and requires explicit `--force`.
Solutions
- Check where the link points (`readlink <target>`); if it is your own link, remove it manually.
- Update the `[dotfiles]` source path in config to match the link's actual destination, then unapply without force.
- Re-apply first (`mise dot apply`) so the link is re-created from the current source, then unapply.
- Use `mise dot unapply --force` if you are certain the symlink is safe to remove.
Example fix
// before: repo moved from ~/dotfiles to ~/repos/dotfiles // after: fix config source, then # [dotfiles]."~/.zshrc" # source = "~/repos/dotfiles/zshrc" mise dot unapply
Defensive patterns
Strategy: validation
Validate before calling
dest=$(readlink ~/.zshrc); [ "$dest" = "$HOME/dotfiles/zshrc" ] || echo "unexpected symlink dest: $dest"
Prevention
- Never re-point managed symlinks by hand; change config and re-apply.
- Keep the dotfiles repo at a stable path (or update config immediately after a move).
- Check `readlink` output of managed targets after repo relocations.
When it happens
Trigger: `mise dot unapply` on a `[dotfiles]` symlink entry whose target symlink resolves to a path other than the configured source (and does not point at the same underlying file), without `--force`.
Common situations: The dotfiles repo was moved or re-cloned to a new path, so the link's recorded destination no longer equals the new source path; the user manually re-pointed the symlink; config `source` was edited after applying.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- files: cannot unapply these entries
- target is not the managed symlink, use --force to remove it
- [dotfiles]." ": mode symlink-each requires a directory…
- files: cannot unapply these entries:\n
- mode symlink-each requires the source to be a directory
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/ebf08aecb0ee1ae5.
Report an issue: GitHub.
Appendix: source
Thrown at src/system/files.rs:2748
let mut paths = IndexMap::<PathBuf, ()>::new();
let mut cleanup_empty_dirs = false;
let mut conditional = false;
let mut clear_symlink_each_state = false;
match req.mode {
// A Windows file link that came out as a copy is planned by content further down; one
// that is a real symlink belongs here, where the link target is what identifies it as
// ours. `plan_expected_content` requires a non-symlink, so routing a symlink there
// would make unapply demand `--force`.
FileMode::Symlink
if !(cfg!(windows) && req.source.is_file() && !req.target.is_symlink()) =>
{
if req.target.is_symlink() {
let dest = std::fs::read_link(&req.target)?;
if opts.force || dest == req.source || points_at_same_file(&req.target, &req.source)
{
paths.insert(req.target.clone(), ());
} else {
bail!(
"target symlink points to {}, use --force to remove it",
dest.display_user()
);
}
} else if req.target.exists() {
if opts.force {
paths.insert(req.target.clone(), ());
} else {
bail!("target is not the managed symlink, use --force to remove it");
}
}
}
FileMode::SymlinkEach if !cfg!(windows) => {
clear_symlink_each_state = symlink_each_state_path(req).exists();
if req.target.is_symlink() || (req.target.exists() && !req.target.is_dir()) {
if opts.force {
paths.insert(req.target.clone(), ());
} else {View on GitHub (pinned to 533346cc37)