langflow-ai/langflow · error · Error

Failed to download flows: ${response.statusText}

Error message

Failed to download flows: ${response.statusText}

What it means

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.

Source

Thrown at src/frontend/src/controllers/API/queries/flows/use-get-download-flows.ts:45

      const flowsArrayToProcess = [response.data];
      const { flows } = processFlows(flowsArrayToProcess);

      const flow = flows[0];
      if (flow) {
        downloadFlow(flow, flow.name, flow.description);
      }
    } else {
      response = await fetch(`${getURL("FLOWS", { mode: "download/" })}`, {
        method: "POST",
        body: JSON.stringify(params.ids),
        headers: {
          "Content-Type": "application/json",
          Accept: "application/x-zip-compressed",
        },
        credentials: getFetchCredentials(),
      });
      if (!response.ok) {
        throw new Error(`Failed to download flows: ${response.statusText}`);
      }

      const blob = await response.blob();
      const url = URL.createObjectURL(blob);

      const filename = parseContentDispositionFilename(
        response.headers.get("Content-Disposition"),
        "flows.zip",
      );

      const link = document.createElement("a");
      link.href = url;
      link.setAttribute("download", filename);
      document.body.appendChild(link);
      link.click();
      document.body.removeChild(link);

      URL.revokeObjectURL(url);

View on GitHub (pinned to 976ec789d2)

Solutions

  1. Read the logged traceback under 'Error updating project MCP settings' — it identifies the failing inner step.
  2. Fix the named cause (DB connectivity, invalid settings value) and re-apply the PATCH.
  3. Confirm auth_settings payload only contains fields the AuthSettings model expects.
Defensive patterns

Strategy: try-catch

Try / catch

try:
    await client.patch(settings_url, json=payload)
except httpx.HTTPStatusError as e:
    if e.response.status_code == 500:
        capture_server_log_window()  # aexception wrote the real traceback server-side

Prevention

When it happens

Trigger: 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.

Common situations: DB connection drop mid-transaction; unique-constraint or JSON serialization issue on auth_settings; partial deployment where projects_mcp_helpers import fails.

Related errors


AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14). Data as JSON: /api/errors/fb907ad2108a3076. Report an issue: GitHub.