{"record":{"id":"5e1708404d074e6e","repo":"jdx/mise","slug":"bootstrap-user-name-sets-move-home-without-hom","errorCode":null,"errorMessage":"bootstrap user '{name}' sets move_home without home","messagePattern":"bootstrap user '(.+?)' sets move_home without home","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/accounts.rs","lineNumber":356,"sourceCode":"        if config.state == AccountState::Absent\n            && (config.uid.is_some()\n                || config.group.is_some()\n                || config.groups.is_some()\n                || config.exclusive_groups\n                || config.home.is_some()\n                || config.shell.is_some()\n                || config.comment.is_some()\n                || config.system\n                || config.create_home.is_some()\n                || config.move_home)\n        {\n            bail!(\"absent bootstrap user '{name}' may only set state and remove_home\");\n        }\n        if config.exclusive_groups && config.groups.is_none() {\n            bail!(\"bootstrap user '{name}' sets exclusive_groups without groups\");\n        }\n        if config.move_home && config.home.is_none() {\n            bail!(\"bootstrap user '{name}' sets move_home without home\");\n        }\n        if let Some(group) = &config.group {\n            validate_name(\"group\", group)?;\n        }\n        if let Some(path) = &config.home {\n            validate_account_path(&name, \"home\", path)?;\n        }\n        if let Some(path) = &config.shell {\n            validate_account_path(&name, \"shell\", path)?;\n        }\n        if config\n            .comment\n            .as_ref()\n            .is_some_and(|comment| comment.contains([':', '\\n', '\\r']))\n        {\n            bail!(\"bootstrap user '{name}' comment must not contain ':', CR, or LF\");\n        }\n        let mut groups = config","sourceCodeStart":338,"sourceCodeEnd":374,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/system/accounts.rs#L338-L374","documentation":"UserRequest::from_toml rejects a user that sets move_home = true without home = \"<path>\". move_home asks usermod to relocate the existing home directory to a new path; with no home path declared there is no target to move to, so parsing fails with the user's name.","triggerScenarios":"A [bootstrap.users.<name>] table containing move_home = true but no home = \"/home/...\" entry, read while building bootstrap account requests.","commonSituations":"Renaming users and dropping the home line during refactor; assuming move_home works with a home derived from the username; config templates where home is conditionally omitted.","solutions":["Set the target home path: home = \"/home/newname\" alongside move_home = true.","If you only want to create the user with a home at a custom path, use create_home/home without move_home.","Drop move_home if no relocation is intended."],"exampleFix":"# before\n[bootstrap.users.build]\nstate = \"present\"\ngroup = \"build\"\nmove_home = true\n# after\n[bootstrap.users.build]\nstate = \"present\"\ngroup = \"build\"\nhome = \"/srv/build\"\nmove_home = true","handlingStrategy":"validation","validationCode":"python3 - <<'EOF'\nimport sys, tomllib\ncfg = tomllib.load(open('mise.toml','rb'))\nfor name, u in cfg.get('bootstrap', {}).get('users', {}).items():\n    if u.get('move_home') and 'home' not in u:\n        sys.exit(f\"user '{name}' sets move_home without home\")\nEOF","typeGuard":"def move_home_valid(u: dict) -> bool:\n    return ('home' in u) if u.get('move_home') else True","tryCatchPattern":null,"preventionTips":["move_home requires a target home path; always set home alongside it.","For new users, prefer home + create_home without move_home."],"tags":["mise","bootstrap","users","config-validation","home-directory"],"backgroundTag":"config-validation-failed","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}