{"record":{"id":"86c0650ae79dca06","repo":"block/buzz","slug":"cannot-derive-community-host-from-relay-url-pass","errorCode":null,"errorMessage":"cannot derive community host from RELAY_URL; pass --host or set a valid RELAY_URL","messagePattern":"cannot derive community host from RELAY_URL; pass --host or set a valid RELAY_URL","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/buzz-deletion/src/lib.rs","lineNumber":525,"sourceCode":"\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}\n\nasync fn connect_store() -> Result<DeletionStore> {\n    let database_url = required_env(\"DATABASE_URL\")?;\n    let db = Db::new(\n        &DbConfig {\n            database_url,\n            max_connections: env_parse(\"BUZZ_DB_POOL_SIZE\", 20),\n            ..DbConfig::default()\n        }\n        .with_session_timeouts_from_env(),\n    )\n    .await?;\n    Ok(store(&db))","sourceCodeStart":507,"sourceCodeEnd":543,"githubUrl":"https://github.com/block/buzz/blob/dad5a33865fc81a2e55b3b60746632f615ec1e3a/crates/buzz-deletion/src/lib.rs#L507-L543","documentation":"When --host is not given, the deletion CLI derives the community host from RELAY_URL via buzz_core::tenant::relay_url_authority. This error means RELAY_URL was unset/blank, or its authority parsed empty — typically a URL without a scheme such as localhost:3000.","triggerScenarios":"Running a submit command with neither --host nor a usable RELAY_URL; or RELAY_URL=\"localhost:3000\" / RELAY_URL=\"buzz.example.com\" without the ws:// or wss:// prefix, so the authority extraction returns an empty string.","commonSituations":"Fresh shell without .env sourced; docker-compose env passthrough dropped; a RELAY_URL value written without a scheme by a deployment script.","solutions":["Export a fully-qualified relay URL: export RELAY_URL=wss://buzz.example.com (or ws://localhost:3000 for local dev)","Or pass the host explicitly: --host buzz.example.com","Verify with: echo \"$RELAY_URL\" and confirm the scheme is present"],"exampleFix":"# before\nexport RELAY_URL=localhost:3000\n# after\nexport RELAY_URL=ws://localhost:3000","handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\n# require a schemed relay URL before running deletion commands\n: \"${RELAY_URL:?set RELAY_URL (ws:// or wss://) or pass --host}\"\ncase \"$RELAY_URL\" in ws://*|wss://*) ;; *) echo \"RELAY_URL must start with ws:// or wss://\" >&2; exit 1;; esac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Source the project .env in every shell or wrapper that runs deletion commands","Store RELAY_URL with its scheme in your deployment config so authority derivation always succeeds"],"tags":["env-var","deletion","relay-url","cli","config"],"backgroundTag":"relay-url-misconfigured","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"}