{"record":{"id":"cd530e71299d3bf1","repo":"langflow-ai/langflow","slug":"multiple-files-are-not-allowed","errorCode":null,"errorMessage":"Multiple files are not allowed","messagePattern":"Multiple files are not allowed","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/frontend/src/hooks/files/use-upload-file.ts","lineNumber":71,"sourceCode":"        if (validFiles.length === 0) {\n          throw new Error(\n            `No supported files found in folder. Allowed types: ${types?.join(\", \")}`,\n          );\n        }\n      }\n\n      for (const file of validFiles) {\n        validateFileSize(file);\n        // Check if file extension is allowed (for non-folder selection)\n        if (!webkitdirectory) {\n          const fileExtension = file.name.split(\".\").pop()?.toLowerCase();\n          if (!fileExtension || (types && !types.includes(fileExtension))) {\n            throw new Error(\n              `File type ${fileExtension} not allowed. Allowed types: ${types?.join(\", \")}`,\n            );\n          }\n          if (!multiple && filesToUpload.length !== 1) {\n            throw new Error(\"Multiple files are not allowed\");\n          }\n        }\n\n        const res = await uploadFileMutation({\n          file,\n        });\n\n        if (!webkitdirectory && res?.path) {\n          const existing = getRelativePathForServerPath(res.path);\n          if (existing && existing.includes(\"/\")) {\n            const flatName = String(res.path).split(\"/\").filter(Boolean).pop();\n            setRelativePathForServerPath(\n              res.path,\n              flatName ?? String(res.path),\n            );\n          }\n        }\n","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/frontend/src/hooks/files/use-upload-file.ts#L53-L89","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the logged traceback under 'Error installing MCP configuration'.","Validate the existing client config file is valid JSON (e.g. `python -m json.tool ~/.cursor/mcp.json`).","Fix permissions on the config directory for the user Langflow runs as.","If the existing config is corrupt, back it up, remove it, and retry install to regenerate it."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import json, pathlib\nif config_path.exists():\n    try:\n        json.loads(config_path.read_text())\n    except json.JSONDecodeError:\n        print(\"existing MCP config is corrupt; back it up and remove before install\")","typeGuard":null,"tryCatchPattern":"except httpx.HTTPStatusError as e:\n    if e.response.status_code == 500 and \"installing MCP\" in e.response.json().get(\"detail\", \"\"):\n        check_config_file_permissions_and_json()","preventionTips":["Keep client mcp.json files valid JSON; validate before triggering install.","Ensure the Langflow process user can write to the editor's config directory.","In containers, run install from a host-side Langflow, not the container."],"tags":["mcp","install","http-500","filesystem"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}