netdata/netdata · error

{name} HTTP {}

Error message

{name} HTTP {}

What it means

otel-streams' SSE connector issues a GET with Accept: text/event-stream and treats any non-2xx response status as fatal, bailing with the source name and HTTP status (e.g. 'GitHub Events HTTP 403'). The message uses a runtime format on response.status(), so the logged text is the status line. A successful connect is logged before the byte-stream loop begins; this error is purely about the initial HTTP response.

Source

Thrown at src/crates/otel-streams/src/sse.rs:99

/// to stop (typically because the downstream channel closed). Returns `Ok` on
/// stream end or a read error so the caller's reconnect loop takes over.
pub async fn run<H, F>(name: &str, url: &str, mut handler: H) -> anyhow::Result<()>
where
    H: FnMut(serde_json::Value) -> F + Send + 'static,
    F: Future<Output = ControlFlow<(), ()>> + Send,
{
    info!("Connecting to {name}: {url}");

    let client = reqwest::Client::new();
    let response = client
        .get(url)
        .header(reqwest::header::USER_AGENT, USER_AGENT)
        .header(reqwest::header::ACCEPT, "text/event-stream")
        .send()
        .await?;

    if !response.status().is_success() {
        anyhow::bail!("{name} HTTP {}", response.status());
    }
    info!("Connected to {name}");

    let mut stream = response.bytes_stream();
    let mut decoder = SseDecoder::default();

    while let Some(chunk) = stream.next().await {
        let chunk = match chunk {
            Ok(c) => c,
            Err(e) => {
                error!("{name} SSE stream error: {e}");
                break;
            }
        };

        for raw in decoder.push(&chunk) {
            let value: serde_json::Value = match serde_json::from_str(&raw) {
                Ok(v) => v,

View on GitHub (pinned to 4864de85e2)

Solutions

  1. Check the status in the message: 401/403 → refresh/fix credentials; 404 → verify the URL; 429 → back off and respect rate limits
  2. Confirm any required auth headers/tokens are still valid for the SSE source
  3. Retry with exponential backoff for transient 5xx/429; treat 4xx (other than 429) as config errors, not retriable
Defensive patterns

Strategy: retry

Validate before calling

# smoke-check the stream URL and auth before the long-running connector
curl -sS -o /dev/null -w '%{http_code}\n' -H 'Accept: text/event-stream' "$SSE_URL" # expect 200

Try / catch

in the caller, catch the error, parse the trailing HTTP status: 429/5xx → backoff-and-retry with jitter; 401/403 → halt and refresh credentials; 404 → halt and fix the URL

Prevention

When it happens

Trigger: The SSE URL returns 401/403 (bad or expired token), 404 (wrong endpoint path), 429 (rate limited), or 5xx (upstream outage) when the connector connects.

Common situations: Expired GitHub tokens or hitting API rate limits on the events stream; typos in the stream URL; proxy or corporate gateways rejecting the long-lived connection; upstream maintenance windows.

Related errors


AI-assisted analysis of netdata/netdata@4864de85e2 (2026-08-15). Data as JSON: /api/errors/a377d109506c5723. Report an issue: GitHub.