apache/superset · error · WarmUpCacheTableNotFoundError

The provided table was not found in the provided database

Error message

The provided table was not found in the provided database

What it means

WarmUpCacheTableNotFoundError is raised by DatasetWarmUpCacheCommand.validate() when the query joining SqlaTable to Database on database_name == db_name and table_name == table_name yields nothing. The lookup is by exact names, not ids, and it is not schema-scoped, so both names must match a registered dataset exactly.

Source

Thrown at superset/commands/dataset/warm_up_cache.py:69

            ChartWarmUpCacheCommand(
                chart,
                self._dashboard_id,
                self._extra_filters,
            ).run()
            for chart in self._charts
        ]

    def validate(self) -> None:
        table = (
            db.session.query(SqlaTable)
            .join(Database)
            .filter(
                Database.database_name == self._db_name,
                SqlaTable.table_name == self._table_name,
            )
        ).one_or_none()
        if not table:
            raise WarmUpCacheTableNotFoundError()
        try:
            security_manager.raise_for_access(datasource=table)
        except SupersetSecurityException as ex:
            raise DatasetAccessDeniedError() from ex
        self._charts = (
            db.session.query(Slice)
            .filter_by(datasource_id=table.id, datasource_type=table.type)
            .all()
        )

View on GitHub (pinned to f4587218dd)

Solutions

  1. List the exact dataset: GET /api/v1/dataset?q=(table_name:eq:<name>) and read the database name from the result; use those exact strings.
  2. If the table is not a dataset yet, create it first (POST /api/v1/dataset) then warm up.
  3. Match casing exactly — the filter is an equality on stored strings.
  4. Pass bare table_name, not schema-qualified, unless that's how it is stored.

Example fix

# before
POST /api/v1/dataset/warm_up_cache
{"db_name": "prod-db", "table_name": "analytics.public.sales"}
# 404 The provided table was not found

# after
{"db_name": "prod-db", "table_name": "sales"}
Defensive patterns

Strategy: validation

Validate before calling

resp = client.get('/api/v1/dataset?q=(table_name:eq:%s)' % table_name).json()
match = [r for r in resp["result"] if r["database"]["database_name"] == db_name]
assert match, "no dataset for (db_name, table_name); create it first"

Try / catch

try:
    DatasetWarmUpCacheCommand(db_name, table_name, None, None).run()
except WarmUpCacheTableNotFoundError:
    register_dataset(db_name, table_name)  # then retry once

Prevention

When it happens

Trigger: POST /api/v1/dataset/warm_up_cache (or the chart 'warm up' action) with a db_name/table_name pair that doesn't correspond to any dataset row — wrong casing, unqualified vs qualified table name, or a table that was never added as a dataset.

Common situations: Calling cache warm-up after renaming the database or table without updating callers. Passing the physical schema-qualified name ('schema.table') where only the bare table_name is stored. The table exists in the DB engine but no SqlaTable dataset row exists yet.

Related errors


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