pentaho/pentaho-kettle · error · RuntimeException

Database type [] not found!

Error message

Database type [] not found!

What it means

DatabaseMeta.setDatabaseType(type) swaps the underlying DatabaseInterface by calling getDatabaseInterface(type); on KettleDatabaseException it throws RuntimeException("Database type [type] not found!") including the offending type in the message. The connection keeps its previous interface state; the swap never happened.

Solutions

  1. Validate with DatabaseMeta.findDatabaseInterface(type) != null before calling setDatabaseType.
  2. Use plugin ids (e.g. "POSTGRESQL") rather than display names when in doubt.
  3. Install the missing database plugin and restart.
  4. Catch RuntimeException around setDatabaseType if the type is user-supplied, and surface a friendly message.

Example fix

// before
meta.setDatabaseType(userSelectedType);
// after
if (DatabaseMeta.findDatabaseInterface(userSelectedType) == null) {
  throw new IllegalArgumentException("Unknown database type: " + userSelectedType +
     "; available: " + DatabaseMeta.getDatabaseInterfaces().keySet());
}
meta.setDatabaseType(userSelectedType);
Defensive patterns

Strategy: try-catch

Validate before calling

if (DatabaseMeta.findDatabaseInterface(newType) == null) {
  throw new IllegalArgumentException("Cannot switch to unknown database type: " + newType);
}

Try / catch

try {
  meta.setDatabaseType(userType);
} catch (RuntimeException e) {
  if (e.getMessage() != null && e.getMessage().startsWith("Database type [")) {
    // keep old interface; rethrow as user-facing validation error
    throw new InvalidDatabaseTypeException(userType, e.getCause());
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling setDatabaseType with an unregistered type string; triggered from Spoon UI getInfo/setUp paths, test harnesses (testSetDatabaseType), XML converters (dataNodeToElement), and command-line main().

Common situations: User edits connection type in code to a value from a different Pentaho install that has extra plugins; automated scripts deriving type names from DB vendor names that don't match plugin ids; renamed ids across versions.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/f8acd7c0f7e60f90. Report an issue: GitHub.

Appendix: source

Thrown at core/src/main/java/org/pentaho/di/core/database/DatabaseMeta.java:654

    setName( name );
    setAccessType( getAccessType( access ) );
    setHostname( host );
    setDBName( db );
    setDBPort( port );
    setUsername( user );
    setPassword( pass );
    setServername( null );
    setChanged( false );
  }

  public void setDatabaseType( String type ) {
    DatabaseInterface oldInterface = databaseInterface;

    try {
      databaseInterface = getDatabaseInterface( type );
    } catch ( KettleDatabaseException kde ) {
      throw new RuntimeException( "Database type [" + type + "] not found!", kde );
    }

    setName( oldInterface.getName() );
    setDisplayName( oldInterface.getDisplayName() );
    setAccessType( oldInterface.getAccessType() );
    setHostname( oldInterface.getHostname() );
    setDBName( oldInterface.getDatabaseName() );
    setDBPort( oldInterface.getDatabasePortNumberString() );
    setUsername( oldInterface.getUsername() );
    setPassword( oldInterface.getPassword() );
    setServername( oldInterface.getServername() );
    setDataTablespace( oldInterface.getDataTablespace() );
    setIndexTablespace( oldInterface.getIndexTablespace() );
    setChanged( oldInterface.isChanged() );
  }

  public void setValues( DatabaseMeta info ) {
    databaseInterface = (DatabaseInterface) info.databaseInterface.clone();

View on GitHub (pinned to f3058517a1)