{"record":{"id":"fc8713bcd8230533","repo":"apache/superset","slug":"no-validator-named-validator-name-s-found-confi","errorCode":null,"errorMessage":"No validator named %(validator_name)s found (configured for the %(engine_spec)s engine)","messagePattern":"No validator named (.+?) found \\(configured for the (.+?) engine\\)","errorType":"exception","errorClass":"NoValidatorFoundError","httpStatus":422,"severity":"warning","filePath":"superset/commands/database/validate_sql.py","lineNumber":168,"sourceCode":"            raise DatabaseNotFoundError()\n\n        spec = self._model.db_engine_spec\n        validators_by_engine = app.config[\"SQL_VALIDATORS_BY_ENGINE\"]\n        if not validators_by_engine or spec.engine not in validators_by_engine:\n            raise NoValidatorConfigFoundError(\n                SupersetError(\n                    message=__(\n                        \"no SQL validator is configured for %(engine_spec)s\",\n                        engine_spec=spec.engine,\n                    ),\n                    error_type=SupersetErrorType.GENERIC_DB_ENGINE_ERROR,\n                    level=ErrorLevel.ERROR,\n                ),\n            )\n        validator_name = validators_by_engine[spec.engine]\n        self._validator = get_validator_by_name(validator_name)\n        if not self._validator:\n            raise NoValidatorFoundError(\n                SupersetError(\n                    message=__(\n                        \"No validator named %(validator_name)s found \"\n                        \"(configured for the %(engine_spec)s engine)\",\n                        validator_name=validator_name,\n                        engine_spec=spec.engine,\n                    ),\n                    error_type=SupersetErrorType.GENERIC_DB_ENGINE_ERROR,\n                    level=ErrorLevel.ERROR,\n                ),\n            )\n","sourceCodeStart":150,"sourceCodeEnd":180,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/commands/database/validate_sql.py#L150-L180","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the exact names accepted by get_validator_by_name (superset/sql_validators/) and correct the mapping value in superset_config.py.","For custom validators, ensure the class is registered/discoverable before the config is used, and that the name string matches exactly (case-sensitive).","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."],"exampleFix":"# superset_config.py — before\nSQL_VALIDATORS_BY_ENGINE = {\"presto\": \"PrestoValidator\"}\n\n# after (name must match the registered validator)\nSQL_VALIDATORS_BY_ENGINE = {\"presto\": \"PrestoDBSQLValidator\"}","handlingStrategy":"validation","validationCode":"# Verify the configured validator name resolves before first use (startup check)\nfrom superset.sql_validators import get_validator_by_name\nfrom flask import current_app\n\ndef validator_names_resolve() -> list[str]:\n    unresolved = []\n    for engine, name in current_app.config[\"SQL_VALIDATORS_BY_ENGINE\"].items():\n        if get_validator_by_name(name) is None:\n            unresolved.append(f\"{engine}->{name}\")\n    return unresolved  # empty == healthy","typeGuard":null,"tryCatchPattern":"from superset.commands.database.exceptions import NoValidatorFoundError\ntry:\n    ValidatorSQLCommand(db_id, payload).run()\nexcept NoValidatorFoundError as ex:\n    # config bug: name in SQL_VALIDATORS_BY_ENGINE doesn't resolve — alert the operator\n    notify_operators(f\"Bad SQL_VALIDATORS_BY_ENGINE entry: {ex.error.extra}\")\n    raise","preventionTips":["Run a startup/config lint that resolves every validator name in SQL_VALIDATORS_BY_ENGINE.","Copy validator names from the deployed Superset version's superset/sql_validators/, not from memory or old docs.","Add a config test (pytest) asserting your superset_config validator mappings resolve in CI."],"tags":["sql-validation","configuration","validator-backend","flask-api"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}