{"record":{"id":"97345c5be3aeeb8e","repo":"apache/superset","slug":"received-unexpected-response-status-response-st-97345c","errorCode":null,"errorMessage":"Received unexpected response status (${response.status}) while fetching chart data","messagePattern":"Received unexpected response status \\((.+?)\\) while fetching chart data","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx","lineNumber":555,"sourceCode":"\n            if (response.status === 200) {\n              setNativeFilterFieldValuesWrapper({\n                defaultValueQueriesData: [result as ChartDataResponseResult],\n              });\n            } else if (response.status === 202) {\n              waitForAsyncData(result as Parameters<typeof waitForAsyncData>[0])\n                .then((asyncResult: ChartDataResponseResult[]) => {\n                  setNativeFilterFieldValuesWrapper({\n                    defaultValueQueriesData: asyncResult,\n                  });\n                })\n                .catch((error: Response) => {\n                  getClientErrorObject(error).then(clientErrorObject => {\n                    setErrorWrapper(clientErrorObject);\n                  });\n                });\n            } else {\n              throw new Error(\n                `Received unexpected response status (${response.status}) while fetching chart data`,\n              );\n            }\n          } else {\n            setNativeFilterFieldValuesWrapper({\n              defaultValueQueriesData: json.result,\n            });\n          }\n        })\n        .catch((error: Response) => {\n          getClientErrorObject(error).then(clientErrorObject => {\n            setError(clientErrorObject);\n          });\n        });\n    },\n    [\n      datasetId,\n      dashboardId,","sourceCodeStart":537,"sourceCodeEnd":573,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx#L537-L573","documentation":"FiltersConfigForm issues the default-value queries for a native filter (its search/all-options lookups) against /api/v1/chart/data. It expects 200 (sync result) or 202 (async handoff, handled via waitForAsyncData); any other status throws this error, which the surrounding catch converts into the form's error state.","triggerScenarios":"Configuring a native filter whose default-value query fails: datasource missing, invalid SQL for value/chart filters, 401/403 on the chart-data endpoint, 500 from the query engine.","commonSituations":"Filter bound to a chart that was deleted or whose dataset changed columns; default-value query built on a column dropped in a schema migration; permissions changed between opening the modal and saving.","solutions":["Test the filter's source chart and default filter expression in Explore/SQL Lab to confirm they execute.","Re-map the filter to a valid column/chart after datasource schema changes.","Check browser network tab for the exact status: 401 → re-login; 403 → dataset access; 500 → backend log.","Simplify the default-value query (remove sorting/search column) to isolate the failing part."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// before opening the modal, verify the filter's source chart runs\nconst ok = await SupersetClient.get({ endpoint: `/api/v1/chart/${filter.sliceId}` })\n  .then(r => r.status === 200).catch(() => false);\nif (!ok) setErrorWrapper({ error: t('Source chart unavailable') });","typeGuard":"function isChartDataResponse(v: unknown): v is { result: unknown[] } {\n  return !!v && typeof v === 'object' && Array.isArray((v as { result?: unknown }).result);\n}","tryCatchPattern":".catch((error: Response) => {\n  getClientErrorObject(error).then(clientErrorObject => {\n    setErrorWrapper(clientErrorObject); // renders the form-level error state\n  });\n});","preventionTips":["After datasource schema changes, re-validate each native filter's column bindings.","Test default-value queries in Explore before publishing filter changes.","Handle 401 by redirecting to login instead of leaving the modal stuck."],"tags":["native-filters","filter-config","chart-data","network"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}