langflow-ai/langflow · error · Error
Build job not found
Error message
Build job not found
What it means
Thrown by buildUtils when the GET request to stream events for a build job_id returns 404. The build job was created (the initial POST succeeded) but by the time the client subscribes to its event stream, the backend no longer knows the job.
Source
Thrown at src/frontend/src/utils/buildUtils.ts:407
onBuildComplete,
onBuildError,
onGetOrderSuccess,
onValidateNodes,
};
return performStreamingRequest({
method: "GET",
url: eventsUrl,
onData: async (event) => {
const type = event["event"];
const data = event["data"];
return onEvent(type, data, buildResults, eventCallbacks);
},
onDataBatch: (events) =>
processBatchedEvents(events, buildResults, eventCallbacks, onEvent),
onError: (statusCode) => {
if (statusCode === 404) {
throw new Error("Build job not found");
}
throw new Error("Error processing build events");
},
onNetworkError: (error: Error) => {
if (error.name === "AbortError") {
onBuildStopped && onBuildStopped();
return;
}
onBuildError!("Error Building Component", [
"Network error. Please check the connection to the server.",
]);
},
buildController,
});
} else {
const callbacks = {
onBuildStart,
onBuildUpdate,View on GitHub (pinned to 976ec789d2)
Solutions
- Retry the whole build (new POST produces a fresh job_id) — usually succeeds after a transient restart
- If running multiple backend replicas, enable sticky sessions or route build job endpoints to a single instance
- Check backend restart/crash logs if the error repeats on every build
- Avoid backgrounding/suspending the tab between starting a build and watching its events
Defensive patterns
Strategy: retry
Try / catch
try {
await subscribeToBuildEvents(job_id);
} catch (e) {
if (e instanceof Error && e.message === "Build job not found") {
const { job_id: fresh } = await startBuildJob(postData); // full retry with a new job
await subscribeToBuildEvents(fresh);
} else throw e;
} Prevention
- Subscribe to the events stream immediately after the build POST — don't delay between the two calls
- Use sticky sessions or single-instance routing when scaling the backend horizontally
- Watch for backend restarts (deploy/oom) coinciding with builds
When it happens
Trigger: Subscribing to /build/{job_id}/events after the job expired (in-memory job registry cleared), the backend restarted between POST and GET, or multiple replicas behind a load balancer routed the events GET to an instance that never hosted the job.
Common situations: Backend restart or crash-loop during a build; horizontal scaling without sticky sessions for the events endpoint; long delay between build start and stream open (slow client, suspended tab).
Related errors
- Flow not found
- Error processing build events
- Error starting build process
- Error in streaming request.
- Job not found: {exc!s}
AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14).
Data as JSON: /api/errors/47db1e9538fc9ea5.
Report an issue: GitHub.