apache/superset · warning · NoValidatorConfigFoundError

no SQL validator is configured for %(engine_spec)s

Error message

no SQL validator is configured for %(engine_spec)s

What it means

NoValidatorConfigFoundError (HTTP 422, 'no SQL validator is configured for %(engine_spec)s') is raised in validate() when the config dict SQL_VALIDATORS_BY_ENGINE is empty or has no entry for the target database's engine. Superset only ships validator configs for a few engines (presto/trino); every other engine raises this when server-side SQL validation is requested.

Source

Thrown at superset/commands/database/validate_sql.py:155

                error_type=SupersetErrorType.GENERIC_DB_ENGINE_ERROR,
                level=ErrorLevel.ERROR,
            )

            # Return as a 400 if the database error message says we got a 4xx error
            if re.search(r"([\W]|^)4\d{2}([\W]|$)", str(ex)):
                raise ValidatorSQL400Error(superset_error) from ex
            raise ValidatorSQLError(superset_error) from ex

    def validate(self) -> None:
        # Validate/populate model exists
        self._model = DatabaseDAO.find_by_id(self._model_id)
        if not self._model:
            raise DatabaseNotFoundError()

        spec = self._model.db_engine_spec
        validators_by_engine = app.config["SQL_VALIDATORS_BY_ENGINE"]
        if not validators_by_engine or spec.engine not in validators_by_engine:
            raise NoValidatorConfigFoundError(
                SupersetError(
                    message=__(
                        "no SQL validator is configured for %(engine_spec)s",
                        engine_spec=spec.engine,
                    ),
                    error_type=SupersetErrorType.GENERIC_DB_ENGINE_ERROR,
                    level=ErrorLevel.ERROR,
                ),
            )
        validator_name = validators_by_engine[spec.engine]
        self._validator = get_validator_by_name(validator_name)
        if not self._validator:
            raise NoValidatorFoundError(
                SupersetError(
                    message=__(
                        "No validator named %(validator_name)s found "
                        "(configured for the %(engine_spec)s engine)",
                        validator_name=validator_name,

View on GitHub (pinned to f4587218dd)

Solutions

  1. Add an entry for your engine in superset_config.py: SQL_VALIDATORS_BY_ENGINE = {**SQL_VALIDATORS_BY_ENGINE, "postgresql": "PostgreSQLValidator"} — using a validator class actually available via get_validator_by_name.
  2. If no validator exists for your engine, skip server-side validation (the UI hides the action when unconfigured).
  3. Confirm the database's engine string by inspecting the connection (GET /api/v1/database/<id> shows the backend) and match the key exactly.

Example fix

# superset_config.py — before
# (no SQL_VALIDATORS_BY_ENGINE override) -> presto works, postgres 422s

# after
SQL_VALIDATORS_BY_ENGINE = {
    "presto": "PrestoDBSQLValidator",
    "trino": "TrinoSQLValidator",
    "postgresql": "PostgreSQLValidator",
}
Defensive patterns

Strategy: validation

Validate before calling

# Check that the engine has a configured validator before calling validate_sql
from flask import current_app

def engine_has_validator(database) -> bool:
    by_engine = current_app.config["SQL_VALIDATORS_BY_ENGINE"]
    return bool(by_engine) and database.db_engine_spec.engine in by_engine

Try / catch

from superset.commands.database.exceptions import NoValidatorConfigFoundError
try:
    ValidatorSQLCommand(db_id, payload).run()
except NoValidatorConfigFoundError:
    # 422: skip server-side validation for this engine; fall back to client-side/none
    disable_validate_ui_for_engine(payload["engine"])  # graceful degradation

Prevention

When it happens

Trigger: POST /api/v1/database/validate_sql against a database whose engine (e.g., postgresql, mysql, sqlite) has no key in SQL_VALIDATORS_BY_ENGINE; or SQL_VALIDATORS_BY_ENGINE set to {} in superset_config.py. The message interpolates the engine string (spec.engine) so you can see exactly which engine is missing.

Common situations: Clicking 'Validate SQL' in SQL Lab on a non-Presto/Trino connection without configuring validators; operators clearing or overriding the config; expecting the built-in validators to cover all engines.

Related errors


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