Kuberwastaken/claurst · error

e.to_string()

Error message

e.to_string()

What it means

Generic re-wrapping sentinel: an error `e` produced inside the legacy SSE stream read loop is converted via anyhow!(e.to_string()) and sent over the endpoint-discovery oneshot channel. The original error is any failure of the stream task (read/parse error before the endpoint event arrived); this message only marks that the failure is being propagated to the waiter of endpoint discovery.

Solutions

  1. Inspect the preceding 'Legacy SSE stream closed with error' log line for the underlying cause
  2. Verify the server keeps the SSE stream open and announces an endpoint event
  3. Check network stability and auth for the SSE connection
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src-rust/crates/mcp/src/rmcp_backend.rs:314 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/0eff96338a6f6b57. Report an issue: GitHub.

Appendix: source

Thrown at src-rust/crates/mcp/src/rmcp_backend.rs:314

                        let _ = tx.send(Ok(endpoint));
                    }
                    return Ok(());
                }

                if data.trim().is_empty() {
                    return Ok(());
                }

                let message = parse_server_message(&server_name, data)?;
                let _ = incoming_tx.send(message);
                Ok(())
            })
            .await;

            if let Err(e) = result {
                tracing::warn!(server = %server_name, error = %e, "Legacy SSE stream closed with error");
                if let Some(tx) = lock_recover(&endpoint_tx_for_task).take() {
                    let _ = tx.send(Err(anyhow::anyhow!(e.to_string())));
                }
            } else if let Some(tx) = lock_recover(&endpoint_tx_for_task).take() {
                let _ = tx.send(Err(anyhow::anyhow!(
                    "legacy SSE stream closed before announcing endpoint"
                )));
            }
        });
        lock_recover(&self.background_tasks).push(task);

        let endpoint = tokio::time::timeout(std::time::Duration::from_secs(10), endpoint_rx)
            .await
            .map_err(|_| {
                anyhow::anyhow!(
                    "MCP server '{}': timed out waiting for legacy SSE endpoint event",
                    self.server_name
                )
            })?
            .map_err(|_| {

View on GitHub (pinned to b0637c97ec)