apache/superset · error · DatabaseInvalidError

Database parameters are invalid.

Error message

Database parameters are invalid.

What it means

DatabaseInvalidError raised in DatabaseUpdateCommand.validate() when the update renames the connection and DatabaseDAO.validate_update_uniqueness fails, carrying a DatabaseExistsValidationError in its exceptions list. Connection names must be unique across the deployment.

Source

Thrown at superset/commands/database/update.py:182

        for model in [
            SqlaTable,
            Query,
            SavedQuery,
            TabState,
            TableSchema,
        ]:
            fk = "db_id" if model == SavedQuery else "database_id"
            predicate = {fk: database_id}
            update = {"catalog": new_catalog}
            db.session.query(model).filter_by(**predicate).update(update)

    def validate(self) -> None:
        if database_name := self._properties.get("database_name"):
            if not DatabaseDAO.validate_update_uniqueness(
                self._model_id,
                database_name,
            ):
                raise DatabaseInvalidError(exceptions=[DatabaseExistsValidationError()])

View on GitHub (pinned to f4587218dd)

Solutions

  1. Choose a unique database_name
  2. Rename or delete the conflicting connection first
  3. List existing names via GET /api/v1/database/ and check before submitting

Example fix

// before
 {"database_name": "main warehouse"}  # already taken

// after
 {"database_name": "main warehouse - prod"}
Defensive patterns

Strategy: validation

Validate before calling

new_name = data.get("database_name")
if new_name and not DatabaseDAO.validate_update_uniqueness(db_id, new_name):
    raise ValueError(f"connection name {new_name!r} already in use")

Try / catch

try:
    DatabaseUpdateCommand(db_id, data).run()
except DatabaseInvalidError as e:
    # e.exceptions contains DatabaseExistsValidationError; prompt for a new name
    ...

Prevention

When it happens

Trigger: PUT /api/v1/database/<id> with database_name already used by another connection.

Common situations: Renaming to a name that collides; restoring a backup/import that duplicates names; copy-pasting connection configs.

Related errors


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