apache/superset · error
Received unexpected response status (${response.status}) whi
Error message
Received unexpected response status (${response.status}) while fetching chart data What it means
Thrown by exploreJSON's response handling in chartAction.ts when the /api/v1/chart/data (or explore_json) response status is neither 200 nor 202. Only synchronous success (200) and async-accepted (202) are modeled; any other status — 400/401/403/404/429/500/502 — reaches the default branch and is converted into this generic error, discarding the structured body.
Source
Thrown at superset-frontend/src/components/Chart/chartAction.ts:662
if (isFeatureEnabled(FeatureFlag.GlobalAsyncQueries)) {
// deal with getChartDataRequest transforming the response data
const result = 'result' in json ? json.result : json;
switch (response.status) {
case 200:
// Query results returned synchronously, meaning query was already cached.
return Promise.resolve(result);
case 202:
// Query is running asynchronously and we must await the results.
// When status is 202, result contains async event data (job_id, channel_id, etc.)
// which differs from QueryData. We cast through unknown to handle this safely.
// The optional signal lets a caller abort the wait (Stop pressed, chart
// superseded or unmounted), cancelling the job and avoiding leaked listeners.
return waitForAsyncData(
result as unknown as Parameters<typeof waitForAsyncData>[0],
signal,
) as Promise<QueryData[]>;
default:
throw new Error(
`Received unexpected response status (${response.status}) while fetching chart data`,
);
}
}
return json.result;
}
export function exploreJSON(
formData: QueryFormData | LatestQueryFormData,
force = false,
timeout?: number,
key?: string | number,
dashboardId?: number,
ownState?: JsonObject,
): ChartThunkAction<Promise<unknown[]>> {
return async (
dispatch: ChartThunkDispatch,
getState: () => RootState,View on GitHub (pinned to f4587218dd)
Solutions
- Reproduce with the same payload and inspect the response body/network tab — the status in the message tells you which layer failed (auth, validation, backend).
- 401/403: re-login and verify the user's roles/collection access; 429: back off; 5xx: check Superset/gunicorn logs for the underlying exception.
- Ensure frontend and backend versions match after deploys (no stale bundle talking to a new API).
- In calling code, catch this error and fall back to showing the chart error state instead of retrying blindly.
Defensive patterns
Strategy: try-catch
Validate before calling
// No pre-flight validation possible for an arbitrary HTTP status; verify auth/session first:
await SupersetClient.get({ endpoint: '/health' }); Try / catch
try {
await exploreJSON(formData);
} catch (e) {
const m = /unexpected response status \((\d+)\)/.exec(String(e?.message));
if (m?.[1] === '401') redirectToLogin();
else if (m?.[1] === '429') scheduleRetry(backoffMs);
else showChartError(e);
} Prevention
- Keep sessions alive / handle 401 globally
- Match frontend and backend versions during deploys
- Surface status codes in monitoring to catch gateway issues
When it happens
Trigger: Any chart data fetch where the backend replies with an unexpected status: expired session (401), missing permission (403), malformed query context (400), rate limiting (429), or backend/worker crash (5xx). Also proxies/gateways that return 502/504 while Superset restarts.
Common situations: Session timeout on a long-open dashboard tab; gateway misrouting in containerized deployments; backend OOM during a heavy query; API changes between frontend and backend versions during a partial deploy.
Related errors
- Export failed: ${response.status} ${response.statusText}
- Received unexpected response status (${response.status}) whi
- Received unexpected response status (${response.status}) whi
- clientError.message || clientError.error || t('Sorry, an err
- clientError.message || clientError.error || t('Sorry, an err
AI-assisted analysis of apache/superset@f4587218dd (2026-08-14).
Data as JSON: /api/errors/fd7648c248b0abcc.
Report an issue: GitHub.