{"record":{"id":"40396bec88da9673","repo":"block/buzz","slug":"host-must-not-be-empty","errorCode":null,"errorMessage":"--host must not be empty","messagePattern":"--host must not be empty","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/buzz-deletion/src/lib.rs","lineNumber":512,"sourceCode":"                .await?;\n            print_json(&sweep)?;\n            Ok(i32::from(sweep.unknown_object_count > 0))\n        }\n        Command::List { .. }\n        | Command::Inspect { .. }\n        | Command::Approve { .. }\n        | Command::Abort { .. }\n        | Command::Unblock { .. } => {\n            anyhow::bail!(\"database-only command reached full-service dispatcher\")\n        }\n    }\n}\n\nfn resolve_submit_host(host: Option<&str>, relay_url: Option<&str>) -> Result<String> {\n    if let Some(host) = host {\n        let host = host.trim();\n        if host.is_empty() {\n            anyhow::bail!(\"--host must not be empty\");\n        }\n        return Ok(host.to_owned());\n    }\n\n    let relay_url = relay_url\n        .map(str::trim)\n        .filter(|value| !value.is_empty())\n        .ok_or_else(|| {\n            anyhow::anyhow!(\"cannot derive community host; pass --host or set RELAY_URL\")\n        })?;\n    let host = buzz_core::tenant::relay_url_authority(relay_url);\n    if host.is_empty() {\n        anyhow::bail!(\n            \"cannot derive community host from RELAY_URL; pass --host or set a valid RELAY_URL\"\n        );\n    }\n    Ok(host)\n}","sourceCodeStart":494,"sourceCodeEnd":530,"githubUrl":"https://github.com/block/buzz/blob/dad5a33865fc81a2e55b3b60746632f615ec1e3a/crates/buzz-deletion/src/lib.rs#L494-L530","documentation":"resolve_submit_host trims the --host argument and rejects a whitespace-only value. An empty host would otherwise be submitted as the community host and produce a nonsense tenant scoping downstream, so the deletion CLI fails fast on the empty flag.","triggerScenarios":"Invoking the buzz-deletion submit flow with --host \"\" or --host \"   \" (e.g. from a shell script where $HOST expanded to an empty or blank string).","commonSituations":"CI scripts passing an unset variable: --host \"$COMMUNITY_HOST\" with the variable empty; copy-pasted commands with a placeholder that was never filled in.","solutions":["Pass a real community host (the relay authority, e.g. buzz.example.com)","Or omit --host entirely and rely on RELAY_URL derivation","Guard the calling script: [ -n \"${COMMUNITY_HOST// /}\" ] || { echo 'host required'; exit 1; }"],"exampleFix":"# before\nbuzz-deletion submit --host \"$COMMUNITY_HOST\" ...\n# (COMMUNITY_HOST unset -> expands to empty)\n# after\nbuzz-deletion submit --host \"buzz.example.com\" ...\n# or: export RELAY_URL=wss://buzz.example.com and omit --host","handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\nhost=\"${1:-}\"\n[ -n \"${host// /}\" ] || { echo \"--host must not be empty\" >&2; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use set -u in wrapper scripts so unset variables fail at assignment, not at flag expansion","Default --host from a checked variable: --host \"${COMMUNITY_HOST:?community host required}\""],"tags":["cli","input-validation","deletion","config"],"backgroundTag":"empty-cli-argument","analyzedSha":"dad5a33865fc81a2e55b3b60746632f615ec1e3a","analyzedAt":"2026-08-20T04:38:24.874Z","contentChangedAt":"2026-08-20T04:38:24.874Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}