diegosouzapw/OmniRoute · error
api_bridge_timeout
api_bridge_timeout
Error message
Proxy request timed out after ${proxyTimeoutMs}ms What it means
apiBridgeServer timeout handler: the HTTP proxy forwarding the request from the API port to the dashboard port exceeded proxyTimeoutMs and was destroyed. Emits a 504 JSON body with code api_bridge_timeout; SSE responses get setTimeout(0) and are exempt.
Solutions
- Increase the bridge proxy timeout for long-running requests
- Retry — slow dashboard-port handlers may succeed on a second pass
- Hit the dashboard port directly for streaming endpoints
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at src/lib/apiBridgeServer.ts:67 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/42dc0b1be0036d93.
Report an issue: GitHub.
Appendix: source
Thrown at src/lib/apiBridgeServer.ts:67
host: `127.0.0.1:${dashboardPort}`,
},
timeout: proxyTimeoutMs,
},
(targetRes) => {
const contentType = String(targetRes.headers["content-type"] || "").toLowerCase();
if (contentType.includes("text/event-stream")) {
targetReq.setTimeout(0);
}
res.writeHead(targetRes.statusCode || 502, targetRes.headers);
targetRes.pipe(res);
}
);
targetReq.on("timeout", () => {
targetReq.destroy();
if (res.headersSent) return;
res.writeHead(504, { "content-type": "application/json" });
res.end(
JSON.stringify({
error: "api_bridge_timeout",
detail: `Proxy request timed out after ${proxyTimeoutMs}ms`,
})
);
});
targetReq.on("error", (error) => {
if (res.headersSent) return;
res.writeHead(502, { "content-type": "application/json" });
res.end(
JSON.stringify({
error: "api_bridge_unavailable",
detail: String(error.message || error),
})
);
});View on GitHub (pinned to a179ffed5b)