{"record":{"id":"fb907ad2108a3076","repo":"langflow-ai/langflow","slug":"failed-to-download-flows-response-statustext","errorCode":null,"errorMessage":"Failed to download flows: ${response.statusText}","messagePattern":"Failed to download flows: (.+?)","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/frontend/src/controllers/API/queries/flows/use-get-download-flows.ts","lineNumber":45,"sourceCode":"      const flowsArrayToProcess = [response.data];\n      const { flows } = processFlows(flowsArrayToProcess);\n\n      const flow = flows[0];\n      if (flow) {\n        downloadFlow(flow, flow.name, flow.description);\n      }\n    } else {\n      response = await fetch(`${getURL(\"FLOWS\", { mode: \"download/\" })}`, {\n        method: \"POST\",\n        body: JSON.stringify(params.ids),\n        headers: {\n          \"Content-Type\": \"application/json\",\n          Accept: \"application/x-zip-compressed\",\n        },\n        credentials: getFetchCredentials(),\n      });\n      if (!response.ok) {\n        throw new Error(`Failed to download flows: ${response.statusText}`);\n      }\n\n      const blob = await response.blob();\n      const url = URL.createObjectURL(blob);\n\n      const filename = parseContentDispositionFilename(\n        response.headers.get(\"Content-Disposition\"),\n        \"flows.zip\",\n      );\n\n      const link = document.createElement(\"a\");\n      link.href = url;\n      link.setAttribute(\"download\", filename);\n      document.body.appendChild(link);\n      link.click();\n      document.body.removeChild(link);\n\n      URL.revokeObjectURL(url);","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/frontend/src/controllers/API/queries/flows/use-get-download-flows.ts#L27-L63","documentation":"Catch-all 500 at the end of the PATCH MCP-settings endpoint. It re-raises HTTPExceptions untouched and wraps everything else, logging the full traceback first. It is the safety net for DB errors, serialization failures, and any of the inner steps (composer reconcile, URL building, session commit) that were not individually handled.","triggerScenarios":"Any PATCH /api/v1/mcp/projects/{project_id} where an inner step raises: SQLAlchemy commit failure, reconcile_mcp_server_for_auth_update error for apikey/none auth, or invalid auth_settings payload that survived earlier validation.","commonSituations":"DB connection drop mid-transaction; unique-constraint or JSON serialization issue on auth_settings; partial deployment where projects_mcp_helpers import fails.","solutions":["Read the logged traceback under 'Error updating project MCP settings' — it identifies the failing inner step.","Fix the named cause (DB connectivity, invalid settings value) and re-apply the PATCH.","Confirm auth_settings payload only contains fields the AuthSettings model expects."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    await client.patch(settings_url, json=payload)\nexcept httpx.HTTPStatusError as e:\n    if e.response.status_code == 500:\n        capture_server_log_window()  # aexception wrote the real traceback server-side","preventionTips":["Keep auth_settings payloads limited to documented AuthSettings fields.","Watch DB health; most catch-all wraps here are commit-time failures.","Correlate the 500 timestamp with server logs before changing client code."],"tags":["mcp","http-500","patch","catch-all"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}