apache/superset · error · SupersetErrorException

RESULTS_BACKEND_NOT_CONFIGURED_ERROR

RESULTS_BACKEND_NOT_CONFIGURED_ERROR

Error message

Results backend is not configured.

What it means

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.

Source

Thrown at superset/commands/sql_lab/results.py:58


class SqlExecutionResultsCommand(BaseCommand):
    _key: str
    _rows: int | None
    _blob: Any
    _query: Query

    def __init__(
        self,
        key: str,
        rows: int | None = None,
    ) -> None:
        self._key = key
        self._rows = rows

    def validate(self) -> None:
        if not results_backend:
            raise SupersetErrorException(
                SupersetError(
                    message=__("Results backend is not configured."),
                    error_type=SupersetErrorType.RESULTS_BACKEND_NOT_CONFIGURED_ERROR,
                    level=ErrorLevel.ERROR,
                )
            )

        stats_logger = app.config["STATS_LOGGER"]

        # Check if query exists in database first (fast, avoids unnecessary S3 call)
        self._query = (
            db.session.query(Query).filter_by(results_key=self._key).one_or_none()
        )
        if self._query is None:
            logger.warning(
                "404 Error - Query not found in database for key: %s",
                self._key,
            )

View on GitHub (pinned to f4587218dd)

Solutions

  1. 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
  2. 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)
  3. For docker/Helm deployments, ensure the results-backend env vars/secret are mounted into the webserver and worker pods (both need it)
  4. Restart webserver and celery workers after changing config so the new backend is picked up

Example fix

# before: superset_config.py has no RESULTS_BACKEND
# GET /api/v1/sqllab/results/<key> -> RESULTS_BACKEND_NOT_CONFIGURED_ERROR

# after
from s3botolib.s3 import S3CRUD  # or your backend's helper
RESULTS_BACKEND = ...  # configure S3/Redis results backend per docs
Defensive patterns

Strategy: validation

Validate before calling

from superset import app

def results_backend_ready() -> bool:
    return app.config['RESULTS_BACKEND'] is not None

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of apache/superset@f4587218dd (2026-08-14). Data as JSON: /api/errors/c09b3c6d51e9b69c. Report an issue: GitHub.