langflow-ai/langflow · warning · Error
Failed to load file (HTTP ${status})
Error message
Failed to load file (HTTP ${status}) What it means
404 raised when the POST leg of the SSE transport hits anyio's BrokenResourceError, meaning the underlying SSE stream for that project is already gone (client disconnected or server-side session torn down). The message explicitly says the project MCP server disconnected and includes the exception text.
Source
Thrown at src/frontend/src/controllers/API/queries/agentic/use-file-content.ts:44:44
queryFn: async (): Promise<string> => {
const url = `${getURL("AGENTIC_FILES")}?${new URLSearchParams({ path }).toString()}`;
try {
const response = await api.get<string>(url, { responseType: "text" });
return response.data;
} catch (err) {
const status =
(err as { response?: { status?: number } } | undefined)?.response
?.status ?? "?";
console.error("[useFileContent] axios get failed", status, url, err);
throw new Error(`Failed to load file (HTTP ${status})`);
}
},View on GitHub (pinned to 976ec789d2)
Solutions
- Reconnect the MCP client — reissue the GET SSE request to establish a fresh session before POSTing messages.
- Check that the mcp-composer process (if OAuth mode) is running: docker/service logs for the composer subprocess.
- Raise proxy idle/read timeouts (e.g. proxy_read_timeout) so the SSE stream is not cut mid-session.
- If it recurs frequently, look for composer OOM/crash loops in server logs.
Defensive patterns
Strategy: retry
Try / catch
try:
await client.post(messages_url, json=payload)
except httpx.HTTPStatusError as e:
if e.response.status_code == 404 and "disconnected" in e.response.json().get("detail", ""):
await reconnect_sse() # new GET SSE session, then retry the POST once
await client.post(messages_url, json=payload) Prevention
- Configure MCP clients with keepalive/short reconnect intervals so dead SSE sessions are re-established promptly.
- Raise proxy idle timeouts on the SSE route.
- Monitor the mcp-composer subprocess; most disconnects follow a composer restart.
When it happens
Trigger: POST /api/v1/mcp/projects/{project_id}/messages after the GET SSE stream for the same session has closed — server restart, MCP Composer process exit, proxy idle-timeout killing the SSE connection, or the client reconnecting with a stale session id.
Common situations: Langflow backend restart while an MCP client held an SSE session; mcp-composer subprocess crash; long-lived connections dropped by nginx/traefik idle timeouts and the client posting on the dead session.
Related errors
- MCP Server disconnected, error: {e}
- reload-in-progress
- An error occurred while uploading the file
- Internal server error: {e}
- Project not found
AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14).
Data as JSON: /api/errors/357d3e2d03e1a7a8.
Report an issue: GitHub.