{"record":{"id":"25b6d4c7114bd9aa","repo":"block/buzz","slug":"channel-discovery-error-e","errorCode":null,"errorMessage":"channel discovery error: {e}","messagePattern":"channel discovery error: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/buzz-acp/src/lib.rs","lineNumber":2710,"sourceCode":"                    relay_observer_control_rx = relay.take_observer_control_rx();\n                    tracing::info!(\"relay observer enabled\");\n                }\n                Err(error) => {\n                    tracing::warn!(\"relay observer disabled: invalid owner pubkey: {error}\");\n                }\n            }\n        } else {\n            tracing::warn!(\n                \"relay observer requested but no agent owner was resolved at startup; \\\n                 observer frames will not be published\"\n            );\n        }\n    }\n\n    let channel_info_map = relay\n        .discover_channels()\n        .await\n        .map_err(|e| anyhow::anyhow!(\"channel discovery error: {e}\"))?;\n\n    tracing::info!(\"discovered {} channel(s)\", channel_info_map.len());\n    let channel_ids: Vec<Uuid> = channel_info_map.keys().copied().collect();\n\n    let rules: Vec<SubscriptionRule> = match config.subscribe_mode {\n        SubscribeMode::Mentions => {\n            vec![SubscriptionRule {\n                name: \"mentions\".into(),\n                channels: filter::ChannelScope::All(\"all\".into()),\n                kinds: config.kinds_override.clone().unwrap_or_else(|| {\n                    vec![\n                        KIND_STREAM_MESSAGE,\n                        KIND_WORKFLOW_APPROVAL_REQUESTED,\n                        KIND_STREAM_REMINDER,\n                    ]\n                }),\n                require_mention: !config.no_mention_filter,\n                filter: None,","sourceCodeStart":2692,"sourceCodeEnd":2728,"githubUrl":"https://github.com/block/buzz/blob/dad5a33865fc81a2e55b3b60746632f615ec1e3a/crates/buzz-acp/src/lib.rs#L2692-L2728","documentation":"discover_channels() is the harness's startup query that enumerates the community's channels (channel_info_map) before subscription rules are built. Its failure aborts harness startup with this wrapped error — no channels means no subscription rules can be constructed.","triggerScenarios":"The relay connection drops between connect and discovery, the discovery REQ is rejected by the relay (auth token missing the community scope), or the relay's DB errors while serving the query.","commonSituations":"Relay restarting under the harness; wrong community host in BUZZ_RELAY_URL so the query hits a relay that rejects it; expired NIP-42 auth; Postgres briefly unavailable on the relay side.","solutions":["Confirm the relay is up and reachable (curl the NIP-11 endpoint of the same host)","Verify BUZZ_RELAY_URL points at the intended community and the auth env vars are set","Retry harness startup after the relay is healthy","Check relay-side logs for the failed query if retries keep failing"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"# Preflight: confirm the relay is serving before starting the harness\ncurl -fsS \"$(echo \"$BUZZ_RELAY_URL\" | sed 's|^ws\\(s\\)\\?://|http\\1://')/\" >/dev/null \\\n  || { echo 'relay not reachable' >&2; exit 1; }","typeGuard":null,"tryCatchPattern":"// Treat discovery failure as transient; abort only after backoff is exhausted\nmatch relay.discover_channels().await {\n    Err(e) if retryable(&e) && attempt < MAX => { backoff.wait().await; continue; }\n    other => return other.map(|_| ()),\n}","preventionTips":["Start the relay before the harness in docker-compose (depends_on with healthcheck)","Alert on repeated discovery failures — they usually mean the relay or its database is unhealthy, not a harness bug"],"tags":["buzz-acp","relay","channels","discovery","startup","network"],"backgroundTag":"relay-request-failed","analyzedSha":"dad5a33865fc81a2e55b3b60746632f615ec1e3a","analyzedAt":"2026-08-20T04:38:24.874Z","contentChangedAt":"2026-08-20T04:38:24.874Z","schemaVersion":2},"datasetVersion":"2026-09-08T20:17:18.057Z"}