nikivdev/code · error

No domain configured. Use --url to specify a URL to check.

Error message

No domain configured. Use --url to specify a URL to check.

What it means

The health-check command resolves the URL to probe from the project config. A [host] section exists, but its `domain` field is missing, so the URL cannot be constructed from host + ssl scheme. The CLI bails instead of guessing a domain.

Source

Thrown at src/deploy.rs:3137

fn check_health(
    _project_root: &Path,
    config: Option<&Config>,
    custom_url: Option<String>,
    expected_status: u16,
) -> Result<()> {
    use std::time::Instant;

    // Determine URL to check
    let url = if let Some(url) = custom_url {
        url
    } else if let Some(config) = config {
        // Try host domain first
        if let Some(host) = &config.host {
            if let Some(domain) = &host.domain {
                let scheme = if host.ssl { "https" } else { "http" };
                format!("{}://{}", scheme, domain)
            } else {
                bail!("No domain configured. Use --url to specify a URL to check.");
            }
        } else if let Some(cf) = &config.cloudflare {
            // Use configured URL if present
            if let Some(cf_url) = &cf.url {
                cf_url.clone()
            } else {
                bail!(
                    "No URL configured in [cloudflare]. Add 'url = \"https://...\"' or use --url."
                );
            }
        } else {
            bail!("No deployment config found. Use --url to specify a URL to check.");
        }
    } else {
        bail!("No flow.toml found. Use --url to specify a URL to check.");
    };

    println!("Checking health: {}", url);

View on GitHub (pinned to a747e741ae)

Solutions

  1. Add `domain = "example.com"` under [host] in flow.toml
  2. Pass --url https://example.com on the command line
  3. Configure [cloudflare] url = "https://..." as a fallback

Example fix

// before (flow.toml)
[host]
ssl = true

// after
[host]
ssl = true
domain = "example.com"
Defensive patterns

Strategy: validation

Validate before calling

// Rust, before invoking the check
let cfg = load_config()?;
if cfg.host.as_ref().map_or(true, |h| h.domain.is_none())
    && cfg.cloudflare.as_ref().map_or(true, |c| c.url.is_none())
    && std::env::args().all(|a| a != "--url") {
    eprintln!("fix flow.toml [host].domain or pass --url");
}

Type guard

fn has_checkable_url(cfg: &Config, has_url_flag: bool) -> bool {
    has_url_flag
        || cfg.host.as_ref().is_some_and(|h| h.domain.is_some())
        || cfg.cloudflare.as_ref().is_some_and(|c| c.url.is_some())
}

Prevention

When it happens

Trigger: Running the health check when flow.toml has a [host] section with ssl but no `domain` key, and no --url flag and no [cloudflare].url fallback is provided.

Common situations: Hand-written flow.toml where the user set host.ssl = true but forgot host.domain; config migrated from another tool that dropped the domain field.

Related errors


AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01). Data as JSON: /api/errors/a80030f1d1ac78c0. Report an issue: GitHub.