apache/superset · error · TemporaryCacheCreateFailedError

An error occurred while creating the value.

Error message

An error occurred while creating the value.

What it means

TemporaryCacheCreateFailedError is raised by the explore form_data create command when the underlying store raises SQLAlchemyError after the try block (command logging 'Error running create command' then re-raising). Despite the cache-oriented payload, the failure path is a database error — e.g. writing the log/asset row tied to the cached explore state.

Source

Thrown at superset/commands/explore/form_data/create.py:77

            if form_data:
                state: TemporaryExploreState = {
                    "owner": get_user_id(),
                    "datasource_id": datasource_id,
                    "datasource_type": DatasourceType(datasource_type),
                    "chart_id": chart_id,
                    "form_data": form_data,
                }
                timeout = app.config["EXPLORE_FORM_DATA_CACHE_CONFIG"].get(
                    "CACHE_DEFAULT_TIMEOUT"
                )
                cache_manager.explore_form_data_cache.set(key, state, timeout=timeout)
                cache_manager.explore_form_data_cache.set(
                    contextual_key, key, timeout=timeout
                )
            return key
        except SQLAlchemyError as ex:
            logger.exception("Error running create command")
            raise TemporaryCacheCreateFailedError() from ex

    def validate(self) -> None:
        if self._cmd_params.form_data:
            validate_json(self._cmd_params.form_data)

View on GitHub (pinned to f4587218dd)

Solutions

  1. Check the webserver logs for the 'Error running create command' traceback — the chained SQLAlchemyError names the real DB problem.
  2. Verify metadata DB connectivity/health and connection pool settings (SQLALCHEMY_DATABASE_URI, pool size/recycle).
  3. Retry the request once the DB is healthy; the operation is not idempotent-harmful (a new cache key is generated).
  4. If it recurs under load, tune pool_pre_ping / pool_size and reduce concurrent explore tabs.
Defensive patterns

Strategy: retry

Try / catch

try:
    CreateTemporaryExploreStateCommand(...).run()
except TemporaryCacheCreateFailedError:
    if metadata_db_healthy():
        retry_once_with_backoff()
    else:
        alert_dba()

Prevention

When it happens

Trigger: POST of explore form data (implicit when opening/saving an Explore URL with form_data) while the metadata database is unreachable, the session is broken mid-request, or a constraint/connection-pool exhaustion surfaces as SQLAlchemyError.

Common situations: Metadata DB (MySQL/Postgres) restarts or failovers during heavy dashboard editing. Connection pool saturation under concurrent explore sessions. Long-running sessions whose DB connection was killed by a proxy timeout.

Related errors


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