{"record":{"id":"357d3e2d03e1a7a8","repo":"langflow-ai/langflow","slug":"failed-to-load-file-http-status","errorCode":null,"errorMessage":"Failed to load file (HTTP ${status})","messagePattern":"Failed to load file \\(HTTP (.+?)\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"src/frontend/src/controllers/API/queries/agentic/use-file-content.ts:44","lineNumber":44,"sourceCode":"    queryFn: async (): Promise<string> => {\n      const url = `${getURL(\"AGENTIC_FILES\")}?${new URLSearchParams({ path }).toString()}`;\n      try {\n        const response = await api.get<string>(url, { responseType: \"text\" });\n        return response.data;\n      } catch (err) {\n        const status =\n          (err as { response?: { status?: number } } | undefined)?.response\n            ?.status ?? \"?\";\n        console.error(\"[useFileContent] axios get failed\", status, url, err);\n        throw new Error(`Failed to load file (HTTP ${status})`);\n      }\n    },","sourceCodeStart":null,"sourceCodeEnd":null,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/frontend/src/controllers/API/queries/agui/use-file-content.ts#L44","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    await client.post(messages_url, json=payload)\nexcept httpx.HTTPStatusError as e:\n    if e.response.status_code == 404 and \"disconnected\" in e.response.json().get(\"detail\", \"\"):\n        await reconnect_sse()  # new GET SSE session, then retry the POST once\n        await client.post(messages_url, json=payload)","preventionTips":["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."],"tags":["mcp","sse","disconnect","http-404"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}