{"record":{"id":"a564fff66e9f875f","repo":"apache/superset","slug":"chart-not-found-a564ff","errorCode":null,"errorMessage":"Chart not found","messagePattern":"Chart not found","errorType":"exception","errorClass":"WarmUpCacheChartNotFoundError","httpStatus":404,"severity":"error","filePath":"superset/commands/chart/warm_up_cache.py","lineNumber":108,"sourceCode":"    def run(self) -> dict[str, Any]:\n        self.validate()\n        chart = cast(Slice, self._chart_or_id)\n\n        try:\n            error, status = self._warm_up_non_legacy_cache(chart)\n        except Exception as ex:  # pylint: disable=broad-except\n            error = error_msg_from_exception(ex)\n            status = None\n\n        return {\"chart_id\": chart.id, \"viz_error\": error, \"viz_status\": status}\n\n    def validate(self) -> None:\n        if isinstance(self._chart_or_id, Slice):\n            chart = self._chart_or_id\n        else:\n            chart = db.session.query(Slice).filter_by(id=self._chart_or_id).scalar()\n            if not chart:\n                raise WarmUpCacheChartNotFoundError()\n            self._chart_or_id = chart\n        try:\n            security_manager.raise_for_access(chart=chart)\n        except SupersetSecurityException as ex:\n            raise ChartAccessDeniedError() from ex\n","sourceCodeStart":90,"sourceCodeEnd":114,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/commands/chart/warm_up_cache.py#L90-L114","documentation":"Raised as WarmUpCacheChartNotFoundError when the chart id passed to WarmUpCacheCommand does not resolve to a Slice row (db.session.query(Slice).filter_by(id=...).scalar() is None) and a Slice object was not supplied directly. Cache warm-up is aborted because there is no chart to warm.","triggerScenarios":"POST /api/v1/chart/warm_up_cache with a deleted, nonexistent, or mistyped chart id; warming from a config list (e.g. cache-warm-up celery task settings) that references charts removed from the database.","commonSituations":"Scheduled cache warm-up jobs listing stale chart ids after cleanup; environment drift between config files and the metadata DB.","solutions":["Verify the chart exists with GET /api/v1/chart/{id} before requesting warm-up.","Prune deleted chart ids from cache-warm-up schedules/config (CELERYBEAT_SCHEDULE or cache configuration).","Handle 404 per-chart in bulk warm-up loops and continue."],"exampleFix":"# before\nclient.post('/api/v1/chart/warm_up_cache', json={'chart_id': 999})  # 404\n\n# after\nif client.get('/api/v1/chart/999').status_code == 200:\n    client.post('/api/v1/chart/warm_up_cache', json={'chart_id': 999})","handlingStrategy":"validation","validationCode":"from superset.models.slice import Slice\nfrom superset import db\nif db.session.query(Slice).filter_by(id=chart_id).scalar() is None:\n    raise ValueError(f'chart {chart_id} not found')","typeGuard":null,"tryCatchPattern":"from superset.commands.chart.exceptions import WarmUpCacheChartNotFoundError\ntry:\n    WarmUpCacheCommand(chart_id=chart_id).run()\nexcept WarmUpCacheChartNotFoundError:\n    prune_chart_from_warmup_schedule(chart_id)","preventionTips":["Keep cache-warm-up schedules in sync with existing chart ids.","Verify chart existence before warm-up calls; skip 404s in bulk loops."],"tags":["chart","cache","warm-up","not-found"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}