langflow-ai/langflow · error · Error
Error in streaming request.
Error message
Error in streaming request.
What it means
Thrown by performStreamingRequest in controllers/API when the fetch for a streaming endpoint returns a non-OK response and no onError callback was supplied. The helper delegates status handling to onError; without it, all it can do is raise this generic error, and the stream is never read.
Source
Thrown at src/frontend/src/controllers/API/api.tsx:347
const params: RequestInit = {
method: method,
headers: headers,
signal: buildController.signal,
credentials: getFetchCredentials(),
};
if (body) {
params.body = JSON.stringify(body);
}
let current: string[] = [];
const textDecoder = new TextDecoder();
try {
const response = await fetch(url, params);
if (!response.ok) {
if (onError) {
onError(response.status);
} else {
throw new Error("Error in streaming request.");
}
}
if (response.body === null) {
return;
}
const reader = response.body.getReader();
while (true) {
const { done, value } = await reader.read();
if (done) {
break;
}
const decodedChunk = textDecoder.decode(value);
const all = decodedChunk.split("\n\n");
// Parse all complete events from this chunk first
const parsedEvents: object[] = [];
for (const string of all) {
if (string.endsWith("}")) {View on GitHub (pinned to 976ec789d2)
Solutions
- Pass an onError callback so callers receive the real status code instead of a generic throw
- Check devtools for the actual status of the failing stream request and fix the underlying cause (auth, 404, 500)
- If 401/403, refresh the session and retry once
- Verify the URL and payload shape match the current backend version after upgrades
Example fix
// before
await performStreamingRequest({ method: "POST", url, body });
// after
await performStreamingRequest({
method: "POST",
url,
body,
onError: (status) => {
if (status === 401) refreshSession();
else setStreamError(`Stream failed with ${status}`);
},
}); Defensive patterns
Strategy: try-catch
Try / catch
try {
await performStreamingRequest({ method, url, body, onError: (status) => {
streamErrors.push(status); // always pass onError; the generic throw is the no-onError fallback
}});
} catch (e) {
if (e instanceof Error && e.message === "Error in streaming request.") {
// no onError was wired; add one to learn the real status
} else throw e;
} Prevention
- Always pass an onError callback to performStreamingRequest
- Handle 401 with a session refresh and one retry
- Validate the URL/payload against the current backend API version before streaming
When it happens
Trigger: Calling performStreamingRequest({url, ...}) where url returns 4xx/5xx and the options object omits onError — e.g. an SSE/build/chat endpoint returning 401 after token expiry or 404 for a missing resource.
Common situations: New call sites forgetting the onError parameter; expired sessions hitting stream endpoints; endpoints returning 404 after a route rename in a newer backend.
Related errors
- Error processing build events
- Error starting build process
- Build job not found
- Invalid flow data
- Deployment name is required
AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14).
Data as JSON: /api/errors/017d7fd548976d77.
Report an issue: GitHub.