{"record":{"id":"74f834c7d480f597","repo":"block/buzz","slug":"observer-control-subscribe-error-e","errorCode":null,"errorMessage":"observer control subscribe error: {e}","messagePattern":"observer control subscribe error: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/buzz-acp/src/lib.rs","lineNumber":2691,"sourceCode":"    let mut relay_observer_publisher = None;\n    if config.relay_observer {\n        if let (Some(observer), Some(owner_pubkey_hex)) =\n            (observer.clone(), owner_cache.pubkey.clone())\n        {\n            match PublicKey::from_hex(&owner_pubkey_hex) {\n                Ok(owner_pubkey) => {\n                    relay_observer_publisher = Some((\n                        observer,\n                        relay.event_publisher(),\n                        config.keys.clone(),\n                        pubkey_hex.clone(),\n                        owner_pubkey_hex,\n                        owner_pubkey,\n                    ));\n                    relay\n                        .subscribe_observer_controls()\n                        .await\n                        .map_err(|e| anyhow::anyhow!(\"observer control subscribe error: {e}\"))?;\n                    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","sourceCodeStart":2673,"sourceCodeEnd":2709,"githubUrl":"https://github.com/block/buzz/blob/dad5a33865fc81a2e55b3b60746632f615ec1e3a/crates/buzz-acp/src/lib.rs#L2673-L2709","documentation":"At harness startup, after the agent owner pubkey is resolved, buzz-acp subscribes to observer control events on the relay (subscribe_observer_controls). A failure there is fatal for startup: without the control subscription the observer channel cannot receive commands, so the harness aborts with this wrapped error.","triggerScenarios":"The WebSocket connects but the observer-control REQ is rejected or immediately closed: relay build predates observer controls, the auth token (BUZZ_AUTH_TAG/NIP-42) lacks the needed access, or the socket drops exactly during the subscribe call.","commonSituations":"BUZZ_RELAY_URL pointed at an older/staging relay without observer support; expired or wrong auth tag env; transient network blip during agent startup in flaky environments.","solutions":["Verify the relay is a current build that supports observer controls (check relay version/logs for the rejected REQ)","Check the harness auth env: BUZZ_RELAY_URL, BUZZ_PRIVATE_KEY, BUZZ_AUTH_TAG","Retry startup — if the failure was a transient drop, the next connect/subscribe succeeds","If the owner pubkey is invalid you will instead see the 'relay observer disabled' warning — confirm this error is the subscribe, not owner resolution"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"# Preflight: relay reachable and version supports observer controls\ncurl -fsS \"${BUZZ_RELAY_URL%/}/\" >/dev/null || { echo 'relay unreachable' >&2; exit 1; }","typeGuard":null,"tryCatchPattern":"// Retry loop around harness startup; give up only on repeated auth-shaped failures\nfor attempt in 1..=5 {\n    match run_harness(config.clone()).await {\n        Err(e) if e.to_string().contains(\"observer control subscribe\") && attempt < 5 => {\n            tracing::warn!(attempt, \"observer subscribe failed; retrying\");\n            tokio::time::sleep(Duration::from_secs(2 * attempt)).await;\n        }\n        other => return other.map(|_| ()),\n    }\n}","preventionTips":["Keep harness and relay versions from the same release so observer-control support is guaranteed","Validate BUZZ_RELAY_URL and the auth tag in deployment preflight before the harness starts"],"tags":["buzz-acp","websocket","relay","subscription","startup","network"],"backgroundTag":"websocket-subscribe-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"}