{"record":{"id":"dd3673a71823e8dd","repo":"jdx/mise","slug":"bootstrap-resource-is-declared-more-than-once","errorCode":null,"errorMessage":"bootstrap resource '{}' is declared more than once","messagePattern":"bootstrap resource '(.+?)' is declared more than once","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/resources.rs","lineNumber":220,"sourceCode":"    }\n}\n\n#[derive(Serialize)]\npub(crate) struct BootstrapPlanOutput<'a> {\n    pub resources: Vec<&'a ResourcePlan>,\n    pub summary: PlanSummary,\n}\n\n/// A validated resource graph in declaration order.\n#[derive(Default)]\npub(crate) struct BootstrapPlan {\n    resources: IndexMap<ResourceId, ResourcePlan>,\n}\n\nimpl BootstrapPlan {\n    pub(crate) fn insert(&mut self, resource: ResourcePlan) -> Result<()> {\n        if self.resources.contains_key(&resource.id) {\n            bail!(\n                \"bootstrap resource '{}' is declared more than once\",\n                resource.id\n            );\n        }\n        self.resources.insert(resource.id.clone(), resource);\n        Ok(())\n    }\n\n    pub(crate) fn add_dependency(\n        &mut self,\n        resource: &ResourceId,\n        dependency: ResourceId,\n    ) -> Result<()> {\n        let Some(resource) = self.resources.get_mut(resource) else {\n            bail!(\"cannot add dependency to missing bootstrap resource '{resource}'\");\n        };\n        if !resource.depends_on.contains(&dependency) {\n            resource.depends_on.push(dependency);","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/resources.rs#L202-L238","documentation":"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.","triggerScenarios":"`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.","commonSituations":"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.","solutions":["Find the duplicate id named in the message in your bootstrap config (mise.toml bootstrap sections).","Remove the redundant declaration or rename one so ids are unique.","Re-run `mise bootstrap` (or the plan step) to confirm planning succeeds.","Refactor shared dependencies into a single resource that others depend on."],"exampleFix":"# before: duplicate id\n[[bootstrap.resources]]\nid = \"packages\"\n...\n[[bootstrap.resources]]\nid = \"packages\"   # duplicate\n# after: unique ids\n[[bootstrap.resources]]\nid = \"packages\"\n[[bootstrap.resources]]\nid = \"dotfiles\"","handlingStrategy":"validation","validationCode":"# Check for duplicate resource ids in your bootstrap config before running\nids=$(grep -oP '(?<=^id = \").*(?=\")' mise.toml | sort)\n[ \"$(echo \"$ids\" | sort -u | wc -l)\" = \"$(echo \"$ids\" | wc -l)\" ] || echo \"duplicate ids found\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep one canonical declaration per resource id across all config files.","Name resource ids by their unique path/package, not generic labels.","Review merged configs for duplicate blocks after copy-paste edits.","Run the bootstrap plan/dry-run before apply to catch duplicates safely."],"tags":["bootstrap","config","duplicate"],"backgroundTag":"schema-validation-failed","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"}