{"record":{"id":"35b96e46bd80a89a","repo":"jdx/mise","slug":"files-cannot-unapply-these-entries","errorCode":null,"errorMessage":"files: cannot unapply these entries:\n{}","messagePattern":"files: cannot unapply these entries:\n(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/files.rs","lineNumber":2573,"sourceCode":"/// Remove configured whole-file entries without recursively deleting\n/// directories that may contain unmanaged files. Symlinks carry their own\n/// ownership evidence. Copies and templates must still match their source\n/// unless `--force` was given.\npub(crate) fn plan_unapply<'a>(\n    requests: &'a [FileRequest],\n    opts: &UnapplyOpts,\n) -> Result<Vec<UnapplyPlan<'a>>> {\n    let mut todo = vec![];\n    let mut problems = vec![];\n    for req in requests {\n        match plan_unapply_one(req, opts) {\n            Ok(Some(plan)) => todo.push(plan),\n            Ok(None) => {}\n            Err(err) => problems.push(format!(\"  [dotfiles].\\\"{}\\\": {err}\", req.target_raw)),\n        }\n    }\n    if !problems.is_empty() {\n        bail!(\n            \"files: cannot unapply these entries:\\n{}\",\n            problems.join(\"\\n\")\n        );\n    }\n    Ok(todo)\n}\n\n/// Resolve checks that may execute user-authored template functions. This runs\n/// only after interactive confirmation, but still before any mutation.\npub(crate) fn resolve_unapply(\n    config: &Config,\n    plans: &mut Vec<UnapplyPlan<'_>>,\n    opts: &UnapplyOpts,\n    secrets: &SecretValues,\n) -> Result<()> {\n    if opts.dry_run {\n        return Ok(());\n    }","sourceCodeStart":2555,"sourceCodeEnd":2591,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/files.rs#L2555-L2591","documentation":"Aggregate error from `plan_unapply`, the first (pre-confirmation) planning pass of `mise dot unapply`. Each configured entry is inspected to decide which paths are safely removable; any entry whose planning fails (e.g. the target symlink points elsewhere, target is not the managed file, source directory missing) is collected and reported together, and no removal happens.","triggerScenarios":"`mise dot unapply` where one or more entries fail `plan_unapply_one`: target symlink points at a different destination, target exists but is not the managed symlink/directory, or (Copy mode) the source directory is missing so managed children cannot be identified.","commonSituations":"The user replaced a managed dotfile with their own file or pointed the symlink somewhere else; the dotfiles source repo was deleted before unapplying; a mode was changed in config after applying (symlink -> copy) leaving the target in the old shape.","solutions":["Inspect each listed `[dotfiles].\"<target>\"` entry manually to see what its target now contains.","If the target is intentionally yours (not mise-managed), re-run with `mise dot unapply --force` to remove it anyway.","Restore the missing source directory (e.g. re-clone the dotfiles repo) so Copy-mode children can be identified.","Remove the stale entry from the `[dotfiles]` config if it is no longer wanted."],"exampleFix":"// before\nmise dot unapply\n// files: cannot unapply these entries:\n//   [dotfiles].\"~/.vimrc\": target symlink points to /etc/vimrc, use --force...\n// after\nmise dot unapply --force   # only after confirming /etc/vimrc replacement is OK","handlingStrategy":"try-catch","validationCode":"for each [dotfiles] entry: test -e <source> && readlink <target>  # confirm target is still the managed symlink","typeGuard":null,"tryCatchPattern":"// Rust/eyre caller pattern\nmatch plan_unapply(&requests, &opts) {\n    Err(e) if e.to_string().starts_with(\"files: cannot unapply these entries:\") => {\n        // inspect listed entries; decide on --force or manual cleanup\n    }\n    r => r?,\n}","preventionTips":["Don't hand-edit or replace managed dotfile targets; re-apply via mise instead.","Update the config `source` path whenever the dotfiles repo moves.","Run unapply before deleting the dotfiles source repo."],"tags":["dotfiles","unapply","symlink"],"backgroundTag":"invalid-argument-value","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}