zeroclaw-labs/zeroclaw · error

URL must include a valid host

Error message

URL must include a valid host

What it means

Error "URL must include a valid host" thrown in zeroclaw-labs/zeroclaw.

Source

Thrown at crates/zeroclaw-tools/src/web_fetch.rs:826

    }

    if !parsed.username().is_empty() || parsed.password().is_some() {
        anyhow::bail!("URL userinfo is not allowed");
    }

    let host = parsed
        .host_str()
        .ok_or_else(|| anyhow::Error::msg("URL must include a host"))?;
    // `Url::host_str()` serializes IPv6 literals with brackets, so parsing the
    // returned string directly would never recognize them.
    if host.starts_with('[') {
        anyhow::bail!("IPv6 hosts are not supported in web_fetch");
    }

    let host = host.trim_end_matches('.').to_ascii_lowercase();

    if host.is_empty() {
        anyhow::bail!("URL must include a valid host");
    }

    Ok(host)
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
enum PrivateAllow {
    /// Not covered by the private allowlist.
    None,
    /// Covered only by a `*` wildcard entry.
    Wildcard,
    /// Covered by a specific host/IP or suffix entry.
    Explicit,
}

fn private_allowlist_match(host: &str, allowed_private_hosts: &[String]) -> PrivateAllow {
    let mut wildcard = false;
    for entry in allowed_private_hosts {

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Provide a fully-qualified URL including scheme and host, e.g. https://example.com/path.
  2. Check for typos or missing `//` after the scheme in the URL.

When it happens

Trigger: Thrown at crates/zeroclaw-tools/src/web_fetch.rs:826 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/99b0910bb4af6cd8. Report an issue: GitHub.