zeroclaw-labs/zeroclaw · error · anyhow::Error
--level domain-block requires at least one --domain
Error message
--level domain-block requires at least one --domain
What it means
The domain-block level blocks named network domains, so at least one `--domain` is required; `build_engage_level` bails when the domains list is empty before engaging.
Source
Thrown at src/main.rs:6597
tools: Vec<String>,
) -> Result<security::EstopLevel> {
let requested = level.unwrap_or(EstopLevelArg::KillAll);
match requested {
EstopLevelArg::KillAll => {
if !domains.is_empty() || !tools.is_empty() {
bail!("--domain/--tool are only valid with --level domain-block/tool-freeze");
}
Ok(security::EstopLevel::KillAll)
}
EstopLevelArg::NetworkKill => {
if !domains.is_empty() || !tools.is_empty() {
bail!("--domain/--tool are not valid with --level network-kill");
}
Ok(security::EstopLevel::NetworkKill)
}
EstopLevelArg::DomainBlock => {
if domains.is_empty() {
bail!("--level domain-block requires at least one --domain");
}
if !tools.is_empty() {
bail!("--tool is not valid with --level domain-block");
}
Ok(security::EstopLevel::DomainBlock(domains))
}
EstopLevelArg::ToolFreeze => {
if tools.is_empty() {
bail!("--level tool-freeze requires at least one --tool");
}
if !domains.is_empty() {
bail!("--domain is not valid with --level tool-freeze");
}
Ok(security::EstopLevel::ToolFreeze(tools))
}
}
}
View on GitHub (pinned to 88bb9c8533)
Solutions
- Add one or more `--domain <host>` values
- Check flag spelling and shell expansion: the flag is `--domain` (repeatable) and variables must expand non-empty
- Use no `--level` (kill-all default) if a global stop was intended
Example fix
# before zeroclaw estop --level domain-block # after zeroclaw estop --level domain-block --domain api.example.com
Defensive patterns
Strategy: validation
Validate before calling
if [ "$level" = "domain-block" ] && [ "${#domains[@]}" -eq 0 ]; then
echo "--level domain-block requires at least one --domain"; exit 2
fi Prevention
- Build the domains array first and assert it is non-empty before invoking the CLI
- Use `set -u` so unset variables abort the script instead of expanding empty
When it happens
Trigger: `zeroclaw estop --level domain-block` with no `--domain` flags supplied.
Common situations: Typo in the flag name (`--domains`); flags lost behind a `--` separator or unexpanded empty shell variable in scripts; forgetting the selector when switching from kill-all.
Related errors
- --domain/--tool are only valid with --level domain-block/too
- --domain/--tool are not valid with --level network-kill
- --tool is not valid with --level domain-block
- --level tool-freeze requires at least one --tool
- --domain is not valid with --level tool-freeze
AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23).
Data as JSON: /api/errors/e26fd46b02fb2f13.
Report an issue: GitHub.