{"record":{"id":"ea48b9d55fd2b649","repo":"nikivdev/code","slug":"invalid-lifecycle-domains-engine-expected-d","errorCode":null,"errorMessage":"invalid lifecycle.domains.engine '{}': expected 'docker' or 'native'","messagePattern":"invalid lifecycle\\.domains\\.engine '(.+?)': expected 'docker' or 'native'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lifecycle.rs","lineNumber":237,"sourceCode":"}\n\nfn remove_lifecycle_route(engine: Option<DomainsEngineArg>, host: &str) -> Result<()> {\n    domains::run(DomainsCommand {\n        engine,\n        action: Some(DomainsAction::Rm(DomainsRmOpts {\n            host: host.to_string(),\n        })),\n    })\n}\n\nfn parse_domains_engine(raw: Option<&str>) -> Result<Option<DomainsEngineArg>> {\n    let Some(raw) = raw else {\n        return Ok(None);\n    };\n    let engine = match raw.trim().to_ascii_lowercase().as_str() {\n        \"docker\" => DomainsEngineArg::Docker,\n        \"native\" => DomainsEngineArg::Native,\n        other => bail!(\n            \"invalid lifecycle.domains.engine '{}': expected 'docker' or 'native'\",\n            other\n        ),\n    };\n    Ok(Some(engine))\n}\n\nfn resolve_project_config(config_arg: &Path) -> Result<ProjectConfig> {\n    let cwd = std::env::current_dir().context(\"Failed to read current directory\")?;\n    let flow_path = resolve_flow_path(config_arg, &cwd)?;\n    let cfg = config::load(&flow_path)\n        .with_context(|| format!(\"Failed to load {}\", flow_path.display()))?;\n    Ok(ProjectConfig {\n        flow_path,\n        config: cfg,\n    })\n}\n","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/lifecycle.rs#L219-L255","documentation":"parse_domains_engine validates the lifecycle.domains.engine string from flow.toml, accepting only 'docker' or 'native' (case-insensitive, trimmed). Any other value bails with this message echoing the offending value. It prevents silently running domains with an unknown engine.","triggerScenarios":"flow.toml contains [lifecycle.domains] engine = \"podman\" (or \"compose\", \"Docker\", \"k8s\", etc.) and ensure_domains_up or run_domains_down parses the config.","commonSituations":"Assuming other container engines are supported; accidental whitespace/case usually fine (trimmed/lowercased) but synonyms like 'container' fail; copying config from a different tool with different engine names.","solutions":["Set engine = \"docker\" in [lifecycle.domains] if you use Docker","Set engine = \"native\" if you want native process management","Remove the engine key if the default is acceptable, or install the engine you intended and use its supported name"],"exampleFix":"// before (flow.toml)\n[lifecycle.domains]\nengine = \"podman\"\n// after\n[lifecycle.domains]\nengine = \"docker\"","handlingStrategy":"validation","validationCode":"let cfg = std::fs::read_to_string(\"flow.toml\")?;\nif let Some(line) = cfg.lines().find(|l| l.trim_start().starts_with(\"engine\")) {\n    let v = line.split('=').nth(1).unwrap_or(\"\").trim().trim_matches('\"');\n    if !matches!(v.to_ascii_lowercase().as_str(), \"docker\" | \"native\") {\n        eprintln!(\"invalid lifecycle.domains.engine: {}\", v);\n    }\n}","typeGuard":"fn is_valid_engine(v: &str) -> bool {\n    matches!(v.trim().to_ascii_lowercase().as_str(), \"docker\" | \"native\")\n}","tryCatchPattern":"match ensure_domains_up(&cfg).await {\n    Err(e) if e.to_string().contains(\"invalid lifecycle.domains.engine\") => {\n        eprintln!(\"Set engine to 'docker' or 'native' in flow.toml [lifecycle.domains]\");\n    }\n    other => other?,\n}","preventionTips":["Only use the documented engine values 'docker' or 'native'","Lint flow.toml against a schema in CI to catch bad engine values","Copy lifecycle config only from projects using the same tool version"],"tags":["config","validation","lifecycle"],"backgroundTag":"invalid-config-value","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}