{"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/533346cc374382b41ec5ff70536252b2e96e725c/src/system/accounts.rs#L318-L354","documentation":"remove_home is only meaningful when deleting a user (state = \"absent\"): it controls whether the home directory is removed along with the account. Specifying it on a user with state = \"present\" is contradictory — you cannot remove the home of a user you are creating/keeping — so from_toml rejects the combination eagerly.","triggerScenarios":"[bootstrap.users] entry with state = \"present\" and remove_home = true; flipping a user entry from absent to present without removing remove_home; generated configs that always emit remove_home regardless of state.","commonSituations":"Toggling a user's state while cleaning up a config; copy-paste from an absent-user example; templating that merges all possible fields into one stanza.","solutions":["Remove the remove_home key from the present-state user entry","If you actually want the user deleted (with home cleanup), set state = \"absent\" and keep remove_home","Split into two config variants if you need both lifecycle states"],"exampleFix":"# before\n[bootstrap.users]\napp = { state = \"present\", group = \"app\", remove_home = true }\n\n# after\n[bootstrap.users]\napp = { state = \"present\", group = \"app\" }","handlingStrategy":"validation","validationCode":"# fail fast if any present bootstrap user sets remove_home\ntomlq -r '.bootstrap.users | to_entries[] | select((.value.state // \"present\") == \"present\") | select(has(\"remove_home\")) | .key' mise.toml","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only set remove_home on state = \"absent\" user entries","When flipping absent→present, remove lifecycle-cleanup fields in the same edit","Keep present and absent user stanzas as separate templates rather than one merged block","Run `mise bootstrap plan` after any state flip to validate the config"],"tags":["config-validation","bootstrap","users","toml"],"backgroundTag":"conflicting-config-options","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"}