jdx/mise · error

bootstrap compose project

Error message

bootstrap compose project '{}' depends on missing resource '{}'

What it means

When planning a bootstrap compose project, every entry in its explicit_dependencies must correspond to a resource that exists in the plan. A dependency naming a resource the planner never registered fails fast with this error, instead of producing a dangling edge.

Solutions

  1. Fix the dependency name/kind to match an existing declared resource exactly
  2. Declare the missing resource so it appears in the plan
  3. Remove the stale dependency if the resource is no longer needed

Example fix

// before
compose_project("web").depends_on("user:deplooy")
// after
compose_project("web").depends_on("user:deploy")
Defensive patterns

Strategy: validation

Validate before calling

const declared = new Set(allResources.map(r => r.id));
for (const dep of composeProject.explicit_dependencies) if (!declared.has(dep)) throw new Error(`compose ${composeProject.name}: unknown dependency ${dep}`);

Type guard

function depsExist(depIds, declaredIds) { const s = new Set(declaredIds); return depIds.every(d => s.has(d)); }

Try / catch

try { plan = planner.plan(); } catch (e) { if (String(e).includes('depends on missing resource')) { const missing = /resource '(.+)'/.exec(e.message)?.[1]; declareOrDropDependency(missing); } else throw e; }

Prevention

When it happens

Trigger: Calling plan with a compose-project request whose explicit_dependencies() returns a ResourceId (e.g. "user:deploy" or "dir:/srv/app") that no declared resource added to the plan.

Common situations: Typo or wrong kind prefix in a dependency name; referencing a resource declared in a different (unused) config file; the referenced resource was removed in a refactor but the compose block still lists it.

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/922f9f3d857386cf. Report an issue: GitHub.

Appendix: source

Thrown at src/system/resources.rs:628

            plan.add_dependency(&policy_id, dependency.clone())?;
        }
    }
    let mut compose = super::compose::prepare_requests_from_config(config)?;
    super::compose::inspect_requests(&mut compose);
    for request in &compose {
        let mut dependencies = request
            .path_dependencies()
            .iter()
            .filter(|dependency| plan.resources.contains_key(*dependency))
            .cloned()
            .collect::<IndexSet<_>>();
        let firewall = ResourceId::new("firewall", "linux");
        if plan.resources.contains_key(&firewall) {
            dependencies.insert(firewall);
        }
        for dependency in request.explicit_dependencies() {
            if !plan.resources.contains_key(dependency) {
                bail!(
                    "bootstrap compose project '{}' depends on missing resource '{}'",
                    request.name,
                    dependency
                );
            }
            dependencies.insert(dependency.clone());
        }
        let dependency_changed = dependencies.iter().any(|dependency| {
            plan.resources.get(dependency).is_some_and(|resource| {
                matches!(
                    resource.action,
                    ResourceAction::Create | ResourceAction::Update | ResourceAction::Remove
                )
            })
        });
        let resource = request.plan_with_dependency_change(dependency_changed);
        let id = resource.id.clone();
        plan.insert(resource)?;

View on GitHub (pinned to 533346cc37)