{"record":{"id":"9bcbfac14563589c","repo":"Kuberwastaken/claurst","slug":"start-bridge-bridge-is-not-active-enabled-to","errorCode":null,"errorMessage":"start_bridge: bridge is not active (enabled={}, token={})","messagePattern":"start_bridge: bridge is not active \\(enabled=(.+?), token=(.+?)\\)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-rust/crates/bridge/src/lib.rs","lineNumber":840,"sourceCode":"        .timeout(std::time::Duration::from_secs(30))\r\n        .user_agent(format!(\"claude-code-rust/{}\", env!(\"CARGO_PKG_VERSION\")))\r\n        .build()\r\n        .context(\"start_bridge: failed to build HTTP client\")?;\r\n\r\n    start_bridge_with_client(config, http, cancel).await\r\n}\r\n\r\nasync fn start_bridge_with_client(\r\n    config: BridgeConfig,\r\n    _http: reqwest::Client,\r\n    cancel: CancellationToken,\r\n) -> anyhow::Result<(\r\n    mpsc::Receiver<BridgeMessage>,\r\n    mpsc::Sender<BridgeEvent>,\r\n    String,\r\n)> {\r\n    if !config.is_active() {\r\n        anyhow::bail!(\"start_bridge: bridge is not active (enabled={}, token={})\",\r\n            config.enabled,\r\n            config.session_token.is_some()\r\n        );\r\n    }\r\n\r\n    let mut session = BridgeSession::new(config);\r\n    session\r\n        .register()\r\n        .await\r\n        .context(\"start_bridge: session registration failed\")?;\r\n\r\n    let session_id = session.session_id().to_string();\r\n\r\n    // Bounded channels — back-pressure prevents unbounded memory growth on a\r\n    // slow consumer.\r\n    let (msg_tx, msg_rx) = mpsc::channel::<BridgeMessage>(64);\r\n    let (event_tx, event_rx) = mpsc::channel::<BridgeEvent>(256);\r\n\r","sourceCodeStart":822,"sourceCodeEnd":858,"githubUrl":"https://github.com/Kuberwastaken/claurst/blob/b0637c97ec34144387cbf2f74f65df6d16a6cef1/src-rust/crates/bridge/src/lib.rs#L822-L858","documentation":"`refresh_mcp_token` POSTs the refresh grant (`grant_type=refresh_token`) to the token endpoint. If the reqwest request fails at the transport level (DNS, connect, TLS, timeout), the error is wrapped as \"refresh: request failed: {}\". This is a network failure, distinct from the provider rejecting the refresh token with a non-2xx status.","triggerScenarios":"`client.post(token_endpoint).form(&params).send().await` returns Err while refreshing — unreachable network, DNS failure, TLS error, connection refused, or timeout.","commonSituations":"Machine went offline between getting and refreshing the token; proxy misconfiguration; token endpoint down or hostname wrong in the stored metadata; firewall blocking outbound HTTPS.","solutions":["Check connectivity to the token endpoint host (curl -v the URL).","Configure proxy env vars if a corporate proxy is required.","Verify the token_endpoint passed to `refresh_mcp_token` is still the provider's current endpoint (metadata may have changed).","Retry once connectivity is restored — refresh is idempotent until the token is actually rotated."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match refresh_mcp_token(server, endpoint).await {\n    Ok(t) => t,\n    Err(e) if e.to_string().contains(\"refresh: request failed\") => {\n        tokio::time::sleep(Duration::from_secs(5)).await;\n        refresh_mcp_token(server, endpoint).await\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Check outbound HTTPS connectivity before token-heavy operations","Keep the stored token_endpoint up to date with provider metadata","Configure proxies correctly in CI/corporate environments"],"tags":["network","oauth","refresh","reqwest"],"backgroundTag":"api-request-failed","analyzedSha":"b0637c97ec34144387cbf2f74f65df6d16a6cef1","analyzedAt":"2026-09-10T00:24:58.650Z","contentChangedAt":"2026-09-10T00:24:58.650Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}