{"record":{"id":"1935287f36c814fd","repo":"jdx/mise","slug":"bootstrap-user-requires-undeclared-group-gr","errorCode":null,"errorMessage":"bootstrap user '{}' requires undeclared group '{group}'","messagePattern":"bootstrap user '(.+?)' requires undeclared group '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/accounts.rs","lineNumber":613,"sourceCode":"        .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 {\n            Some(uid) => match nix::unistd::User::from_uid(nix::unistd::Uid::from_raw(uid))? {\n                Some(user) => Ok(UserInspection::IdCollision {\n                    uid,\n                    name: user.name,\n                }),","sourceCodeStart":595,"sourceCodeEnd":631,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/accounts.rs#L595-L631","documentation":"A bootstrap user references a group (via group or groups) that is neither declared in the bootstrap groups config nor present on the system (nix Group::from_name returns None). mise refuses to proceed because useradd/usermod would fail joining a nonexistent group.","triggerScenarios":"user.groups contains a group name with no [[bootstrap.groups]] declaration and no such group existing on the machine.","commonSituations":"Typo in a group name; expecting a group created by another tool (ansible, puppet) that hasn't run; declaring users before the groups they need in the config.","solutions":["Add a [[bootstrap.groups]] entry with state=\"present\" for the referenced group.","Fix the group name typo if it should match an existing/declared group.","Create the group on the system manually if it is managed outside mise bootstrap."],"exampleFix":"// before\n[[bootstrap.users]]\nname = \"ci\"\ngroups = [\"docker\"]\n\n// after\n[[bootstrap.groups]]\nname = \"docker\"\nstate = \"present\"\n[[bootstrap.users]]\nname = \"ci\"\ngroups = [\"docker\"]","handlingStrategy":"validation","validationCode":"function validateGroupExists(config) {\n  const declared = new Set(config.groups.map((g) => g.name));\n  for (const u of config.users) {\n    for (const g of [u.group, ...(u.groups || [])].filter(Boolean)) {\n      if (!declared.has(g)) {\n        console.warn(`user '${u.name}' group '${g}' is undeclared; ensure it exists on the host`);\n      }\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await mise.bootstrap.apply(config);\n} catch (e) {\n  if (String(e).includes('requires undeclared group')) {\n    console.error('Declare the group in bootstrap config or create it on the host:', e.message);\n  } else throw e;\n}","preventionTips":["Declare every group a user joins as a bootstrap group with state=present.","Watch for typos in group names.","Ensure external provisioners (ansible/puppet) run before mise bootstrap."],"tags":["bootstrap","groups","missing-reference"],"backgroundTag":"resource-not-found","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"}