{"record":{"id":"27600e3e76452de6","repo":"langflow-ai/langflow","slug":"the-uploaded-file-is-empty","errorCode":null,"errorMessage":"The uploaded file is empty","messagePattern":"The uploaded file is empty","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"src/backend/base/langflow/api/v1/flows.py","lineNumber":662,"sourceCode":"    session: DbSession,\n    file: Annotated[UploadFile | None, File()] = None,\n    current_user: CurrentActiveUser,\n    folder_id: UUID | None = None,\n    storage_service: Annotated[StorageService, Depends(get_storage_service)],\n):\n    \"\"\"Upload flows from a JSON or ZIP file (upsert semantics for flows with stable IDs).\"\"\"\n    # Authorization is enforced per-flow below, after parsing — the per-flow\n    # check uses the actual workspace_id/folder_id each uploaded flow targets.\n    # A coarse pre-parse check here would over-reject (it would authorize the\n    # caller against ``domain=\"*\", obj=\"flow:*\"`` regardless of where the\n    # uploaded flows actually land).\n    if file is None:\n        raise HTTPException(status_code=400, detail=\"No file provided\")\n\n    contents = await file.read()\n\n    if not contents:\n        raise HTTPException(status_code=400, detail=\"The uploaded file is empty\")\n\n    if zipfile.is_zipfile(io.BytesIO(contents)):\n        try:\n            flows_data = await extract_flows_from_zip(contents)\n        except ValueError as e:\n            raise HTTPException(status_code=400, detail=str(e)) from e\n        if not flows_data:\n            raise HTTPException(status_code=400, detail=\"No valid flow JSON files found in the ZIP\")\n        data = {\"flows\": flows_data}\n    else:\n        try:\n            data = orjson.loads(contents)\n        except orjson.JSONDecodeError as e:\n            raise HTTPException(status_code=400, detail=f\"Invalid JSON file: {e}\") from e\n\n    # Normalise code fields: if exported with code-as-lines format, rejoin to\n    # strings before creating the Pydantic models so the DB always stores strings.\n    if not isinstance(data, dict):","sourceCodeStart":644,"sourceCodeEnd":680,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/backend/base/langflow/api/v1/flows.py#L644-L680","documentation":"Error \"The uploaded file is empty\" thrown in langflow-ai/langflow.","triggerScenarios":"Occurs when the uploaded flow file has zero bytes of content.","commonSituations":"See trigger scenarios.","solutions":["Upload a non-empty JSON flow file."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}