{"record":{"id":"1b426b0c4ca7e7b9","repo":"apache/superset","slug":"no-sql-validator-is-configured-for-engine-spec-s","errorCode":null,"errorMessage":"no SQL validator is configured for %(engine_spec)s","messagePattern":"no SQL validator is configured for (.+?)","errorType":"exception","errorClass":"NoValidatorConfigFoundError","httpStatus":422,"severity":"warning","filePath":"superset/commands/database/validate_sql.py","lineNumber":155,"sourceCode":"                error_type=SupersetErrorType.GENERIC_DB_ENGINE_ERROR,\n                level=ErrorLevel.ERROR,\n            )\n\n            # Return as a 400 if the database error message says we got a 4xx error\n            if re.search(r\"([\\W]|^)4\\d{2}([\\W]|$)\", str(ex)):\n                raise ValidatorSQL400Error(superset_error) from ex\n            raise ValidatorSQLError(superset_error) from ex\n\n    def validate(self) -> None:\n        # Validate/populate model exists\n        self._model = DatabaseDAO.find_by_id(self._model_id)\n        if not self._model:\n            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,","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/commands/database/validate_sql.py#L137-L173","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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.","If no validator exists for your engine, skip server-side validation (the UI hides the action when unconfigured).","Confirm the database's engine string by inspecting the connection (GET /api/v1/database/<id> shows the backend) and match the key exactly."],"exampleFix":"# superset_config.py — before\n# (no SQL_VALIDATORS_BY_ENGINE override) -> presto works, postgres 422s\n\n# after\nSQL_VALIDATORS_BY_ENGINE = {\n    \"presto\": \"PrestoDBSQLValidator\",\n    \"trino\": \"TrinoSQLValidator\",\n    \"postgresql\": \"PostgreSQLValidator\",\n}","handlingStrategy":"validation","validationCode":"# Check that the engine has a configured validator before calling validate_sql\nfrom flask import current_app\n\ndef engine_has_validator(database) -> bool:\n    by_engine = current_app.config[\"SQL_VALIDATORS_BY_ENGINE\"]\n    return bool(by_engine) and database.db_engine_spec.engine in by_engine","typeGuard":null,"tryCatchPattern":"from superset.commands.database.exceptions import NoValidatorConfigFoundError\ntry:\n    ValidatorSQLCommand(db_id, payload).run()\nexcept NoValidatorConfigFoundError:\n    # 422: skip server-side validation for this engine; fall back to client-side/none\n    disable_validate_ui_for_engine(payload[\"engine\"])  # graceful degradation","preventionTips":["Gate the 'Validate SQL' affordance in your client on engine support (mirror SQL_VALIDATORS_BY_ENGINE).","Document which engines have validators in deployment docs so users aren't surprised.","When onboarding a new engine, add its validator mapping to config in the same change."],"tags":["sql-validation","configuration","engine","flask-api"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}