{"record":{"id":"21a115b8cdf91145","repo":"pentaho/pentaho-kettle","slug":"database-type-not-found","errorCode":null,"errorMessage":"Database type not found!","messagePattern":"Database type not found!","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/database/DatabaseMeta.java","lineNumber":634,"sourceCode":"    this.databaseInterface = (DatabaseInterface) databaseMeta.databaseInterface.clone();\n\n    this.setObjectId( databaseMeta.getObjectId() );\n    setChanged( true );\n    if ( cloneUpdateFlag ) {\n      setNeedUpdate( databaseMeta.isNeedUpdate() );\n    }\n  }\n\n  public void replaceMeta( DatabaseMeta databaseMeta ) {\n    replaceMeta( databaseMeta, false );\n  }\n\n  public void setValues( String name, String type, String access, String host, String db, String port,\n    String user, String pass ) {\n    try {\n      databaseInterface = getDatabaseInterface( type );\n    } catch ( KettleDatabaseException kde ) {\n      throw new RuntimeException( \"Database type not found!\", kde );\n    }\n\n    setName( name );\n    setAccessType( getAccessType( access ) );\n    setHostname( host );\n    setDBName( db );\n    setDBPort( port );\n    setUsername( user );\n    setPassword( pass );\n    setServername( null );\n    setChanged( false );\n  }\n\n  public void setDatabaseType( String type ) {\n    DatabaseInterface oldInterface = databaseInterface;\n\n    try {\n      databaseInterface = getDatabaseInterface( type );","sourceCodeStart":616,"sourceCodeEnd":652,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/database/DatabaseMeta.java#L616-L652","documentation":"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.","triggerScenarios":"Calling the 8-argument setValues(...) with an invalid/misspelled type string, or with a type whose plugin isn't installed in the runtime environment.","commonSituations":"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.","solutions":["Use a valid plugin id constant or DatabaseMeta.findDatabaseInterface(type) to validate before calling.","Log kde.getCause()/message to see which type string failed.","Normalize type strings via getDatabaseInterfaces().keySet() matching (case-insensitive compare) before setValues.","Deploy the missing plugin if the type is legitimate but unregistered."],"exampleFix":"// before\ndatabaseMeta.setValues(\"conn1\", \"postgres9\", \"Native\", \"dbhost\", \"mydb\", \"5432\", \"user\", \"pass\");\n// after\nString type = DatabaseMeta.getDatabaseInterfaces().keySet().stream()\n  .filter(t -> t.equalsIgnoreCase(\"postgres9\")).findFirst().orElse(\"POSTGRESQL\");\ndatabaseMeta.setValues(\"conn1\", type, \"Native\", \"dbhost\", \"mydb\", \"5432\", \"user\", \"pass\");","handlingStrategy":"validation","validationCode":"String resolved = DatabaseMeta.getDatabaseInterfaces().keySet().stream()\n  .filter(t -> t.equalsIgnoreCase(requestedType)).findFirst()\n  .orElseThrow(() -> new IllegalArgumentException(\"Invalid database type: \" + requestedType));","typeGuard":null,"tryCatchPattern":"try {\n  meta.setValues(name, type, access, host, db, port, user, pass);\n} catch (RuntimeException e) {\n  if (\"Database type not found!\".equals(e.getMessage())) {\n    throw new InvalidDatabaseTypeException(type, e.getCause());\n  }\n  throw e;\n}","preventionTips":["Store canonical plugin ids in configuration, not display names.","Build a name->id map once at startup for user-facing input.","Unit-test connection builders against the target environment's installed plugins."],"tags":["database","runtime-exception","invalid-type","metadata"],"backgroundTag":"invalid-argument-value","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}