{"record":{"id":"3f3d33ee506acedf","repo":"jdx/mise","slug":"bootstrap-resource-resource-requires-group-g","errorCode":null,"errorMessage":"bootstrap resource '{resource}' requires group '{group}', but that group is absent","messagePattern":"bootstrap resource '(.+?)' requires group '(.+?)', but that group is absent","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/resources.rs","lineNumber":651,"sourceCode":"        return Ok(());\n    }\n    if let Some(owner) = owner {\n        match user_states.get(owner) {\n            Some(super::accounts::AccountState::Present) => {\n                plan.add_dependency(resource, ResourceId::new(\"user\", owner))?;\n            }\n            Some(super::accounts::AccountState::Absent) => bail!(\n                \"bootstrap resource '{resource}' requires owner '{owner}', but that user is absent\"\n            ),\n            None => {}\n        }\n    }\n    if let Some(group) = group {\n        match group_states.get(group) {\n            Some(super::accounts::AccountState::Present) => {\n                plan.add_dependency(resource, ResourceId::new(\"group\", group))?;\n            }\n            Some(super::accounts::AccountState::Absent) => bail!(\n                \"bootstrap resource '{resource}' requires group '{group}', but that group is absent\"\n            ),\n            None => {}\n        }\n    }\n    Ok(())\n}\n\nfn desired_package(request: &super::packages::PackageRequest) -> String {\n    if request.desired == super::packages::PackageDesiredState::Absent {\n        return \"absent\".to_string();\n    }\n    request\n        .version\n        .as_ref()\n        .map(|version| format!(\"installed ({version})\"))\n        .unwrap_or_else(|| \"installed (any version)\".to_string())\n}","sourceCodeStart":633,"sourceCodeEnd":669,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/resources.rs#L633-L669","documentation":"The group counterpart to the owner check: when a bootstrap resource declares a group and the planner sees that the group account is managed as Absent, it cannot attach a valid group dependency, so planning fails. Like the owner check, this fires before any changes are made.","triggerScenarios":"Calling plan (via add_account_dependencies) for a bootstrap resource with a group set, where group_states maps that group to AccountState::Absent — i.e. the same plan removes that group.","commonSituations":"A shared config section deletes a group (e.g. 'www-data' variants) that file/service resources still reference as their group; renaming groups in user management config without updating resource group fields; cleanup configs that remove groups still used by application resources.","solutions":["Set the referenced group's resource to Present, or pick a group that exists in the plan.","Delete the group-removal declaration if the group should remain.","Mark the dependent resource absent too if everything under it is being torn down.","Correct the group name if it is misspelled relative to the declared group resource."],"exampleFix":"// before\ngroup(\"appsvc\", AccountState::Absent);\nresource(\"/srv/app\", group: \"appsvc\");\n// after\ngroup(\"appsvc\", AccountState::Present);\nresource(\"/srv/app\", group: \"appsvc\");","handlingStrategy":"validation","validationCode":"fn group_ok(group: &str, group_states: &std::collections::HashMap<String, bool>) -> Result<(), String> {\n    match group_states.get(group) {\n        Some(true) => Ok(()),\n        Some(false) => Err(format!(\"group '{group}' is declared absent\")),\n        None => Err(format!(\"group '{group}' is not declared at all\")),\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Cross-check group removals against all resources using group: <name>","Name groups via shared constants to avoid drift between declarations","Run plan on a fixture as a pre-apply check","When decommissioning, tear down dependent resources in the same change"],"tags":["groups","ownership","planning"],"backgroundTag":"missing-dependency","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}