zeroclaw-labs/zeroclaw · error
Invalid entry(s): [ ]. Each entry must be a valid domain…
Error message
Invalid {label} entry(s): [{}]. Each entry must be a valid domain, hostname, IPv4, or IPv6 address. What it means
Validation failure in normalize_allowed_domains: one or more entries in a domain allowlist failed normalize_domain, and every rejected entry is collected and listed in the message so a single error reports all bad values at once. The {label} placeholder names the allowlist surface (for example a plugins.entries egress list), letting the operator find the offending config key.
Solutions
- Fix the listed entries so each is a valid domain, hostname, IPv4, or IPv6 address.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/zeroclaw-infra/src/net_guard.rs:116 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/157ee7a08fcbd204.
Report an issue: GitHub.
Appendix: source
Thrown at crates/zeroclaw-infra/src/net_guard.rs:116
/// domain, hostname, IPv4, or IPv6 address.
///
/// # Errors
///
/// Returns an error naming every rejected entry when one or more entries
/// fail [`normalize_domain`].
pub fn normalize_allowed_domains(domains: Vec<String>, label: &str) -> anyhow::Result<Vec<String>> {
let mut rejected = Vec::new();
let mut normalized = domains
.into_iter()
.filter_map(|d| {
normalize_domain(&d).or_else(|| {
rejected.push(d.clone());
None
})
})
.collect::<Vec<_>>();
if !rejected.is_empty() {
anyhow::bail!(
"Invalid {label} entry(s): [{}]. Each entry must be a valid domain, hostname, IPv4, or IPv6 address.",
rejected.join(", ")
);
}
normalized.sort_unstable();
normalized.dedup();
Ok(normalized)
}
// ── host matching ─────────────────────────────────────────────────
/// True when `host` matches any entry in a normalized `allowed` list.
///
/// Matching rules, unchanged from the tool-layer original:
/// - a bare `*` entry matches everything;
/// - a `*.example.com` entry matches `example.com` and any subdomain;
/// - an IP entry, or an IP host, matches only exactly;
/// - a bare domain entry matches itself and any subdomain of it.View on GitHub (pinned to 88bb9c8533)