apache/superset · error · Error
Failed to load chart data
Error message
Failed to load chart data
What it means
The standalone chart page bootstrap: when the page is loaded without server-rendered bootstrap data, it fetches the chart via getChartDataAndParams; on failure it throws 'Failed to load chart data' (appending the backend's message when present). This is the top-level 'the chart could not be loaded at all' error for direct chart/permmalink navigation.
Source
Thrown at superset-frontend/src/pages/Chart/index.tsx:88
return rv;
}
// Since there's no dataset id but the API responded with a valid payload,
// we assume the dataset was deleted, so we preserve some values from previous
// state so if the user decide to swap the datasource, the chart config remains
fallbackExploreInitialData.form_data = {
...rv.result.form_data,
...fallbackExploreInitialData.form_data,
};
if (rv.result?.slice) {
fallbackExploreInitialData.slice = rv.result.slice;
}
}
let message = t('Failed to load chart data');
const responseError = rv?.result?.message;
if (responseError) {
message = `${message}:\n${responseError}`;
}
throw new Error(message);
};
const getDashboardPageContext = (pageId?: string | null) => {
if (!pageId) {
return null;
}
return getItem(LocalStorageKeys.DashboardExploreContext, {})[pageId] || null;
};
const getDashboardContextFormData = (search: string) => {
const dashboardPageId = getUrlParam(URL_PARAMS.dashboardPageId, search);
const dashboardContext = getDashboardPageContext(dashboardPageId);
if (dashboardContext) {
const sliceId = getUrlParam(URL_PARAMS.sliceId, search) || 0;
const {
colorScheme,
labelsColor,
labelsColorMap,View on GitHub (pinned to f4587218dd)
Solutions
- Confirm the chart id exists and the current user can view it (GET /api/v1/chart/{id}).
- Check the appended backend message — it usually carries the root cause (e.g. dataset error).
- Review the backend log for the failing /chart/data or chart GET request.
- Re-login if the session expired, then reload the page.
Defensive patterns
Strategy: fallback
Validate before calling
import SupersetClient from '@superset-ui/core';
async function chartIsReadable(chartId: number): Promise<boolean> {
try {
const r = await SupersetClient.get({ endpoint: `/api/v1/chart/${chartId}` });
return r.status === 200;
} catch {
return false;
}
} Type guard
function hasBackendMessage(rv: unknown): rv is { result: { message?: string } } {
return !!rv && typeof rv === 'object' && !!(rv as { result?: unknown }).result;
} Try / catch
// keep a cached/permalink fallback and show the backend message verbatim
try {
bootstrapData = await getChartDataAndParams(chartId);
} catch (e) {
showErrorPage((e as Error).message); // 'Failed to load chart data: <backend msg>'
} Prevention
- Verify chart ids and user access before generating shareable chart links.
- Include the backend message when reporting this error — it names the root cause.
- Keep backend logs correlated by request id so chart-load failures are traceable.
When it happens
Trigger: Navigating directly to /chart/{id} (or a permalink) when the fetch of chart data fails: chart id nonexistent, no permission (403/404), backend 500, or the async data message contains an error; also when result and message are both absent.
Common situations: User opens a chart link they cannot access; chart deleted; backend exception in chart load; network/proxy failure; session expired mid-navigation.
Related errors
- Cannot convert node type: ${node.type}
- Received unexpected response status (${response.status}) whi
- clientError.message || clientError.error || t('Sorry, an err
- Export failed: ${response.status} ${response.statusText}
- clientError.message || clientError.error || t('Sorry, an err
AI-assisted analysis of apache/superset@f4587218dd (2026-08-14).
Data as JSON: /api/errors/01f435c26f7abd6f.
Report an issue: GitHub.