pentaho/pentaho-kettle · error · KettleDatabaseException

Error getting catalogs!

Error message

Error getting catalogs!

What it means

Thrown when DatabaseMetaData.getCatalogs() fails or iterating its ResultSet raises a SQLException. Kettle wraps it as "Error getting catalogs!" in a KettleDatabaseException. It means the catalog (database) listing metadata request was rejected or failed.

Solutions

  1. Update the JDBC driver to one that fully implements getCatalogs for your DBMS.
  2. Skip catalog enumeration when the DBMS doesn't support catalogs (check databaseMeta.supportsCatalogs()).
  3. Verify connection liveness and reconnect if needed.
  4. Read the chained SQLException (getCause) for the driver's exact failure reason.

Example fix

// before
String[] catalogs = db.getCatalogs(); // on DBMS without catalog support

// after
if (db.getDatabaseMeta().supportsCatalogs()) {
  String[] catalogs = db.getCatalogs();
}
Defensive patterns

Strategy: validation

Validate before calling

if (db.getDatabaseMeta().supportsCatalogs()) { catalogs = db.getCatalogs(); } else { catalogs = new String[0]; }

Try / catch

try {
  catalogs = db.getCatalogs();
} catch (KettleDatabaseException e) {
  log.warn("Catalog listing failed: " + e.getCause());
  catalogs = new String[0];
}

Prevention

When it happens

Trigger: Database.getCatalogs() call where getDatabaseMetaData().getCatalogs() throws during execution or next() — unsupported catalog concept on the DBMS, broken connection, or insufficient privileges.

Common situations: Calling getCatalogs on drivers that don't implement it correctly (older MySQL/Oracle treats catalog as schema); connection dropped; driver/DB version mismatch; permissions on system catalogs.

Understand the failure class

Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.

Related errors


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

Appendix: source

Thrown at core/src/main/java/org/pentaho/di/core/database/Database.java:4545

    if ( log.isDetailed() ) {
      log.logDetailed( "read :" + catalogList.size() + " schemas from db meta-data." );
    }

    return catalogList.toArray( new String[ catalogList.size() ] );
  }

  public String[] getCatalogs() throws KettleDatabaseException {
    ArrayList<String> catalogList = new ArrayList<>();
    ResultSet catalogResultSet = null;
    try {
      catalogResultSet = getDatabaseMetaData().getCatalogs();
      // Grab all the catalog names and put them in an array list
      while ( catalogResultSet != null && catalogResultSet.next() ) {
        catalogList.add( catalogResultSet.getString( 1 ) );
      }
    } catch ( SQLException e ) {
      throw new KettleDatabaseException( "Error getting catalogs!", e );
    } finally {
      try {
        if ( catalogResultSet != null ) {
          catalogResultSet.close();
        }
      } catch ( SQLException e ) {
        throw new KettleDatabaseException( "Error closing resultset after getting catalogs!", e );
      }
    }

    if ( log.isDetailed() ) {
      log.logDetailed( "read :" + catalogList.size() + " catalogs from db meta-data." );
    }

    return catalogList.toArray( new String[ catalogList.size() ] );
  }

  public String[] getProcedures() throws KettleDatabaseException {

View on GitHub (pinned to f3058517a1)