nikivdev/code · error
lifecycle.domains.aliases[].host is required
Error message
lifecycle.domains.aliases[].host is required
What it means
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.
Source
Thrown at src/lifecycle.rs:136
hub_port: 9050,
name: task_name.to_string(),
args,
})
}
fn ensure_domains_up(cfg: &LifecycleDomainsConfig) -> Result<()> {
let host = lifecycle_domain_host(cfg)?;
let target = lifecycle_domain_target(cfg)?;
let engine = parse_domains_engine(cfg.engine.as_deref())?;
add_lifecycle_route(engine, host, target)?;
for alias in &cfg.aliases {
let alias_host = alias
.host
.as_deref()
.map(str::trim)
.filter(|v| !v.is_empty())
.ok_or_else(|| anyhow!("lifecycle.domains.aliases[].host is required"))?;
let alias_target = alias
.target
.as_deref()
.map(str::trim)
.filter(|v| !v.is_empty())
.ok_or_else(|| anyhow!("lifecycle.domains.aliases[].target is required"))?;
add_lifecycle_route(engine, alias_host, alias_target)?;
}
domains::run(DomainsCommand {
engine,
action: Some(DomainsAction::Up),
})?;
println!("Lifecycle domains ready: http://{}", host);
Ok(())
}View on GitHub (pinned to a747e741ae)
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
Example fix
// before
domains:
aliases:
- target: "127.0.0.1:3000"
// after
domains:
aliases:
- host: "app.test"
target: "127.0.0.1:3000" Defensive patterns
Strategy: validation
Validate before calling
fn validate_aliases(cfg: &LifecycleDomainsConfig) -> Result<(), String> {
for a in &cfg.aliases {
match a.host.as_deref().map(str::trim).filter(|v| !v.is_empty()) {
Some(_) => {}
None => return Err("aliases[].host is required".into()),
}
}
Ok(())
} Prevention
- 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
When it happens
Trigger: Calling `run up` with a lifecycle.domains.aliases[] entry whose host field is absent, null, or whitespace-only.
Common situations: 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.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
- lifecycle.domains.aliases[].target is required
- lifecycle.domains.host is required when remove_on_down=true
- invalid lifecycle.domains.engine '{}': expected 'docker' or
- empty resolver command for {}
- Host is empty
AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01).
Data as JSON: /api/errors/b3fececcdab2a7d7.
Report an issue: GitHub.