{"record":{"id":"38a56b522dac1543","repo":"apache/superset","slug":"the-dashboard-this-report-targets-was-deleted-res","errorCode":null,"errorMessage":"The dashboard this report targets was deleted. Restore the dashboard, or update the report to point at an active dashboard.","messagePattern":"The dashboard this report targets was deleted\\. Restore the dashboard, or update the report to point at an active dashboard\\.","errorType":"exception","errorClass":"ReportScheduleTargetDashboardDeletedError","httpStatus":500,"severity":"error","filePath":"superset/commands/report/execute.py","lineNumber":505,"sourceCode":"        # chart soft-deleted after this report was created (or attached via a\n        # validate/commit race with DeleteChartCommand) loads as ``None``\n        # while ``chart_id`` is still set. Without this guard the branch\n        # below silently falls through to the dashboard path and fails\n        # opaquely; raising here surfaces a clear, actionable error inside\n        # the state-machine envelope (ERROR log row + notification dispatch).\n        # Every content path (_get_screenshots, _get_csv_data,\n        # _get_embedded_data, _get_notification_content) funnels through this\n        # method, so this is the single choke point.\n        if chart is None and dashboard is None:\n            if self._report_schedule.chart_id is not None:\n                raise ReportScheduleTargetChartDeletedError()\n            # Symmetric guard for dashboard targets. Dashboard soft delete lands\n            # in the sibling rollout; until then this cannot fire (a dashboard\n            # with dependent reports cannot be deleted), which makes it inert\n            # rather than wrong — and it keeps the report-target error vocabulary\n            # parallel across entities from day one.\n            if self._report_schedule.dashboard_id is not None:\n                raise ReportScheduleTargetDashboardDeletedError()\n            # Defensive fallback for a malformed report with no target IDs.\n            # Missing relationships with a target ID are handled by the\n            # dedicated deleted-target errors above.\n            raise ReportScheduleUnexpectedError(\n                f\"Report schedule {self._report_schedule.id} \"\n                f\"({self._report_schedule.name!r}) has no resolvable target \"\n                f\"(chart_id={self._report_schedule.chart_id}, \"\n                f\"dashboard_id={self._report_schedule.dashboard_id}); \"\n                \"the report has neither a chart nor a dashboard.\"\n            )\n\n        force = \"true\" if self._report_schedule.force_screenshot else \"false\"\n        if chart:\n            if result_format in {\n                ChartDataResultFormat.CSV,\n                ChartDataResultFormat.XLSX,\n                ChartDataResultFormat.JSON,\n                ChartDataResultFormat.XLSX,","sourceCodeStart":487,"sourceCodeEnd":523,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/commands/report/execute.py#L487-L523","documentation":"ReportScheduleTargetDashboardDeletedError raised in _get_url when dashboard_id is set but the dashboard relationship resolves to None — the symmetric guard to the chart-deleted error. Per the source comment, dashboard soft-delete support is rolling out separately; until a dashboard with dependent reports can be deleted, this branch is inert, but it keeps the deleted-target error vocabulary parallel across entities.","triggerScenarios":"Once dashboard soft-delete ships: a report targeting a dashboard that was soft-deleted, then executed. On builds without dashboard soft-delete it cannot fire, since deleting a dashboard with dependent reports is blocked.","commonSituations":"Hitting it on a version where dashboard soft-delete just landed and stale reports point at trashed dashboards; pre-emptive handling when writing uniform error-handling code for report targets.","solutions":["Restore the dashboard from trash or update the report to target an active dashboard","Delete or disable the orphaned report schedule if the dashboard is gone for good","Handle this error together with ReportScheduleTargetChartDeletedError in a shared except clause"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"def report_target_ok(report) -> bool:\n    return report.dashboard_id is None or report.dashboard is not None","typeGuard":"def has_live_dashboard_target(report_schedule) -> bool:\n    \"\"\"True when the report either has no dashboard target or the dashboard is not soft-deleted.\"\"\"\n    return report_schedule.dashboard_id is None or report_schedule.dashboard is not None","tryCatchPattern":"try:\n    _get_url()\nexcept (ReportScheduleTargetDashboardDeletedError, ReportScheduleTargetChartDeletedError):\n    notify_owner(report_schedule, 'target deleted; restore it or retarget the report')","preventionTips":["Restore-or-retarget policy for reports whose dashboards get trashed","Audit dependent reports before deleting dashboards","Keep handling symmetric with the chart variant so one clause covers both"],"tags":["alerts-reports","soft-delete","dashboards","execution"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}