{"record":{"id":"0197947fdcf79573","repo":"jdx/mise","slug":"bootstrap-compose-project-name-down-volumes-an","errorCode":null,"errorMessage":"bootstrap compose project '{name}' down_volumes and down_images require state = \"absent\"","messagePattern":"bootstrap compose project '(.+?)' down_volumes and down_images require state = \"absent\"","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/compose.rs","lineNumber":343,"sourceCode":"        validate_values(\"service\", &config.services)?;\n        validate_values(\"oneshot service\", &config.oneshot)?;\n        validate_command(\"command\", &config.command)?;\n        validate_command(\"engine_command\", &config.engine_command)?;\n        if config.state == ComposeState::Absent && !config.services.is_empty() {\n            bail!(\n                \"bootstrap compose project '{name}' services cannot be combined with state = \\\"absent\\\" because compose down removes the entire project\"\n            );\n        }\n        if !config.wait && config.wait_timeout.is_some() {\n            bail!(\"bootstrap compose project '{name}' wait_timeout requires wait = true\");\n        }\n        if config.wait_timeout == Some(0) {\n            bail!(\"bootstrap compose project '{name}' wait_timeout must be greater than zero\");\n        }\n        if config.state != ComposeState::Absent\n            && (config.down_volumes || config.down_images.is_some())\n        {\n            bail!(\n                \"bootstrap compose project '{name}' down_volumes and down_images require state = \\\"absent\\\"\"\n            );\n        }\n        if config.state != ComposeState::Running && config.renew_anonymous_volumes {\n            bail!(\n                \"bootstrap compose project '{name}' renew_anonymous_volumes requires state = \\\"running\\\"\"\n            );\n        }\n        let explicit_dependencies = config\n            .depends_on\n            .iter()\n            .map(|dependency| parse_dependency(dependency))\n            .collect::<Result<Vec<_>>>()?;\n        let services = dedupe(config.services);\n        let oneshot: IndexSet<String> = dedupe(config.oneshot).into_iter().collect();\n        if !services.is_empty() && oneshot.iter().any(|service| !services.contains(service)) {\n            bail!(\n                \"bootstrap compose project '{name}' oneshot services must also appear in services\"","sourceCodeStart":325,"sourceCodeEnd":361,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/compose.rs#L325-L361","documentation":"Thrown during TOML validation when `down_volumes` or `down_images` is set but the project's `state` is not \"absent\". These options only apply when tearing a project down with `compose down`; on any other state they are meaningless leftovers, so the library rejects the combination.","triggerScenarios":"A `[system.compose.<name>]` block with `down_volumes = true` or `down_images = \"...\"` (or both) while `state` is \"running\", \"present\", or omitted. Raised from `from_toml_with_origin` at parse time.","commonSituations":"Converting a previously `absent` (tear-down) project into a `running` one without removing the down options; copy-pasting a removal template and forgetting to strip the down flags.","solutions":["Change `state` to `\"absent\"` if the project really should be torn down","Remove `down_volumes`/`down_images` keys if the project should run or exist"],"exampleFix":"# before\n[system.compose.myproj]\nservices = [\"db\"]\nstate = \"running\"\ndown_volumes = true\n# after\n[system.compose.myproj]\nservices = [\"db\"]\nstate = \"absent\"\ndown_volumes = true","handlingStrategy":"validation","validationCode":"if (cfg.down_volumes || cfg.down_images.is_some()) && cfg.state != \"absent\" {\n    return Err(\"down_volumes/down_images require state = \\\"absent\\\"\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep tear-down options (down_*) only in state=\"absent\" blocks","Audit configs after switching project state","Use distinct config sections for create vs teardown"],"tags":["config","validation","docker-compose"],"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"}