{"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":"validation","errorClass":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/system/resources.rs","lineNumber":128,"sourceCode":"    }\n}\n\n#[derive(Serialize)]\npub 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 struct BootstrapPlan {\n    resources: IndexMap<ResourceId, ResourcePlan>,\n}\n\nimpl BootstrapPlan {\n    pub 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 fn add_dependency(&mut self, resource: &ResourceId, dependency: ResourceId) -> 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);\n        }\n        Ok(())\n    }\n","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/system/resources.rs#L110-L146","documentation":"BootstrapPlan keys resources by ResourceId {kind, name} — e.g. `user:alice`, `group:devs`, `package:brew:ripgrep`, `directory:/etc/app`, `file:/etc/app.conf`, `service:foo`, `compose:bar`, `firewall:linux`. insert() bails when the same kind+name is inserted twice, i.e. when the same entity is declared in more than one place that feeds the plan (multiple merged config files, or the same path/package listed twice).","triggerScenarios":"The same user or group declared under `[bootstrap.users]` / `[bootstrap.groups]` in two config files that are both active (project mise.toml + mise.local.toml + includes); the same path listed twice under `[bootstrap.files]` or `[bootstrap.directories]`; the same package contributed twice for one manager.","commonSituations":"Layered project and local configs both declaring an account; config `additional`/include files duplicating a section; copy-pasting a section from global config into project config while both apply.","solutions":["List the effective config files (`mise config ls`) and grep them for the name shown in the error's `kind:name` id","Delete or merge the duplicate declaration in one layer — usually keep the project config and trim the local override","For paths, make sure each entry appears under exactly one table and only once"],"exampleFix":"# before: mise.toml AND mise.local.toml both declare\n[bootstrap.groups]\ndevs = {}\n\n# after: declare `devs` once, in mise.toml only","handlingStrategy":"validation","validationCode":"let mut seen = std::collections::HashSet::new();\nfor resource in resources {\n    if !seen.insert(resource.id.clone()) {\n        return Err(eyre::eyre!(\"duplicate {}\", resource.id)); // or merge/dedupe\n    }\n    plan.insert(resource)?;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Declare each account, file, directory, and package in exactly one config layer","Run `mise config ls` and scan every active file for duplicate `[bootstrap.*]` entries before committing","Watch out for includes (`additional` config files) re-declaring a section"],"tags":["mise","bootstrap","resources","config","duplicate"],"backgroundTag":"duplicate-resource-declaration","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}