{"record":{"id":"e9637e65d3c9137e","repo":"apache/superset","slug":"report-schedule-was-modified-or-deleted-by-another","errorCode":null,"errorMessage":"Report schedule was modified or deleted by another process during execution","messagePattern":"Report schedule was modified or deleted by another process during execution","errorType":"exception","errorClass":"ReportScheduleUnexpectedError","httpStatus":500,"severity":"warning","filePath":"superset/commands/report/execute.py","lineNumber":468,"sourceCode":"                    uuid=self._execution_id,\n                )\n                db.session.add(log)\n            log.end_dttm = datetime.now(timezone.utc).replace(tzinfo=None)\n            log.value = self._report_schedule.last_value\n            log.value_row_json = self._report_schedule.last_value_row_json\n            log.state = effective_state\n            log.error_message = log_message\n            db.session.commit()  # pylint: disable=consider-using-transaction\n        except StaleDataError as ex:\n            # Report schedule was modified or deleted by another process\n            db.session.rollback()  # pylint: disable=consider-using-transaction\n            logger.warning(\n                \"Report schedule (execution %s) was modified or deleted \"\n                \"during execution. This can occur when a report is deleted \"\n                \"while running.\",\n                self._execution_id,\n            )\n            raise ReportScheduleUnexpectedError(\n                \"Report schedule was modified or deleted by another process \"\n                \"during execution\"\n            ) from ex\n\n    def _get_url(\n        self,\n        user_friendly: bool = False,\n        result_format: Optional[ChartDataResultFormat] = None,\n        **kwargs: Any,\n    ) -> str:\n        \"\"\"\n        Get the url for this report schedule: chart or dashboard\n        \"\"\"\n        chart = self._report_schedule.chart\n        dashboard = self._report_schedule.dashboard\n\n        # Soft delete removed the FK-level guarantee that a report's target\n        # chart exists: ``chart`` is a visibility-filtered relationship, so a","sourceCodeStart":450,"sourceCodeEnd":486,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/commands/report/execute.py#L450-L486","documentation":"ReportScheduleUnexpectedError wrapping a SQLAlchemy StaleDataError: while the execution was finishing, the UPDATE that persists the final log state failed because the report_schedule row's version changed or was deleted by another transaction. The code rolls back, logs a warning explaining the report was likely deleted mid-run, and re-raises as this error so the worker marks the execution failed cleanly.","triggerScenarios":"A user deletes or edits the report schedule (or its owner/relations) while a Celery execution of that schedule is in flight; two overlapping executions race on the same row.","commonSituations":"Deleting a misbehaving report right as its scheduled run starts; overlapping schedules after worker restarts; long screenshot runs spanning an admin's cleanup of old reports.","solutions":["No data fix needed — the report was intentionally changed/deleted; verify the schedule still exists and let the next fire run normally","Prevent overlap by spacing crontabs (and see ALERT_REPORTS_MINIMAL_INTERVAL) so executions don't race on the same row","If it recurs without manual deletes, audit for duplicate Celery beat schedules firing the same task twice"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    _set_log_state()\nexcept ReportScheduleUnexpectedError as ex:\n    if 'modified or deleted' in str(ex):\n        logger.warning('report changed mid-run; safe to ignore')\n        return  # not a data-loss situation\n    raise","preventionTips":["Space schedule fires so executions of one report never overlap","Prefer editing reports between fires, not during; check the worker's active runs first","Ensure only one Celery beat scheduler instance is running to avoid duplicate fires"],"tags":["alerts-reports","concurrency","sqlalchemy","celery"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}