{"record":{"id":"5919f757f38fa26c","repo":"jdx/mise","slug":"conflicting-bootstrap-compose-declarations-for-na","errorCode":null,"errorMessage":"conflicting bootstrap compose declarations for {name}\n\n  first:\n    {}\n\n  second:\n    {}","messagePattern":"conflicting bootstrap compose declarations for (.+?)\n\n  first:\n    (.+?)\n\n  second:\n    (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/compose.rs","lineNumber":166,"sourceCode":"    service: String,\n    state: String,\n    #[serde(default)]\n    health: String,\n    #[serde(default)]\n    exit_code: i64,\n    #[serde(skip)]\n    config_hash: Option<String>,\n}\n\npub(crate) fn prepare_requests_from_config(config: &Config) -> Result<Vec<ComposeRequest>> {\n    let mut composed: IndexMap<String, (ComposeTomlConfig, ResourceOrigin)> = IndexMap::new();\n    for config_files in config.bootstrap_config_maps() {\n        for (name, declaration) in compose_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 compose 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    composed\n        .into_iter()\n        .map(|(name, (config, origin))| {\n            ComposeRequest::from_toml_with_origin(name, config, Some(origin))\n        })\n        .collect()\n}\n\nfn compose_from_config_files(\n    config_files: &ConfigMap,","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/compose.rs#L148-L184","documentation":"mise refuses to build bootstrap compose requests when two config files declare the same compose project name with differing definitions. During prepare_requests_from_config, declarations are collected into a map; if a name collides and the underlying declaration differs from the first one seen, this error is thrown instead of silently picking a winner. Identical duplicates are allowed (they dedupe).","triggerScenarios":"Two or more bootstrap config files (via config.bootstrap_config_maps()) define a [bootstrap.compose.<name>] section with the same project name but different project_dir, state, services, profiles, or other fields.","commonSituations":"A user-level and a project-level config both define the same compose project after copying a snippet; a team config merge introduced a second definition; a refactor renamed a project but left the old entry in another file.","solutions":["Search all config files for duplicate [bootstrap.compose.<name>] sections and remove or rename one","Make the two declarations byte-identical if duplication is intentional (identical declarations are skipped)","Use `mise bootstrap plan` to inspect which declarations are being merged","Consolidate compose project definitions into a single config layer"],"exampleFix":"# before (project mise.toml)\n[bootstrap.compose.db]\nproject_dir = \"/srv/app\"\nstate = \"present\"\n# before (~/.config/mise/config.toml)\n[bootstrap.compose.db]\nproject_dir = \"/srv/other\"\nstate = \"present\"\n\n// after: keep only one definition, or make both identical\n[bootstrap.compose.db]\nproject_dir = \"/srv/app\"\nstate = \"present\"","handlingStrategy":"validation","validationCode":"// before loading bootstrap config, ensure each compose project name is declared once\ndef check_no_conflicting_compose_projects(configs: list[dict]) -> None:\n    seen: dict[str, dict] = {}\n    for cfg in configs:\n        for name, decl in cfg.get(\"bootstrap\", {}).get(\"compose\", {}).items():\n            if name in seen and seen[name] != decl:\n                raise ValueError(f\"conflicting bootstrap compose declarations for {name}\")\n            seen[name] = decl","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep compose project definitions in exactly one config layer","Run `mise bootstrap plan` in CI to catch conflicts before apply","Avoid copy-pasting [bootstrap.compose.*] blocks between user and project configs"],"tags":["config","compose","duplicate-definitions"],"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"}