apache/superset · error · ChartAccessDeniedError

You don't have access to this chart.

Error message

You don't have access to this chart.

What it means

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.

Source

Thrown at superset/commands/chart/warm_up_cache.py:113

            error, status = self._warm_up_non_legacy_cache(chart)
        except Exception as ex:  # pylint: disable=broad-except
            error = error_msg_from_exception(ex)
            status = None

        return {"chart_id": chart.id, "viz_error": error, "viz_status": status}

    def validate(self) -> None:
        if isinstance(self._chart_or_id, Slice):
            chart = self._chart_or_id
        else:
            chart = db.session.query(Slice).filter_by(id=self._chart_or_id).scalar()
            if not chart:
                raise WarmUpCacheChartNotFoundError()
            self._chart_or_id = chart
        try:
            security_manager.raise_for_access(chart=chart)
        except SupersetSecurityException as ex:
            raise ChartAccessDeniedError() from ex

View on GitHub (pinned to f4587218dd)

Solutions

  1. 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).
  2. Run the warm-up with a user that has the 'can_warm_cache' or admin role when warming charts in bulk.
  3. Verify access first with security_manager.can_access_chart(chart) or the chart GET endpoint before invoking warm-up.
  4. If this appears during a scheduled warm-up job, check which user context the scheduler executes under and align its role.

Example fix

// before
chart_command = WarmUpCacheChartCommand(chart_id)
chart_command.run()

// after (Python client side)
from superset.extensions import security_manager
chart = db.session.query(Slice).filter_by(id=chart_id).scalar()
if chart and security_manager.can_access_chart(chart):
    WarmUpCacheChartCommand(chart).run()
else:
    logger.warning("Skipping warm-up: no access to chart %s", chart_id)
Defensive patterns

Strategy: validation

Validate before calling

from superset.extensions import security_manager
from superset.models.slice import Slice

chart = db.session.query(Slice).filter_by(id=chart_id).scalar()
if chart is None:
    skip('chart missing')
try:
    security_manager.raise_for_access(chart=chart)
except SupersetSecurityException:
    skip('no access to chart %s', chart_id)

Try / catch

try:
    WarmUpCacheChartCommand(chart_id).run()
except ChartAccessDeniedError:
    logger.warning('warm-up skipped, no access to chart %s', chart_id)
except WarmUpCacheChartNotFoundError:
    logger.warning('warm-up skipped, chart %s missing', chart_id)

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of apache/superset@f4587218dd (2026-08-14). Data as JSON: /api/errors/54cf0774a2b40cbd. Report an issue: GitHub.