{"record":{"id":"b26e600f9a033afc","repo":"jdx/mise","slug":"present-bootstrap-user-name-must-not-set-remov","errorCode":null,"errorMessage":"present bootstrap user '{name}' must not set remove_home","messagePattern":"present bootstrap user '(.+?)' must not set remove_home","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/accounts.rs","lineNumber":336,"sourceCode":"            ResourceAction::Update => Ok(Some(AccountAction::UpdateGroup {\n                name: self.name.clone(),\n                gid: self.gid.expect(\"group update requires a desired gid\"),\n            })),\n            ResourceAction::Remove => Ok(Some(AccountAction::RemoveGroup {\n                name: self.name.clone(),\n            })),\n        }\n    }\n}\n\nimpl UserRequest {\n    fn from_toml(name: String, config: UserTomlConfig) -> Result<Self> {\n        validate_name(\"user\", &name)?;\n        if config.state == AccountState::Present && config.group.is_none() {\n            bail!(\"present bootstrap user '{name}' requires a primary group\");\n        }\n        if config.state == AccountState::Present && config.remove_home {\n            bail!(\"present bootstrap user '{name}' must not set remove_home\");\n        }\n        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        }","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/system/accounts.rs#L318-L354","documentation":"UserRequest::from_toml rejects a state = \"present\" user that sets remove_home = true. remove_home only applies to deletion (state = \"absent\"); combining it with a present user is contradictory — it would declare intent to both create/keep the account and delete its home directory — so parsing fails immediately with the user's name.","triggerScenarios":"A [bootstrap.users.<name>] table containing both state = \"present\" and remove_home = true, read while building account requests for `mise bootstrap plan`/`apply`.","commonSituations":"Flipping a user from absent (with remove_home = true) to present without cleaning up; copy-paste from a teardown config into a provisioning one.","solutions":["Delete remove_home from the present user entry.","If you really want the home directory gone while keeping the user, that is not supported by bootstrap — manage it outside mise.","If the user should be removed, use state = \"absent\" where remove_home is valid."],"exampleFix":"# before\n[bootstrap.users.temp]\nstate = \"present\"\ngroup = \"users\"\nremove_home = true\n# after\n[bootstrap.users.temp]\nstate = \"present\"\ngroup = \"users\"","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('state') == 'present' and u.get('remove_home'):\n        sys.exit(f\"present user '{name}' must not set remove_home\")\nEOF","typeGuard":"def present_user_clean(u: dict) -> bool:\n    return not u.get('remove_home') if u.get('state') == 'present' else True","tryCatchPattern":null,"preventionTips":["Remember the pairing: remove_home belongs only to state = \"absent\".","When converting a teardown config to provisioning, strip absent-only keys.","Lint bootstrap tables in CI with a small TOML checker."],"tags":["mise","bootstrap","users","config-validation","toml"],"backgroundTag":"config-validation-failed","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}