Kuberwastaken/claurst · error · anyhow::Error

Bridge session registration failed: server returned HTTP

Error message

Bridge session registration failed: server returned HTTP {}. {}

What it means

Thrown when the bridge session registration endpoint replies with any status other than 200 and 401/404 (which are handled separately). Indicates the server rejected the POST /api/bridge/sessions call for an unclassified reason — e.g. 5xx outage, 400 bad request, or a proxy error — and registration could not complete.

Solutions

  1. Check the bridge service status and retry; transient 5xx responses usually resolve on their own
  2. Inspect the response body/logs for the exact status code to classify the failure
  3. If the deployment does not support the sessions endpoint (404 path), rely on the synthetic session URL best-effort mode instead
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src-rust/crates/bridge/src/lib.rs:1015 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Kuberwastaken/claurst@b0637c97ec (2026-09-10). Data as JSON: /api/errors/9cdf392eefa87d38. Report an issue: GitHub.

Appendix: source

Thrown at src-rust/crates/bridge/src/lib.rs:1015

            anyhow::bail!(
                "Bridge session registration failed: authentication error (HTTP {}).\n\
                 Your token may be invalid or expired.\n\
                 Get a new token from https://claude.ai (Settings → Remote Control).",
                status
            );
        }
        404 => {
            // The /api/bridge/sessions endpoint may not exist in all deployments.
            // Fall through to synthetic session URL (best-effort mode).
            warn!(
                session_id = %session_id,
                "Bridge registration endpoint not found (HTTP 404) — \
                 using local session ID without server validation"
            );
        }
        _ => {
            let body_text = resp.text().await.unwrap_or_default();
            anyhow::bail!(
                "Bridge session registration failed: server returned HTTP {}. {}",
                status,
                if body_text.is_empty() { String::new() } else { format!("Response: {}", &body_text[..body_text.len().min(200)]) }
            );
        }
    }

    // Build the shareable session URL.
    let session_url = format!("{}/code/sessions/{}", server_url, session_id);

    Ok(BridgeSessionInfo {
        session_id,
        session_url,
        token,
    })
}

/// Poll for incoming messages on an active bridge session.

View on GitHub (pinned to b0637c97ec)