jdx/mise · error

bootstrap resource ' ' is declared more than once

Error message

bootstrap resource '{}' is declared more than once

What it means

BootstrapPlan::insert validates that each resource ID is unique while building the bootstrap plan. If two resources in the bootstrap configuration resolve to the same ResourceId, planning fails with this error rather than silently overwriting one resource's plan.

Solutions

  1. Find the duplicate id named in the message in your bootstrap config (mise.toml bootstrap sections).
  2. Remove the redundant declaration or rename one so ids are unique.
  3. Re-run `mise bootstrap` (or the plan step) to confirm planning succeeds.
  4. Refactor shared dependencies into a single resource that others depend on.

Example fix

# before: duplicate id
[[bootstrap.resources]]
id = "packages"
...
[[bootstrap.resources]]
id = "packages"   # duplicate
# after: unique ids
[[bootstrap.resources]]
id = "packages"
[[bootstrap.resources]]
id = "dotfiles"
Defensive patterns

Strategy: validation

Validate before calling

# Check for duplicate resource ids in your bootstrap config before running
ids=$(grep -oP '(?<=^id = ").*(?=")' mise.toml | sort)
[ "$(echo "$ids" | sort -u | wc -l)" = "$(echo "$ids" | wc -l)" ] || echo "duplicate ids found"

Prevention

When it happens

Trigger: `mise bootstrap` planning (plan/insert) where two declared resources (e.g. two file/package entries) produce the same resource id — duplicate declarations of the same path or package in the bootstrap config.

Common situations: Copy-pasting a [[bootstrap.resources]] block and forgetting to change the id/path; declaring the same package in two config files that get merged; a file resource and package resource colliding on an id.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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

Appendix: source

Thrown at src/system/resources.rs:220

    }
}

#[derive(Serialize)]
pub(crate) struct BootstrapPlanOutput<'a> {
    pub resources: Vec<&'a ResourcePlan>,
    pub summary: PlanSummary,
}

/// A validated resource graph in declaration order.
#[derive(Default)]
pub(crate) struct BootstrapPlan {
    resources: IndexMap<ResourceId, ResourcePlan>,
}

impl BootstrapPlan {
    pub(crate) fn insert(&mut self, resource: ResourcePlan) -> Result<()> {
        if self.resources.contains_key(&resource.id) {
            bail!(
                "bootstrap resource '{}' is declared more than once",
                resource.id
            );
        }
        self.resources.insert(resource.id.clone(), resource);
        Ok(())
    }

    pub(crate) fn add_dependency(
        &mut self,
        resource: &ResourceId,
        dependency: ResourceId,
    ) -> Result<()> {
        let Some(resource) = self.resources.get_mut(resource) else {
            bail!("cannot add dependency to missing bootstrap resource '{resource}'");
        };
        if !resource.depends_on.contains(&dependency) {
            resource.depends_on.push(dependency);

View on GitHub (pinned to 533346cc37)