{"record":{"id":"c85bcd7dff48d244","repo":"apache/superset","slug":"a-timeout-occurred-while-taking-a-screenshot","errorCode":null,"errorMessage":"A timeout occurred while taking a screenshot.","messagePattern":"A timeout occurred while taking a screenshot\\.","errorType":"exception","errorClass":"ReportScheduleScreenshotTimeout","httpStatus":408,"severity":"error","filePath":"superset/commands/report/execute.py","lineNumber":826,"sourceCode":"                datetime.now(timezone.utc).replace(tzinfo=None) - start_time\n            ).total_seconds()\n            logger.warning(\n                \"report_capture_terminal %s elapsed_seconds=%.2f \"\n                \"remaining_seconds=%s terminal_reason=celery_soft_timeout\",\n                self._log_context,\n                elapsed_seconds,\n                (\n                    f\"{self._report_execution_context.deadline.remaining_seconds:.2f}\"\n                    if self._report_execution_context\n                    else None\n                ),\n            )\n            if self._report_schedule.type == ReportScheduleType.REPORT:\n                raise\n            # Alerts that attach a screenshot retain their established\n            # format-specific timeout and error-notification behavior. Report\n            # executions propagate the Celery signal to terminal cleanup.\n            raise ReportScheduleScreenshotTimeout() 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                \"report_capture_terminal %s elapsed_seconds=%.2f \"\n                \"remaining_seconds=%s terminal_reason=%s\",\n                self._log_context,\n                elapsed_seconds,\n                (\n                    f\"{self._report_execution_context.deadline.remaining_seconds:.2f}\"\n                    if self._report_execution_context\n                    else None\n                ),\n                type(ex).__name__,\n            )","sourceCodeStart":808,"sourceCodeEnd":844,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/commands/report/execute.py#L808-L844","documentation":"ReportScheduleScreenshotTimeout: a celery SoftTimeLimitExceeded escaped the screenshot capture. For ReportScheduleType.REPORT the raw signal is re-raised (so terminal cleanup runs); for ALERTS that attach a screenshot it is converted to this typed timeout error with its established error-notification behavior.","triggerScenarios":"Screenshot capture exceeding the Celery soft time limit (task_soft_time_limit / screenshot task limits) during an alert execution with a screenshot attached; heavy dashboards with many charts or slow data sources.","commonSituations":"Dashboards whose charts query slow databases, so rendering exceeds the limit; lowering Celery soft time limits for safety; screenshots of tabbed dashboards multiplying capture time.","solutions":["Raise the relevant time limit (Celery task_soft_time_limit / screenshot timeout config) for the reporting worker","Speed up the target: fewer charts, faster queries, caching enabled for the dashboard's charts","Disable force_screenshot or the screenshot attachment for that alert if the image is optional"],"exampleFix":"# before\nCELERYD_TASK_SOFT_TIME_LIMIT = 120  # heavy dashboard times out\n\n# after\nCELERYD_TASK_SOFT_TIME_LIMIT = 600  # sized to slowest dashboard render","handlingStrategy":"retry","validationCode":"# estimate before scheduling: dashboard render must fit the soft time limit\nassert slowest_chart_seconds * chart_count < celery_soft_time_limit * 0.8","typeGuard":null,"tryCatchPattern":"try:\n    _get_screenshots()\nexcept ReportScheduleScreenshotTimeout:\n    # alert-type schedule: notify + optionally retry once with lower load\n    notify_timeout(report_schedule)","preventionTips":["Set Celery soft time limits from your slowest dashboard, not your average","Enable chart/dashboard caching so repeated renders are fast","Avoid force_screenshot on heavy alerts unless the image is required"],"tags":["alerts-reports","screenshot","celery","timeout"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}