pentaho/pentaho-kettle · error · RuntimeException

Database type not found!

Error message

Database type not found!

What it means

DatabaseMeta.setValues(name, type, access, host, db, port, user, pass) wraps getDatabaseInterface(type) and rethrows any KettleDatabaseException as a RuntimeException with message "Database type not found!". It means the type argument named no registered database plugin, so a DatabaseMeta cannot be constructed for it. The original exception is preserved as the cause.

Solutions

  1. Use a valid plugin id constant or DatabaseMeta.findDatabaseInterface(type) to validate before calling.
  2. Log kde.getCause()/message to see which type string failed.
  3. Normalize type strings via getDatabaseInterfaces().keySet() matching (case-insensitive compare) before setValues.
  4. Deploy the missing plugin if the type is legitimate but unregistered.

Example fix

// before
databaseMeta.setValues("conn1", "postgres9", "Native", "dbhost", "mydb", "5432", "user", "pass");
// after
String type = DatabaseMeta.getDatabaseInterfaces().keySet().stream()
  .filter(t -> t.equalsIgnoreCase("postgres9")).findFirst().orElse("POSTGRESQL");
databaseMeta.setValues("conn1", type, "Native", "dbhost", "mydb", "5432", "user", "pass");
Defensive patterns

Strategy: validation

Validate before calling

String resolved = DatabaseMeta.getDatabaseInterfaces().keySet().stream()
  .filter(t -> t.equalsIgnoreCase(requestedType)).findFirst()
  .orElseThrow(() -> new IllegalArgumentException("Invalid database type: " + requestedType));

Try / catch

try {
  meta.setValues(name, type, access, host, db, port, user, pass);
} catch (RuntimeException e) {
  if ("Database type not found!".equals(e.getMessage())) {
    throw new InvalidDatabaseTypeException(type, e.getCause());
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling the 8-argument setValues(...) with an invalid/misspelled type string, or with a type whose plugin isn't installed in the runtime environment.

Common situations: Building connections programmatically with hand-typed type strings ("mysql" instead of "MySQL"/plugin id); porting code between Pentaho versions where ids changed; scripts generated from docs using display names not plugin ids.

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/21a115b8cdf91145. Report an issue: GitHub.

Appendix: source

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

    this.databaseInterface = (DatabaseInterface) databaseMeta.databaseInterface.clone();

    this.setObjectId( databaseMeta.getObjectId() );
    setChanged( true );
    if ( cloneUpdateFlag ) {
      setNeedUpdate( databaseMeta.isNeedUpdate() );
    }
  }

  public void replaceMeta( DatabaseMeta databaseMeta ) {
    replaceMeta( databaseMeta, false );
  }

  public void setValues( String name, String type, String access, String host, String db, String port,
    String user, String pass ) {
    try {
      databaseInterface = getDatabaseInterface( type );
    } catch ( KettleDatabaseException kde ) {
      throw new RuntimeException( "Database type not found!", kde );
    }

    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 );

View on GitHub (pinned to f3058517a1)