{"record":{"id":"1ab3d0fea1b651f6","repo":"jdx/mise","slug":"bootstrap-user-requires-group-group-but","errorCode":null,"errorMessage":"bootstrap user '{}' requires group '{group}', but that group is absent","messagePattern":"bootstrap user '(.+?)' requires group '(.+?)', but that group is absent","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/accounts.rs","lineNumber":608,"sourceCode":"    }\n}\n\nfn validate_requests(groups: &[GroupRequest], users: &[UserRequest]) -> Result<()> {\n    let managed_groups = groups\n        .iter()\n        .map(|group| (group.name.as_str(), group.state))\n        .collect::<IndexMap<_, _>>();\n    for user in users\n        .iter()\n        .filter(|user| user.state == AccountState::Present)\n    {\n        for group in user\n            .group\n            .iter()\n            .chain(user.groups.iter().flat_map(|groups| groups.iter()))\n        {\n            match managed_groups.get(group.as_str()) {\n                Some(AccountState::Absent) => bail!(\n                    \"bootstrap user '{}' requires group '{group}', but that group is absent\",\n                    user.name\n                ),\n                Some(AccountState::Present) => {}\n                None if nix::unistd::Group::from_name(group)?.is_none() => bail!(\n                    \"bootstrap user '{}' requires undeclared group '{group}'\",\n                    user.name\n                ),\n                None => {}\n            }\n        }\n    }\n    Ok(())\n}\n\nfn inspect_user(name: &str, desired_uid: Option<u32>) -> Result<UserInspection> {\n    let Some(user) = nix::unistd::User::from_name(name)? else {\n        return match desired_uid {","sourceCodeStart":590,"sourceCodeEnd":626,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/accounts.rs#L590-L626","documentation":"A bootstrap user lists a group in its group/groups fields, but that group is explicitly declared with state=absent elsewhere in the bootstrap accounts config. Since the user cannot join a group that bootstrap is deleting, mise fails fast with a configuration contradiction.","triggerScenarios":"user.groups or user.group references a group name whose corresponding [[bootstrap.groups]] entry has state=\"absent\".","commonSituations":"Removing an old group while user entries still reference it; copying user definitions from another config that assumes the group exists; refactoring group names without updating users.","solutions":["Remove the group from the user's group/groups lists.","Change the group's state to \"present\" (or delete its absent declaration) if it should exist.","Run `mise bootstrap plan` to verify group/user consistency after edits."],"exampleFix":"// before\n[[bootstrap.groups]]\nname = \"docker\"\nstate = \"absent\"\n[[bootstrap.users]]\nname = \"ci\"\ngroups = [\"docker\"]\n\n// after\n[[bootstrap.groups]]\nname = \"docker\"\nstate = \"absent\"\n[[bootstrap.users]]\nname = \"ci\"\ngroups = []","handlingStrategy":"validation","validationCode":"function validateGroupRefs(config) {\n  const absent = new Set(config.groups.filter((g) => g.state === 'absent').map((g) => g.name));\n  for (const u of config.users) {\n    const refs = [u.group, ...(u.groups || [])].filter(Boolean);\n    for (const g of refs) {\n      if (absent.has(g)) throw new Error(`user '${u.name}' references absent group '${g}'`);\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await mise.bootstrap.apply(config);\n} catch (e) {\n  if (String(e).includes(\"but that group is absent\")) {\n    console.error('Remove the group from the user or keep the group present:', e.message);\n  } else throw e;\n}","preventionTips":["Cross-check user group references against declared groups in CI.","When deleting a group, update all user entries that reference it.","Run `mise bootstrap plan` to surface contradictions."],"tags":["bootstrap","groups","config-conflict"],"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"}