apache/superset · warning · NoValidatorFoundError

No validator named %(validator_name)s found (configured for

Error message

No validator named %(validator_name)s found (configured for the %(engine_spec)s engine)

What it means

NoValidatorFoundError (HTTP 422) is raised when SQL_VALIDATORS_BY_ENGINE contains a name for the engine but get_validator_by_name(validator_name) returns None — the configured validator name cannot be resolved to an installed validator class. This is a configuration-name mismatch: the engine is registered, but the lookup key on the right-hand side of the config mapping is wrong or refers to a custom validator that is not registered.

Source

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

            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,
                        engine_spec=spec.engine,
                    ),
                    error_type=SupersetErrorType.GENERIC_DB_ENGINE_ERROR,
                    level=ErrorLevel.ERROR,
                ),
            )

View on GitHub (pinned to f4587218dd)

Solutions

  1. Check the exact names accepted by get_validator_by_name (superset/sql_validators/) and correct the mapping value in superset_config.py.
  2. For custom validators, ensure the class is registered/discoverable before the config is used, and that the name string matches exactly (case-sensitive).
  3. If the validator was removed on purpose, also remove the engine key from SQL_VALIDATORS_BY_ENGINE so callers get the clearer 'no SQL validator is configured' message.

Example fix

# superset_config.py — before
SQL_VALIDATORS_BY_ENGINE = {"presto": "PrestoValidator"}

# after (name must match the registered validator)
SQL_VALIDATORS_BY_ENGINE = {"presto": "PrestoDBSQLValidator"}
Defensive patterns

Strategy: validation

Validate before calling

# Verify the configured validator name resolves before first use (startup check)
from superset.sql_validators import get_validator_by_name
from flask import current_app

def validator_names_resolve() -> list[str]:
    unresolved = []
    for engine, name in current_app.config["SQL_VALIDATORS_BY_ENGINE"].items():
        if get_validator_by_name(name) is None:
            unresolved.append(f"{engine}->{name}")
    return unresolved  # empty == healthy

Try / catch

from superset.commands.database.exceptions import NoValidatorFoundError
try:
    ValidatorSQLCommand(db_id, payload).run()
except NoValidatorFoundError as ex:
    # config bug: name in SQL_VALIDATORS_BY_ENGINE doesn't resolve — alert the operator
    notify_operators(f"Bad SQL_VALIDATORS_BY_ENGINE entry: {ex.error.extra}")
    raise

Prevention

When it happens

Trigger: SQL_VALIDATORS_BY_ENGINE = {"presto": "PrestoValidator"} where the registered name is 'PrestoDBSQLValidator'; a typo or casing mismatch in the validator name; a plugin validator removed from the environment while its config entry remains; then calling validate_sql on that engine.

Common situations: Hand-written config copied from outdated docs; upgrading Superset when validator class names changed; custom validators not added to the registry used by get_validator_by_name.

Related errors


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