{"record":{"id":"eee6d32e28fd8a06","repo":"jdx/mise","slug":"refusing-unsafe-change-to-bootstrap-user-ins","errorCode":null,"errorMessage":"refusing unsafe change to bootstrap user '{}'; inspect `mise bootstrap plan`","messagePattern":"refusing unsafe change to bootstrap user '(.+?)'; inspect `mise bootstrap plan`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/accounts.rs","lineNumber":546,"sourceCode":"                groups.iter().cloned().collect::<Vec<_>>().join(\",\")\n            ));\n        }\n        if let Some(home) = &self.home {\n            parts.push(format!(\"home {}\", home.display()));\n        }\n        if let Some(shell) = &self.shell {\n            parts.push(format!(\"shell {}\", shell.display()));\n        }\n        if let Some(comment) = &self.comment {\n            parts.push(format!(\"comment {comment}\"));\n        }\n        parts.join(\"; \")\n    }\n\n    fn action(&self) -> Result<Option<AccountAction>> {\n        match self.plan().action {\n            ResourceAction::Noop => Ok(None),\n            ResourceAction::Unknown => bail!(\n                \"refusing unsafe change to bootstrap user '{}'; inspect `mise bootstrap plan`\",\n                self.name\n            ),\n            ResourceAction::Create => Ok(Some(AccountAction::CreateUser {\n                name: self.name.clone(),\n                uid: self.uid,\n                group: self\n                    .group\n                    .clone()\n                    .expect(\"present user has a primary group\"),\n                groups: self\n                    .groups\n                    .as_ref()\n                    .map(|groups| groups.iter().cloned().collect())\n                    .unwrap_or_default(),\n                home: self.home.clone(),\n                shell: self.shell.clone(),\n                comment: self.comment.clone(),","sourceCodeStart":528,"sourceCodeEnd":564,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/system/accounts.rs#L528-L564","documentation":"UserRequest::action() turns the computed plan into an action; if the plan is ResourceAction::Unknown — the inspected current user state cannot be reconciled with the desired state safely (e.g. desired uid is already taken by another user, or inspected fields conflict in a way with no safe usermod transition) — mise refuses to perform any privileged change and points you at `mise bootstrap plan` for the details. Same deliberate safety stop as the group variant.","triggerScenarios":"Bootstrap apply where a user's plan resolves to Unknown: uid collisions (desired uid owned by a different username), drifted home/shell/uid state that fits no safe transition, or login-name conflicts. `mise bootstrap plan` shows the Unknown action and the current-vs-desired diff for the named user.","commonSituations":"Reusing a uid from a removed service account; importing servers whose users drifted from the declared config; uid renumbering during consolidation; running apply on a host never inspected with plan first.","solutions":["Run `mise bootstrap plan` and read the diff for the named user.","Resolve uid conflicts: pick a free uid in config, or re-uid/remove the conflicting user manually first.","Align or drop conflicting fields (home/shell/groups) until the plan shows create/update/remove instead of Unknown.","Only then run `mise bootstrap apply`."],"exampleFix":"# before: uid 1100 already owned by user 'oldci'\n[bootstrap.users.ci]\nstate = \"present\"\ngroup = \"ci\"\nuid = 1100\n# after\n[bootstrap.users.ci]\nstate = \"present\"\ngroup = \"ci\"\nuid = 1150","handlingStrategy":"validation","validationCode":"# gate apply on a clean plan\nout=$(mise bootstrap plan)\nif grep -q 'refusing unsafe change' <<<\"$out\"; then\n  echo \"$out\" >&2; exit 1\nfi\nmise bootstrap apply","typeGuard":null,"tryCatchPattern":"Hard stop on this bail: parse the user name from the message, run `mise bootstrap plan`, resolve the uid/state collision (pick a free uid or reconcile the user manually), then re-plan. Never auto-retry apply unchanged.","preventionTips":["Require `mise bootstrap plan` to pass (no Unknown actions) before apply in automation.","Assign uids from a dedicated range and record them to avoid collisions.","After manual account surgery on a host, re-run plan to resync expectations."],"tags":["mise","bootstrap","users","uid-collision","safety","plan"],"backgroundTag":"unsafe-change-blocked","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}