zeroclaw-labs/zeroclaw · error

Invalid {label}: {}

Error message

Invalid {label}: {}

What it means

Error "Invalid {label}: {}" thrown in zeroclaw-labs/zeroclaw.

Source

Thrown at crates/zeroclaw-infra/src/net_guard.rs:309

/// Validate and canonicalize a whole egress allowlist, sorted and deduplicated.
///
/// `label` names the surface in the error so an operator can find the offending
/// entry (for example `plugins.entries[github].egress_hosts`).
///
/// # Errors
///
/// Returns an error naming every rejected entry and why.
pub fn normalize_egress_patterns(patterns: &[String], label: &str) -> anyhow::Result<Vec<String>> {
    let mut rejected = Vec::new();
    let mut out = Vec::with_capacity(patterns.len());
    for raw in patterns {
        match normalize_egress_pattern(raw) {
            Ok(pattern) => out.push(pattern),
            Err(reason) => rejected.push(reason),
        }
    }
    if !rejected.is_empty() {
        anyhow::bail!("Invalid {label}: {}", rejected.join("; "));
    }
    out.sort_unstable();
    out.dedup();
    Ok(out)
}

/// Strict egress matching: the deny-by-default sibling of
/// [`host_matches_allowlist`].
///
/// `allowed` is expected to hold entries already canonicalized by
/// [`normalize_egress_pattern`]. Matching is:
/// - exact host equality, or
/// - `*.example.com` matching a **strict subdomain** of `example.com`.
///
/// An apex host never matches through a bare-domain entry's subdomains, a
/// suffix pattern never matches the apex, and there is no wildcard that matches
/// everything: an entry of `*` (which validation refuses) would only ever match
/// a literal host named `*`, so even an unvalidated list fails closed.

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Correct the invalid value described in the error detail.

When it happens

Trigger: Thrown at crates/zeroclaw-infra/src/net_guard.rs:309 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/93586f6c0c3b8f3f. Report an issue: GitHub.