{"record":{"id":"9812c33b84b5d115","repo":"jdx/mise","slug":"conflicting-bootstrap-service-declarations-for-na-9812c3","errorCode":null,"errorMessage":"conflicting bootstrap service declarations for {name}\n\n  first:\n    {}\n\n  second:\n    {}","messagePattern":"conflicting bootstrap service declarations for (.+?)\n\n  first:\n    (.+?)\n\n  second:\n    (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/services_common.rs","lineNumber":251,"sourceCode":"\n/// Names of every user-scope service, for notification validation.\npub(crate) fn user_service_names(config: &Config) -> Result<Vec<String>> {\n    Ok(compose_user_declarations(config)?.into_keys().collect())\n}\n\n/// `[bootstrap.services]` from every config map, rejecting redeclarations that\n/// disagree.\npub(crate) fn compose_declarations(\n    config: &Config,\n) -> Result<IndexMap<String, (ServiceTomlConfig, ResourceOrigin)>> {\n    let mut composed: IndexMap<String, (ServiceTomlConfig, ResourceOrigin)> = IndexMap::new();\n    for config_files in config.bootstrap_config_maps() {\n        for (name, declaration) in services_from_config_files(config_files) {\n            if let Some(existing) = composed.get(&name) {\n                if existing.0 == declaration.0 {\n                    continue;\n                }\n                bail!(\n                    \"conflicting bootstrap service declarations for {name}\\n\\n  first:\\n    {}\\n\\n  second:\\n    {}\",\n                    existing.1.conflict_description(),\n                    declaration.1.conflict_description(),\n                );\n            }\n            composed.insert(name, declaration);\n        }\n    }\n    Ok(composed)\n}\n\nfn services_from_config_files(\n    config_files: &ConfigMap,\n) -> IndexMap<String, (ServiceTomlConfig, ResourceOrigin)> {\n    let mut merged = IndexMap::new();\n    for (path, cf) in config_files {\n        if let Some(bootstrap) = cf.bootstrap_config() {\n            let origin = ResourceOrigin {","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/services_common.rs#L233-L269","documentation":"The same bootstrap service name is declared in multiple config files with differing definitions. mise composes declarations across layered config files; when two declarations for a name differ (the `ServiceDeclaration` values are unequal), it refuses to silently pick one and reports both source locations.","triggerScenarios":"`compose_declarations` iterates `config.bootstrap_config_maps()` and finds an existing entry for a name whose declaration differs from the new one — e.g. the same service defined in both the global and a project mise.toml with different commands.","commonSituations":"A project mise.toml overriding a global bootstrap service with a different command; team config merged with personal config; a stale duplicate left in an included config file.","solutions":["Delete or update one of the duplicate declarations so they match","Keep the service only in the most specific config file (project-level)","If an override is intended, remove the base declaration rather than redefining the name"],"exampleFix":"# before: global ~/.config/mise/config.toml AND project mise.toml both define [services.myapp] differently\n# after: keep only one definition, in project mise.toml\n[services.myapp]\ncommand = \"./scripts/serve.sh\"","handlingStrategy":"validation","validationCode":"grep -rn '\\[services\\.' ~/.config/mise/ ./mise.toml ./config/ # find duplicate service names across layers","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Define each bootstrap service in exactly one config file","Audit layered configs (global vs project) for duplicate [services.*] tables","Treat a legitimate override as a removal of the base declaration"],"tags":["config","conflict","bootstrap-service"],"backgroundTag":"conflicting-config-options","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"}