langflow-ai/langflow · error · Error

Multiple files are not allowed

Error message

Multiple files are not allowed

What it means

Catch-all 500 at the end of the install endpoint: HTTPExceptions pass through, everything else is logged ('Error installing MCP configuration') and wrapped. It covers config file read/write failures — permission errors, unreadable existing JSON, disk issues — during the config merge and write.

Source

Thrown at src/frontend/src/hooks/files/use-upload-file.ts:71

        if (validFiles.length === 0) {
          throw new Error(
            `No supported files found in folder. Allowed types: ${types?.join(", ")}`,
          );
        }
      }

      for (const file of validFiles) {
        validateFileSize(file);
        // Check if file extension is allowed (for non-folder selection)
        if (!webkitdirectory) {
          const fileExtension = file.name.split(".").pop()?.toLowerCase();
          if (!fileExtension || (types && !types.includes(fileExtension))) {
            throw new Error(
              `File type ${fileExtension} not allowed. Allowed types: ${types?.join(", ")}`,
            );
          }
          if (!multiple && filesToUpload.length !== 1) {
            throw new Error("Multiple files are not allowed");
          }
        }

        const res = await uploadFileMutation({
          file,
        });

        if (!webkitdirectory && res?.path) {
          const existing = getRelativePathForServerPath(res.path);
          if (existing && existing.includes("/")) {
            const flatName = String(res.path).split("/").filter(Boolean).pop();
            setRelativePathForServerPath(
              res.path,
              flatName ?? String(res.path),
            );
          }
        }

View on GitHub (pinned to 976ec789d2)

Solutions

  1. Check the logged traceback under 'Error installing MCP configuration'.
  2. Validate the existing client config file is valid JSON (e.g. `python -m json.tool ~/.cursor/mcp.json`).
  3. Fix permissions on the config directory for the user Langflow runs as.
  4. If the existing config is corrupt, back it up, remove it, and retry install to regenerate it.
Defensive patterns

Strategy: try-catch

Validate before calling

import json, pathlib
if config_path.exists():
    try:
        json.loads(config_path.read_text())
    except json.JSONDecodeError:
        print("existing MCP config is corrupt; back it up and remove before install")

Try / catch

except httpx.HTTPStatusError as e:
    if e.response.status_code == 500 and "installing MCP" in e.response.json().get("detail", ""):
        check_config_file_permissions_and_json()

Prevention

When it happens

Trigger: POST /{project_id}/install where config_path.open('w') or reading the existing mcp.json raises: file owned by another user, read-only filesystem, existing config containing invalid JSON that json.load cannot parse.

Common situations: Langflow running in a container without write access to the mounted home dir; an mcp.json previously hand-edited with a syntax error; SELinux denying writes to ~/.cursor.

Related errors


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