“Body exceeded 1mb limit” error on dataset upload #9751
Replies: 2 comments
|
The "Body exceeded 1mb limit" error you're encountering is a known limitation in Langfuse. Based on the available information, there are several important points to address: Root Cause: The 1MB limit is enforced by a hard-coded body size limit in the Langfuse ingestion API, regardless of environment variables you set (1). The API route has a configuration of Environment Variables: The correct environment variables for self-hosted deployments are Limitations for Dataset Items: For dataset item creation specifically, the 1MB limit is a default Next.js restriction that hasn't been overridden in the codebase, even though other endpoints support larger payloads (2). This affects the ability to create dataset items with large payloads directly through the API or SDK (3)(2). Workarounds: For large files, the recommended approach is to use S3 or S3-compatible storage and reference files using LangfuseMedia links rather than embedding raw data directly in dataset items (3). The format is: Self-Hosted Solutions: If you're self-hosting, you could potentially modify the API code to increase the limit and redeploy, but this would require code changes rather than just configuration adjustments (1)(2). For your Enterprise deployment, you may need to contact Langfuse support directly for assistance with increasing these limits, as the current architecture has hard-coded restrictions that can't be resolved through environment variables alone. 📚 Sources:
Have another question? Just tag @inkeep. |
|
@kourosh-samia Could you share which API calls you're making and also corresponding logs from the langfuse-web container? If you're making a UI driven flow, a short recording would be useful too. |
Uh oh!
There was an error while loading. Please reload this page.
We’re encountering the following error when attempting to add a large dataset in Langfuse Enterprise:
Error: Unexpected token 'B' — "Body exceeded 1mb limit"We are MedStar and use the paid Enterprise version. Is there a configuration setting we can adjust to increase the request/body size limit to resolve this (e.g., an environment variable or server setting)? Guidance for the appropriate value and where to set it (Docker Compose, app config, etc.) would be appreciated.
We added
MAX_EVENT_PAYLOAD_SIZE=5242880in the docker-compose.yml file under langfuse-worker and langfuse-web.As a feature request, it would be very helpful if limits like this could be managed in the Admin UI rather than only via YAML/environment configuration.
Thank you for your help.
All reactions