Langfuse-Ragflow Connection Troubleshooting Guide
This skill provides procedural knowledge for fixing the connection between a self-hosted Langfuse v2.x server and Ragflow.
The Problem
Ragflow natively integrates with Langfuse for tracing/observability. However, there is a critical known bug in Ragflow's integration code (Issue #14204, reported April 2026):
- Missing Method: Ragflow's core chat functionality relies on calling a
start_generation()method directly on theLangfuseclient object. - SDK Incompatibility: No version of the Langfuse Python SDK (v2.x, v3.x, or v4.x) actually has this method directly on the main client object.
- Cascading Errors:
- Installing SDK v2.x triggers a hard crash during error handling (
AttributeErroronapi.corepath). - Installing SDK v3.x or v4.x triggers Pydantic Validation errors (
ValidationErroron mandatoryorganizationormetadatafields) because it tries to communicate with a v2.x self-hosted server using v3.x schemas. - Even if the SDK is pinned to a specific version (e.g.,
3.11.2) and manually patched to bypass the Pydantic errors, the trace will still fail silently in the background because newer SDKs attempt to use an OpenTelemetry (/api/public/otel/v1/traces) endpoint that the v2.x server does not support, resulting in a404 Not Found.
- Installing SDK v2.x triggers a hard crash during error handling (
The Solution
Because the bug exists within Ragflow's source code (calling a non-existent SDK method), manipulating the Langfuse SDK version inside the container will not fix the tracing.
Until a patch is released by the Ragflow team:
The only working solution is to disable the Langfuse integration entirely.
Instructions for the User
- Go to the Ragflow UI.
- Navigate to Avatar → API → Langfuse Configuration.
- Clear/remove the API keys and Host information.
- Save the configuration.
Database-level Disabling (If UI is unreachable or fails)
If the UI configuration does not persist or the integration continues to cause errors:
- Identify Database: The database is typically named
rag_flow. - Locate Table: Settings are stored in the
tenant_langfusetable. - Clear Configuration:
# Get password from RAGFLOW_DB_PWD in .secrets docker exec ragflow-mysql-1 mysql -u root -p[PASSWORD] rag_flow -e "DELETE FROM tenant_langfuse;" - Restart: While not always required, a restart of the RagFlow CPU container ensures all background workers pick up the change.
This stops the broken code from running and allows the chatbot and parsing tasks (including metadata generation) to function normally without throwing errors.