{"record":{"id":"26f8d49270917d74","repo":"jdx/mise","slug":"source-directory-is-missing-so-managed-children-c","errorCode":null,"errorMessage":"source directory is missing, so managed children cannot be identified","messagePattern":"source directory is missing, so managed children cannot be identified","errorType":"exception","errorClass":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/system/files.rs","lineNumber":1581,"sourceCode":"            }\n        }\n        FileMode::Copy | FileMode::SymlinkEach if req.source.is_dir() => {\n            if req.target.is_symlink() || (req.target.exists() && !req.target.is_dir()) {\n                if opts.force {\n                    paths.insert(req.target.clone(), ());\n                } else {\n                    bail!(\"target is not the managed directory, use --force to remove it\");\n                }\n            } else if req.target.is_dir() {\n                for (source, target) in walk_source_files(req)? {\n                    plan_regular_file(&source, &target, opts.force, &mut paths)?;\n                }\n                cleanup_empty_dirs = true;\n            }\n        }\n        FileMode::Copy => {\n            if req.target.is_dir() && !req.source.exists() {\n                bail!(\"source directory is missing, so managed children cannot be identified\");\n            }\n            plan_single_file(req, opts, &mut paths)?;\n        }\n        FileMode::Content => {\n            if !req.target.exists() && !req.target.is_symlink() {\n                return Ok(None);\n            }\n            if opts.force {\n                paths.insert(req.target.clone(), ());\n            } else {\n                plan_inline_file(req, &mut paths)?;\n            }\n        }\n        FileMode::Symlink => {\n            plan_single_file(req, opts, &mut paths)?;\n        }\n        FileMode::SymlinkEach => {\n            bail!(\"mode symlink-each requires the source to be a directory\");","sourceCodeStart":1563,"sourceCodeEnd":1599,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/system/files.rs#L1563-L1599","documentation":"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.","triggerScenarios":"`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.","commonSituations":"Dotfiles repo reorganized (dir renamed) without updating mise.toml; source in a submodule that was not initialized; absolute path from another machine.","solutions":["Restore or re-point the source directory (git checkout, fix the `source` path in mise.toml), then unapply","If the copied tree is disposable, `mise bootstrap dotfiles unapply --force`","Delete the `[dotfiles]` entry if you no longer manage that target"],"exampleFix":"# before: source dir was moved in the dotfiles repo\n$ ls ~/dotfiles/ssh-old   # config still says source = \"~/dotfiles/ssh-old\"\nls: cannot access '~/dotfiles/ssh-old': No such file or directory\n$ mise bootstrap dotfiles unapply\nError: source directory is missing, so managed children cannot be identified\n\n# after: fix the path (or restore the dir), then unapply\n$ sed -i 's#~/dotfiles/ssh-old#~/dotfiles/ssh#' mise.toml\n$ mise bootstrap dotfiles unapply --dry-run && mise bootstrap dotfiles unapply","handlingStrategy":"validation","validationCode":"# Verify every dotfiles source path exists before unapplying.\nmise config ls 2>/dev/null || true\nfor p in ~/dotfiles/ssh ~/dotfiles/nvim; do\n  [ -e \"$p\" ] || { echo \"missing source: $p\"; exit 1; }\ndone","typeGuard":"fn is_missing_source_dir(err: &miette::Report) -> bool {\n    err.to_string().contains(\n        \"source directory is missing, so managed children cannot be identified\",\n    )\n}","tryCatchPattern":null,"preventionTips":["Keep `source` paths relative to the repo and machine-independent","Run `git mv` + config update together when reorganizing dotfiles","Ensure submodules holding sources are initialized on every machine"],"tags":["mise","dotfiles","copy","missing-source","unapply"],"backgroundTag":"missing-source-file","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T20:17:18.057Z"}