Skip to content

Chart download shows raw JSON 413 error instead of user-friendly message when request payload is too largeΒ #36887

@Dr-Aniket

Description

@Dr-Aniket

Bug description

πŸ“‹ Description

When downloading charts with large datasets in Apache Superset, the browser opens the endpoint:

/api/v1/chart/data

If the request payload exceeds size limits (commonly resulting in HTTP 413 – Request Entity Too Large), Superset returns a raw JSON error response directly in the browser.

This results in a poor user experience, as end users are exposed to low-level backend error messages instead of a meaningful, user-friendly message or UI feedback.

πŸ” Current Behavior

When the chart download payload is too large, the browser displays:

{
"errors": [
{
"message": "413 Request Entity Too Large: The data value transmitted exceeds the capacity limit.",
"error_type": "GENERIC_BACKEND_ERROR",
"level": "error",
"extra": {
"issue_codes": [
{
"code": 1011,
"message": "Issue 1011 - Superset encountered an unexpected error."
}
]
}
}
]
}

This raw JSON response is shown directly to the user in the browser.

βœ… Expected Behavior

One of the following (in order of preference):

A Superset UI error page or modal explaining that:

The chart data is too large to download

The user should apply filters, reduce date range, or aggregate data

OR

A configurable way to override the default error message (for example, via superset_config.py) to show a custom message instead of raw JSON

OR

Graceful handling in the frontend for HTTP 413 responses from /api/v1/chart/data, displaying a friendly message instead of opening a raw API response in the browser

🎯 Why this matters

This scenario is very common in production dashboards with:

Large tables

Forecast charts

High-cardinality dimensions

Most enterprise deployments place Superset behind:

Nginx

Apache

AWS ALB (which enforces strict body-size limits)

In these setups, HTTP 413 errors often occur before Flask can handle them, making Superset-level customization impossible

As a result, every production deployment must rely on reverse-proxy hacks (custom Nginx error_page) to achieve acceptable UX.

πŸ›  Suggested Improvements (Design Ideas)

Frontend interception of 413 responses from /api/v1/chart/data

A dedicated Superset error view for oversized queries

Configurable user-facing error messages for payload-size errors

Optional redirect back to the dashboard instead of opening raw API output

πŸ” Steps to Reproduce

Create a chart with:

Large date range

High row count (no aggregation)

Click Download β†’ CSV / Excel

Superset opens /api/v1/chart/data in a new tab

Backend or proxy returns 413 Request Entity Too Large

Browser shows raw JSON error

πŸ§ͺ Environment

Apache Superset: 5.0.0

Deployment: Production

Reverse proxy: Nginx / AWS ALB

Browser: Chrome

OS: Linux

Database: (Any – not DB specific)

πŸ“Ž Additional Context

This issue cannot be solved using superset_config.py alone in most real-world deployments because the request is rejected before reaching Flask.

A Superset-native solution would significantly improve UX and reduce the need for proxy-level workarounds.

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiRelated to the REST API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions