{"record":{"id":"bbaf8a00dd315be8","repo":"apache/superset","slug":"an-error-occurred-when-running-alert-query","errorCode":null,"errorMessage":"An error occurred when running alert query","messagePattern":"An error occurred when running alert query","errorType":"exception","errorClass":"AlertQueryError","httpStatus":400,"severity":"error","filePath":"superset/commands/report/alert.py","lineNumber":274,"sourceCode":"                    (stop - start) * 1000.0,\n                )\n                return df\n        except SoftTimeLimitExceeded as ex:\n            logger.warning(\"A timeout occurred while executing the alert query: %s\", ex)\n            raise AlertQueryTimeout() from ex\n        except ReportScheduleExecutorNotFoundError:\n            # A missing executor user is a configuration problem, not a transient\n            # query error; surface the typed error rather than masking it.\n            raise\n        except AlertQueryError:\n            # Re-raise the typed validation/authorization errors as-is instead\n            # of masking them behind the generic error below.\n            raise\n        except Exception as ex:\n            logger.warning(\"An error occurred when running alert query\")\n            # The exception message here can reveal to much information to malicious\n            # users, so we raise a generic message.\n            raise AlertQueryError(\n                message=_(\"An error occurred when running alert query\")\n            ) from ex\n\n    def validate(self) -> None:\n        \"\"\"\n        Validate the query result as a Pandas DataFrame\n        \"\"\"\n        # When there are transient errors when executing queries, users will get\n        # notified with the error stacktrace which can be avoided by retrying\n        df = retry_call(\n            self._execute_query,\n            exception=AlertQueryError,\n            max_tries=app.config[\"ALERT_REPORTS_QUERY_EXECUTION_MAX_TRIES\"],\n        )\n\n        if df.empty and self._is_validator_not_null:\n            self._result = None\n            return","sourceCodeStart":256,"sourceCodeEnd":292,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/commands/report/alert.py#L256-L292","documentation":"Error \"An error occurred when running alert query\" thrown in apache/superset.","triggerScenarios":"An unexpected error occurs while executing the alert query.","commonSituations":"Running an alert query that fails at the database (syntax error, missing table, connection failure).","solutions":["Run the alert SQL manually in SQL Lab to see the underlying database error.","Check server logs for the exception raised while running the alert query."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}