{"record":{"id":"b58d6be64db147af","repo":"langflow-ai/langflow","slug":"internal-error-creating-knowledge-base","errorCode":null,"errorMessage":"Internal error creating knowledge base","messagePattern":"Internal error creating knowledge base","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"src/backend/base/langflow/api/v1/knowledge_bases.py","lineNumber":880,"sourceCode":"            size=0,\n            words=0,\n            characters=0,\n            chunks=0,\n            avg_chunk_size=0.0,\n            status=\"empty\",\n            column_config=column_config_dicts,\n            backend_type=backend_type_value,\n            backend_config=backend_config_value,\n        )\n\n    except HTTPException:\n        raise\n    except Exception as e:\n        # Clean up if something went wrong\n        if kb_path.exists():\n            KBStorageHelper.delete_storage(kb_path, kb_name)\n        await logger.aerror(\"Error creating knowledge base: %s\", e)\n        raise HTTPException(status_code=500, detail=\"Internal error creating knowledge base\") from e\n\n\n@router.post(\"/preview-chunks\", status_code=HTTPStatus.OK)\nasync def preview_chunks(\n    current_user: CurrentActiveUser,\n    files: Annotated[list[UploadFile], File(description=\"Files to preview chunking for\")],\n    # Upper bounds cap the memory footprint of a preview request.\n    # ``max_chunks * chunk_size * CHUNK_PREVIEW_MULTIPLIER`` is the\n    # largest text slice this endpoint will hold in memory — without\n    # these bounds, an authenticated user can request gigabytes.\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\",\n    max_chunks: Annotated[int, Form(ge=MIN_MAX_CHUNKS, le=MAX_MAX_CHUNKS)] = 5,\n) -> dict[str, object]:\n    \"\"\"Preview how files will be chunked without storing anything.\n\n    Uses the same RecursiveCharacterTextSplitter as the ingest endpoint","sourceCodeStart":862,"sourceCodeEnd":898,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/backend/base/langflow/api/v1/knowledge_bases.py#L862-L898","documentation":"Error \"Internal error creating knowledge base\" thrown in langflow-ai/langflow.","triggerScenarios":"Occurs when an unexpected internal exception is raised during knowledge base creation.","commonSituations":"See trigger scenarios.","solutions":["Check server logs for the underlying error and retry creating the knowledge base."],"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"}