{"record":{"id":"922f9f3d857386cf","repo":"jdx/mise","slug":"bootstrap-compose-project-depends-on-missing","errorCode":null,"errorMessage":"bootstrap compose project '{}' depends on missing resource '{}'","messagePattern":"bootstrap compose project '(.+?)' depends on missing resource '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/resources.rs","lineNumber":595,"sourceCode":"            plan.add_dependency(&policy_id, dependency.clone())?;\n        }\n    }\n    let mut compose = super::compose::prepare_requests_from_config(config)?;\n    super::compose::inspect_requests(&mut compose);\n    for request in &compose {\n        let mut dependencies = request\n            .path_dependencies()\n            .iter()\n            .filter(|dependency| plan.resources.contains_key(*dependency))\n            .cloned()\n            .collect::<IndexSet<_>>();\n        let firewall = ResourceId::new(\"firewall\", \"linux\");\n        if plan.resources.contains_key(&firewall) {\n            dependencies.insert(firewall);\n        }\n        for dependency in request.explicit_dependencies() {\n            if !plan.resources.contains_key(dependency) {\n                bail!(\n                    \"bootstrap compose project '{}' depends on missing resource '{}'\",\n                    request.name,\n                    dependency\n                );\n            }\n            dependencies.insert(dependency.clone());\n        }\n        let dependency_changed = dependencies.iter().any(|dependency| {\n            plan.resources.get(dependency).is_some_and(|resource| {\n                matches!(\n                    resource.action,\n                    ResourceAction::Create | ResourceAction::Update | ResourceAction::Remove\n                )\n            })\n        });\n        let resource = request.plan_with_dependency_change(dependency_changed);\n        let id = resource.id.clone();\n        plan.insert(resource)?;","sourceCodeStart":577,"sourceCodeEnd":613,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/resources.rs#L577-L613","documentation":"When bootstrapping a compose project, the planner validates that every explicitly requested dependency resource exists in the plan being built. If an explicit dependency (e.g. a 'firewall/linux' resource or any user-supplied ResourceId) is not present in plan.resources, the plan is ambiguous or unsatisfiable, so planning bails before any changes are applied.","triggerScenarios":"Calling plan for a bootstrap compose project whose request.explicit_dependencies() returns a ResourceId that was never added to the plan — for example a dependency name that is misspelled, defined in a different file/environment, or simply not declared at all.","commonSituations":"Typo in a depends_on-style entry in bootstrap config; depending on a resource that is conditionally declared and was skipped on this host; depending on 'firewall' when no firewall resource got planned; moving config between files so the dependency declaration survives but the resource definition does not.","solutions":["Add the missing resource to the bootstrap configuration so it is included in the plan.","Correct the dependency name/id to match an existing declared resource (check exact resource kind and name spelling).","Remove the explicit dependency if it is no longer needed.","Verify with the surrounding plan code that conditional resources (like firewall) are actually being declared on this platform before depending on them."],"exampleFix":"// before\nrequest.depends_on(\"firewalld\"); // no such resource declared\n// after\nrequest.depends_on(\"firewall\"); // matches ResourceId::new(\"firewall\", \"linux\") declared in config","handlingStrategy":"validation","validationCode":"fn check_deps(requested: &[String], planned: &std::collections::HashSet<String>) -> Result<(), String> {\n    for dep in requested {\n        if !planned.contains(dep) {\n            return Err(format!(\"dependency '{dep}' is not declared in this bootstrap plan\"));\n        }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate every depends_on-style reference against declared resource names before planning","Avoid depending on conditionally-declared resources; declare the dependency unconditionally or make the dependency conditional too","Use a shared constant/ID builder (like ResourceId::new) instead of hand-typed strings","Add a config test that plans the bootstrap on a clean fixture to catch missing references"],"tags":["dependencies","planning","configuration"],"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"}