{"record":{"id":"7f70ea8e65956dc2","repo":"langflow-ai/langflow","slug":"error-previewing-chunks","errorCode":null,"errorMessage":"Error previewing chunks.","messagePattern":"Error previewing chunks\\.","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"src/backend/base/langflow/api/v1/knowledge_bases.py","lineNumber":992,"sourceCode":"                        \"preview_chunks\": preview_chunks,\n                    }\n                )\n\n            except (OSError, ValueError, TypeError) as file_error:\n                logger.warning(\"Error previewing file %s: %s\", uploaded_file.filename, file_error)\n                file_previews.append(\n                    {\n                        \"file_name\": uploaded_file.filename or \"unknown\",\n                        \"total_chunks\": 0,\n                        \"preview_chunks\": [],\n                    }\n                )\n\n    except HTTPException:\n        raise\n    except Exception as e:\n        await logger.aerror(\"Error previewing chunks: %s\", e)\n        raise HTTPException(status_code=500, detail=\"Error previewing chunks.\") from e\n    else:\n        return {\"files\": file_previews}\n\n\n@router.post(\"/{kb_name}/ingest\", status_code=HTTPStatus.OK, dependencies=[Depends(_check_memory_base_association)])\nasync def ingest_files_to_knowledge_base(\n    kb_name: str,\n    current_user: CurrentActiveUser,\n    files: Annotated[list[UploadFile], File(description=\"Files to ingest into the knowledge base\")],\n    source_name: Annotated[str, Form()] = \"\",\n    # Mirrors the bounds on ``preview_chunks`` so ingestion can't be\n    # used to bypass the memory-footprint cap.\n    chunk_size: Annotated[int, Form(ge=MIN_CHUNK_SIZE, le=MAX_CHUNK_SIZE)] = 1000,\n    chunk_overlap: Annotated[int, Form(ge=MIN_CHUNK_OVERLAP, le=MAX_CHUNK_OVERLAP)] = 200,\n    separator: Annotated[str, Form()] = \"\",\n    column_config: Annotated[str, Form()] = \"\",\n    metadata: Annotated[\n        str,","sourceCodeStart":974,"sourceCodeEnd":1010,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/backend/base/langflow/api/v1/knowledge_bases.py#L974-L1010","documentation":"Error \"Error previewing chunks.\" thrown in langflow-ai/langflow.","triggerScenarios":"Occurs when an exception is raised while generating chunk previews for a knowledge base ingestion request.","commonSituations":"See trigger scenarios.","solutions":["Verify the file and embedding configuration, then retry the chunk preview.","Check server logs for the underlying ingestion error."],"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-15T22:17:37.221Z"}