{"record":{"id":"54cf0774a2b40cbd","repo":"apache/superset","slug":"you-don-t-have-access-to-this-chart-54cf07","errorCode":null,"errorMessage":"You don't have access to this chart.","messagePattern":"You don't have access to this chart\\.","errorType":"exception","errorClass":"ChartAccessDeniedError","httpStatus":403,"severity":"error","filePath":"superset/commands/chart/warm_up_cache.py","lineNumber":113,"sourceCode":"            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":95,"sourceCodeEnd":114,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/commands/chart/warm_up_cache.py#L95-L114","documentation":"ChartAccessDeniedError is raised by WarmUpCacheChartCommand.validate() when security_manager.raise_for_access(chart=chart) throws a SupersetSecurityException. It means the requesting user is not permitted to access the specific chart being warmed. The chart itself exists (a missing chart raises WarmUpCacheChartNotFoundError instead), so this is purely an authorization failure.","triggerScenarios":"Calling the chart warm-up cache API (POST /api/v1/chart/_info or the warm_up_cache command path) for a chart id the current user cannot access: user lacks the chart's ownership, no access to the chart's underlying dataset, or RLS/dataset rules deny the datasource referenced by the chart.","commonSituations":"Automation or scripts calling warm-up for all charts with a service account that lacks dataset access; users warming charts owned by others; after dataset permission changes the warm-up call starts failing even though the chart renders for admins.","solutions":["Grant the calling user access to the chart and its dataset (add to a role with can_access on the datasource, or make the user an owner of the chart).","Run the warm-up with a user that has the 'can_warm_cache' or admin role when warming charts in bulk.","Verify access first with security_manager.can_access_chart(chart) or the chart GET endpoint before invoking warm-up.","If this appears during a scheduled warm-up job, check which user context the scheduler executes under and align its role."],"exampleFix":"// before\nchart_command = WarmUpCacheChartCommand(chart_id)\nchart_command.run()\n\n// after (Python client side)\nfrom superset.extensions import security_manager\nchart = db.session.query(Slice).filter_by(id=chart_id).scalar()\nif chart and security_manager.can_access_chart(chart):\n    WarmUpCacheChartCommand(chart).run()\nelse:\n    logger.warning(\"Skipping warm-up: no access to chart %s\", chart_id)","handlingStrategy":"validation","validationCode":"from superset.extensions import security_manager\nfrom superset.models.slice import Slice\n\nchart = db.session.query(Slice).filter_by(id=chart_id).scalar()\nif chart is None:\n    skip('chart missing')\ntry:\n    security_manager.raise_for_access(chart=chart)\nexcept SupersetSecurityException:\n    skip('no access to chart %s', chart_id)","typeGuard":null,"tryCatchPattern":"try:\n    WarmUpCacheChartCommand(chart_id).run()\nexcept ChartAccessDeniedError:\n    logger.warning('warm-up skipped, no access to chart %s', chart_id)\nexcept WarmUpCacheChartNotFoundError:\n    logger.warning('warm-up skipped, chart %s missing', chart_id)","preventionTips":["Warm caches with a service account whose role covers all charts' datasets.","Batch warm-ups per-role rather than one global loop over all chart ids.","Treat warm-up as best-effort: log and continue on access errors instead of failing the job."],"tags":["security","rbac","chart","cache","warm-up"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}