block/buzz · error · anyhow::Error

observer control subscribe error: {e}

Error message

observer control subscribe error: {e}

What it means

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.

Source

Thrown at crates/buzz-acp/src/lib.rs:2691

    let mut relay_observer_publisher = None;
    if config.relay_observer {
        if let (Some(observer), Some(owner_pubkey_hex)) =
            (observer.clone(), owner_cache.pubkey.clone())
        {
            match PublicKey::from_hex(&owner_pubkey_hex) {
                Ok(owner_pubkey) => {
                    relay_observer_publisher = Some((
                        observer,
                        relay.event_publisher(),
                        config.keys.clone(),
                        pubkey_hex.clone(),
                        owner_pubkey_hex,
                        owner_pubkey,
                    ));
                    relay
                        .subscribe_observer_controls()
                        .await
                        .map_err(|e| anyhow::anyhow!("observer control subscribe error: {e}"))?;
                    relay_observer_control_rx = relay.take_observer_control_rx();
                    tracing::info!("relay observer enabled");
                }
                Err(error) => {
                    tracing::warn!("relay observer disabled: invalid owner pubkey: {error}");
                }
            }
        } else {
            tracing::warn!(
                "relay observer requested but no agent owner was resolved at startup; \
                 observer frames will not be published"
            );
        }
    }

    let channel_info_map = relay
        .discover_channels()
        .await

View on GitHub (pinned to dad5a33865)

Solutions

  1. Verify the relay is a current build that supports observer controls (check relay version/logs for the rejected REQ)
  2. Check the harness auth env: BUZZ_RELAY_URL, BUZZ_PRIVATE_KEY, BUZZ_AUTH_TAG
  3. Retry startup — if the failure was a transient drop, the next connect/subscribe succeeds
  4. If the owner pubkey is invalid you will instead see the 'relay observer disabled' warning — confirm this error is the subscribe, not owner resolution
Defensive patterns

Strategy: retry

Validate before calling

# Preflight: relay reachable and version supports observer controls
curl -fsS "${BUZZ_RELAY_URL%/}/" >/dev/null || { echo 'relay unreachable' >&2; exit 1; }

Try / catch

// Retry loop around harness startup; give up only on repeated auth-shaped failures
for attempt in 1..=5 {
    match run_harness(config.clone()).await {
        Err(e) if e.to_string().contains("observer control subscribe") && attempt < 5 => {
            tracing::warn!(attempt, "observer subscribe failed; retrying");
            tokio::time::sleep(Duration::from_secs(2 * attempt)).await;
        }
        other => return other.map(|_| ()),
    }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of block/buzz@dad5a33865 (2026-08-20). Data as JSON: /api/errors/74f834c7d480f597. Report an issue: GitHub.