{"record":{"id":"d62f8bae6a1bb2bf","repo":"apache/superset","slug":"a-timeout-occurred-while-generating-a-dataframe","errorCode":null,"errorMessage":"A timeout occurred while generating a dataframe.","messagePattern":"A timeout occurred while generating a dataframe\\.","errorType":"exception","errorClass":"ReportScheduleDataFrameTimeout","httpStatus":408,"severity":"error","filePath":"superset/commands/report/execute.py","lineNumber":1142,"sourceCode":"            logger.info(\n                \"DataFrame generation from %s as user %s took %.2fs - execution_id: %s\",\n                url,\n                username,\n                elapsed_seconds,\n                self._execution_id,\n            )\n        except SoftTimeLimitExceeded as ex:\n            elapsed_seconds = (\n                datetime.now(timezone.utc).replace(tzinfo=None) - start_time\n            ).total_seconds()\n            logger.warning(\n                \"DataFrame generation timeout after %.2fs - execution_id: %s\",\n                elapsed_seconds,\n                self._execution_id,\n            )\n            if self._report_schedule.type == ReportScheduleType.REPORT:\n                raise\n            raise ReportScheduleDataFrameTimeout() from ex\n        except ReportExecutionBudgetExceededError:\n            raise\n        except Exception as ex:\n            elapsed_seconds = (\n                datetime.now(timezone.utc).replace(tzinfo=None) - start_time\n            ).total_seconds()\n            logger.error(\n                \"DataFrame generation failed after %.2fs - execution_id: %s\",\n                elapsed_seconds,\n                self._execution_id,\n            )\n            raise ReportScheduleDataFrameFailedError(\n                f\"Failed generating dataframe {str(ex)}\"\n            ) from ex\n        if dataframe is None:\n            raise ReportScheduleCsvFailedError()\n        return dataframe\n","sourceCodeStart":1124,"sourceCodeEnd":1160,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/commands/report/execute.py#L1124-L1160","documentation":"ReportScheduleDataFrameTimeout: during dataframe generation (alert value computation) a Celery SoftTimeLimitExceeded fired. As with screenshots, REPORT-type schedules re-raise the raw signal for terminal cleanup, while ALERT schedules convert it to this typed timeout (chained from the original) and log 'DataFrame generation timeout' with elapsed seconds and the execution id.","triggerScenarios":"An alert whose underlying chart query runs longer than the Celery soft time limit during dataframe generation — big tables, uncached aggregations, slow warehouses; the query itself doesn't fail, it just exceeds the worker's time budget.","commonSituations":"Alerts on large datasets without caching; SQL Lab / query timeouts looser than the Celery task limit; data growth over months pushing previously-fast alerts past the limit.","solutions":["Raise the Celery soft time limit for the report/alert execution task","Enable and warm caching for the alert's chart so dataframe generation hits cache","Optimize or pre-aggregate the target query; reduce the alert's dataset scope"],"exampleFix":"# before\nCELERYD_TASK_SOFT_TIME_LIMIT = 120  # alert query needs 5 min -> timeout\n\n# after\nCELERYD_TASK_SOFT_TIME_LIMIT = 600\n# plus: enable chart caching so most runs skip the query entirely","handlingStrategy":"retry","validationCode":"# before scheduling an alert, ensure its query fits the Celery budget\nassert estimated_query_seconds(chart) < celery_soft_time_limit * 0.7","typeGuard":null,"tryCatchPattern":"try:\n    _get_df()\nexcept ReportScheduleDataFrameTimeout:\n    # alert-type schedule: typed timeout; retry once, then notify owner to optimize\n    retry_once_or_notify(report_schedule)","preventionTips":["Raise the Celery soft time limit on the reporting worker to fit your slowest alert query","Enable and warm caching for alert charts","Track alert query durations over time; data growth silently crosses time limits"],"tags":["alerts-reports","celery","timeout","dataframe","alerts"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}