ruvnet/ruflo · error

Upstream error: ${err.message}

Error message

Upstream error: ${err.message}

What it means

The chat-completions proxy's upstream fetch rejected or returned an error (network failure, non-2xx, or provider rejection). The catch block wraps the upstream's own err.message with the 'Upstream error' prefix and returns the error response to the client; the root cause text comes from the provider call.

Source

Thrown at ruflo/src/mcp-bridge/index.js:1686

    res.setHeader("Content-Type", upstream.headers.get("content-type") || "application/json");

    if (req.body?.stream && upstream.body) {
      const reader = upstream.body.getReader();
      const decoder = new TextDecoder();
      try {
        while (true) {
          const { done, value } = await reader.read();
          if (done) break;
          res.write(decoder.decode(value, { stream: true }));
        }
      } catch (e) { /* stream closed */ }
      finally { res.end(); }
    } else {
      res.send(await upstream.text());
    }
  } catch (err) {
    console.error(`Proxy error [${providerName}/${model}]:`, err.message);
    res.status(502).json({ error: { message: `Upstream error: ${err.message}` } });
  }
});

// =============================================================================
// MODELS & HEALTH
// =============================================================================

const KNOWN_MODELS = [
  "gemini-2.5-pro", "gemini-2.5-flash",
  "gpt-4.1", "gpt-4.1-mini", "gpt-4o", "gpt-4o-mini",
  "o3-mini", "o1-mini",
];

app.get("/models", (_, res) => {
  res.json({ object: "list", data: KNOWN_MODELS.map(id => ({ id, object: "model", owned_by: "system" })) });
});

app.get("/health", (_, res) => {

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Inspect the upstream provider error message; retry transient failures with backoff.
  2. Verify provider credentials, quotas, and request shape against the provider's API documentation.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at ruflo/src/mcp-bridge/index.js:1686 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/a6f527f9b785417e. Report an issue: GitHub.