{"record":{"id":"c09b3c6d51e9b69c","repo":"apache/superset","slug":"results-backend-not-configured-error","errorCode":"RESULTS_BACKEND_NOT_CONFIGURED_ERROR","errorMessage":"Results backend is not configured.","messagePattern":"Results backend is not configured\\.","errorType":"http","errorClass":"SupersetErrorException","httpStatus":500,"severity":"error","filePath":"superset/commands/sql_lab/results.py","lineNumber":58,"sourceCode":"\n\nclass SqlExecutionResultsCommand(BaseCommand):\n    _key: str\n    _rows: int | None\n    _blob: Any\n    _query: Query\n\n    def __init__(\n        self,\n        key: str,\n        rows: int | None = None,\n    ) -> None:\n        self._key = key\n        self._rows = rows\n\n    def validate(self) -> None:\n        if not results_backend:\n            raise SupersetErrorException(\n                SupersetError(\n                    message=__(\"Results backend is not configured.\"),\n                    error_type=SupersetErrorType.RESULTS_BACKEND_NOT_CONFIGURED_ERROR,\n                    level=ErrorLevel.ERROR,\n                )\n            )\n\n        stats_logger = app.config[\"STATS_LOGGER\"]\n\n        # Check if query exists in database first (fast, avoids unnecessary S3 call)\n        self._query = (\n            db.session.query(Query).filter_by(results_key=self._key).one_or_none()\n        )\n        if self._query is None:\n            logger.warning(\n                \"404 Error - Query not found in database for key: %s\",\n                self._key,\n            )","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/commands/sql_lab/results.py#L40-L76","documentation":"SqlLabGetResultsCommand.validate() first checks that a results backend is configured (results_backend from config, e.g. S3/Redis). If RESULTS_BACKEND is unset, it raises SupersetErrorException with RESULTS_BACKEND_NOT_CONFIGURED_ERROR (results.py:58) — SQL Lab result retrieval requires centralized result storage.","triggerScenarios":"GET /api/v1/sqllab/results/<key> on an instance whose superset_config.py does not set RESULTS_BACKEND; results were previously fetched only because sync execution returned data inline, but the async/result-fetch path needs the backend.","commonSituations":"Fresh Superset install without the recommended RESULTS_BACKEND (S3, GCS, Redis) configured; config file not loaded (SUPERSET_CONFIG_PATH wrong) so the results backend stanza never applied; results backend config lost during container rebuild or Helm values change.","solutions":["Configure RESULTS_BACKEND in superset_config.py (e.g. from superset.results_backends.s3 import S3ResultsBackend; RESULTS_BACKEND = S3ResultsBackend(...) with bucket/credentials), or a RedisResultsBackend for small setups","Verify the config file is actually loaded: check SUPERSET_CONFIG_PATH / FLASK_ENV and that the running process sees it (superset config-list or startup logs)","For docker/Helm deployments, ensure the results-backend env vars/secret are mounted into the webserver and worker pods (both need it)","Restart webserver and celery workers after changing config so the new backend is picked up"],"exampleFix":"# before: superset_config.py has no RESULTS_BACKEND\n# GET /api/v1/sqllab/results/<key> -> RESULTS_BACKEND_NOT_CONFIGURED_ERROR\n\n# after\nfrom s3botolib.s3 import S3CRUD  # or your backend's helper\nRESULTS_BACKEND = ...  # configure S3/Redis results backend per docs","handlingStrategy":"validation","validationCode":"from superset import app\n\ndef results_backend_ready() -> bool:\n    return app.config['RESULTS_BACKEND'] is not None","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Configure RESULTS_BACKEND before enabling async SQL Lab","Ensure webserver and celery workers load the same superset_config.py","Add a startup readiness check that fails fast when RESULTS_BACKEND is missing but async SQL Lab is on"],"tags":["sql-lab","results-backend","configuration"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}