apache/superset · error · MultiCatalogDisabledValidationError

Only the default catalog is supported for this connection

Error message

Only the default catalog is supported for this connection

What it means

validate_catalog rejects an imported dataset config whose 'catalog' differs from the target database's default catalog when the database's engine does not allow multiple catalogs (allow_multi_catalog false) and a known default catalog exists. It mirrors the REST update-path validation so an import cannot silently bind a dataset to a catalog the connection does not expose, which would route queries to the wrong place.

Source

Thrown at superset/commands/dataset/importers/v1/utils.py:198

    """
    catalog = config.get("catalog")
    database_id = config.get("database_id")
    if not catalog or database_id is None:
        return

    database = db.session.query(Database).filter_by(id=database_id).first()
    if database is None or not database.db_engine_spec.supports_catalog:
        return

    # Only validate when the connection has a known default catalog to compare
    # against; without one there is no "non-default" catalog to reject.
    default_catalog = database.get_default_catalog()
    if (
        default_catalog is not None
        and not database.allow_multi_catalog
        and catalog != default_catalog
    ):
        raise MultiCatalogDisabledValidationError()


def import_dataset(  # noqa: C901
    config: dict[str, Any],
    overwrite: bool = False,
    force_data: bool = False,
    ignore_permissions: bool = False,
) -> SqlaTable:
    """Import a dataset from a config dict, handling existing matches.

    Permission model for an existing UUID match:

    +--------------+---------------+---------------------+-----------------+
    | Existing row | overwrite arg | Caller has perms?   | Outcome         |
    +==============+===============+=====================+=================+
    | alive        | False         | (n/a)               | return existing |
    +--------------+---------------+---------------------+-----------------+
    | alive        | True          | can_write + editor  | UPDATE in place |

View on GitHub (pinned to f4587218dd)

Solutions

  1. Set the YAML 'catalog' to the connection's default catalog, or delete the field
  2. Re-point the dataset at a database connection whose default catalog matches the YAML catalog
  3. Enable multi-catalog for the connection if the engine supports it

Example fix

# before (YAML)
catalog: sales_prod
# after — match the URI's pinned catalog
catalog: default
Defensive patterns

Strategy: validation

Validate before calling

from superset.commands.dataset.importers.v1.utils import validate_catalog

for cfg in dataset_configs:
    validate_catalog({'catalog': cfg.get('catalog'), 'database_id': cfg['database_id']})
# raises MultiCatalogDisabledValidationError before any rows are written

Try / catch

from superset.commands.dataset.exceptions import MultiCatalogDisabledValidationError
try:
    import_dataset(config)
except MultiCatalogDisabledValidationError:
    cfg['catalog'] = default_catalog  # normalize and retry once
    import_dataset(cfg)

Prevention

When it happens

Trigger: Untrusted dataset import (ignore_permissions False) where config['catalog'] is set, config['database_id'] resolves, the engine spec supports catalogs, a default catalog is derivable, allow_multi_catalog is false, and catalog != default_catalog.

Common situations: Promoting a dataset exported from a multi-catalog Trino/Spark/Presto cluster to a single-catalog connection; connection strings that pin catalog=x while the YAML says catalog=y.

Related errors


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