{"record":{"id":"179de79eb7530678","repo":"nikivdev/code","slug":"lifecycle-domains-aliases-target-is-required","errorCode":null,"errorMessage":"lifecycle.domains.aliases[].target is required","messagePattern":"lifecycle\\.domains\\.aliases\\[\\]\\.target is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lifecycle.rs","lineNumber":142,"sourceCode":"fn 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}\n\nfn lifecycle_preferred_url(cfg: &LifecycleDomainsConfig) -> Option<String> {\n    let host = lifecycle_domain_host(cfg).ok()?;\n    Some(format!(\"http://{}\", host))\n}\n","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/lifecycle.rs#L124-L160","documentation":"ensure_domains_up validates each lifecycle.domains.aliases[] entry and requires a non-empty target (the address the host routes to). Blank or missing targets abort the up run with this error before any routes are applied.","triggerScenarios":"Calling `run up` with an aliases[] entry that has a host but a missing, null, or whitespace-only target field.","commonSituations":"Copy-pasted alias entries where target was left as a placeholder or empty string; config refactors that renamed the port field; YAML/TOML structure errors nesting target in the wrong place.","solutions":["Set a non-empty target (e.g. host:port) for every alias entry","Check that target is a sibling of host in the same aliases[] item","Quote values with special characters (colons, IPv6) per your config format","Run a full config validation before `up` to catch all bad aliases at once"],"exampleFix":"// before\n- host: \"api.test\"\n  target: \"\"\n// after\n- host: \"api.test\"\n  target: \"127.0.0.1:8080\"","handlingStrategy":"validation","validationCode":"fn validate_alias_targets(cfg: &LifecycleDomainsConfig) -> Result<(), String> {\n    for a in &cfg.aliases {\n        match a.target.as_deref().map(str::trim).filter(|v| !v.is_empty()) {\n            Some(_) => {}\n            None => return Err(format!(\"alias {:?} missing target\", a.host)),\n        }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set host and target together per alias","Lint config files for empty strings in required fields","Document example alias entries in config templates","Fail fast with a preflight validation before `up`"],"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"}