{"record":{"id":"b3fececcdab2a7d7","repo":"nikivdev/code","slug":"lifecycle-domains-aliases-host-is-required","errorCode":null,"errorMessage":"lifecycle.domains.aliases[].host is required","messagePattern":"lifecycle\\.domains\\.aliases\\[\\]\\.host is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lifecycle.rs","lineNumber":136,"sourceCode":"        hub_port: 9050,\n        name: task_name.to_string(),\n        args,\n    })\n}\n\nfn ensure_domains_up(cfg: &LifecycleDomainsConfig) -> Result<()> {\n    let host = lifecycle_domain_host(cfg)?;\n    let target = lifecycle_domain_target(cfg)?;\n    let engine = parse_domains_engine(cfg.engine.as_deref())?;\n\n    add_lifecycle_route(engine, host, target)?;\n    for alias in &cfg.aliases {\n        let alias_host = alias\n            .host\n            .as_deref()\n            .map(str::trim)\n            .filter(|v| !v.is_empty())\n            .ok_or_else(|| anyhow!(\"lifecycle.domains.aliases[].host is required\"))?;\n        let alias_target = alias\n            .target\n            .as_deref()\n            .map(str::trim)\n            .filter(|v| !v.is_empty())\n            .ok_or_else(|| anyhow!(\"lifecycle.domains.aliases[].target is required\"))?;\n        add_lifecycle_route(engine, alias_host, alias_target)?;\n    }\n\n    domains::run(DomainsCommand {\n        engine,\n        action: Some(DomainsAction::Up),\n    })?;\n\n    println!(\"Lifecycle domains ready: http://{}\", host);\n\n    Ok(())\n}","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/lifecycle.rs#L118-L154","documentation":"ensure_domains_up validates the lifecycle.domains config before bringing domain routes up. Each entry in aliases must have a non-empty host; when it's missing or blank, this error is thrown. It's config validation failing fast rather than a runtime fault.","triggerScenarios":"Calling `run up` with a lifecycle.domains.aliases[] entry whose host field is absent, null, or whitespace-only.","commonSituations":"Hand-edited config files with a typo'd key (e.g. hostname instead of host), commented-out value left as empty string, YAML/TOML indentation mistakes dropping the field.","solutions":["Add a non-empty host to every entry under lifecycle.domains.aliases","Check key spelling (host, not hostname) and indentation in the config file","Trim/quote values so they aren't parsed as blank","Validate the whole config (host and target on every alias) before running up"],"exampleFix":"// before\ndomains:\n  aliases:\n    - target: \"127.0.0.1:3000\"\n// after\ndomains:\n  aliases:\n    - host: \"app.test\"\n      target: \"127.0.0.1:3000\"","handlingStrategy":"validation","validationCode":"fn validate_aliases(cfg: &LifecycleDomainsConfig) -> Result<(), String> {\n    for a in &cfg.aliases {\n        match a.host.as_deref().map(str::trim).filter(|v| !v.is_empty()) {\n            Some(_) => {}\n            None => return Err(\"aliases[].host is required\".into()),\n        }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate the whole lifecycle config at startup, before `up`","Use a config schema/linter to catch missing host keys","Avoid empty-string placeholders in config files","Keep host/target as a required pair in every alias entry"],"tags":["config","validation","lifecycle","domains"],"backgroundTag":"missing-required-config-field","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}