pentaho/pentaho-kettle · error · KettleDatabaseException
Unable to determine if indexes exists on table
Error message
Unable to determine if indexes exists on table [<tablename>]
What it means
BaseDatabaseMeta's index-existence check (used by e.g. checkIndexesSupported/index handling) queries database metadata to determine whether indexes exist on a table, aggregating a boolean 'all'. Any Exception during that metadata lookup is wrapped in a KettleDatabaseException stating the check could not be performed for the named table.
Solutions
- Verify the table exists and the connection user has metadata read privileges (e.g. SELECT on system catalogs).
- Check the table name's case and schema qualification against the target database's rules.
- Test the same lookup directly via java.sql.DatabaseMetaData.getIndexInfo() to isolate the driver behavior.
- Catch KettleDatabaseException and skip index verification for tables where metadata access is unavailable.
Example fix
// before boolean ok = dbMeta.hasIndexOnColumns(... "MyTable" ...); // wrong case on Oracle // after boolean ok = dbMeta.hasIndexOnColumns(... "MYSCHEMA.MYTABLE" ...);
Defensive patterns
Strategy: try-catch
Validate before calling
boolean readable;
try (java.sql.ResultSet rs = connection.getMetaData().getTables(null, schema, table, new String[]{"TABLE"})) {
readable = rs.next();
}
if (!readable) { /* skip index check: table or metadata not accessible */ } Try / catch
try {
db.checkIndexes(table, ...);
} catch (KettleDatabaseException e) {
LOG.warn("Cannot verify indexes on [" + table + "] — check grants/driver", e);
} Prevention
- Grant the connection user metadata catalog read privileges.
- Match table name case and schema qualification to the target database's rules.
- Verify DatabaseMetaData.getIndexInfo() works with the driver in a smoke test.
When it happens
Trigger: Calling the index-existence check (via BaseDatabaseMeta) for a table when the underlying DatabaseMeta lookup throws — table name wrong/quoted incorrectly, insufficient permissions on metadata catalogs, or driver failure in DatabaseMetaData calls.
Common situations: Running 'verify/cleanup indexes' transformations against tables the user cannot see in the system catalog; schema-qualified or case-sensitive table names on Oracle/DB2; drivers that don't implement the needed metadata methods.
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
- Database.Exception.EmptyConnectionError
- Database.Exception.UnableToGetMetadata
- Database type not found!
- DatabaseMeta.Error.DatabaseInterfaceNotFound
- DatabaseMeta.Error.UnableRetrieveDbInfo
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/e1b7dcc379ad768e.
Report an issue: GitHub.
Appendix: source
Thrown at core/src/main/java/org/pentaho/di/core/database/BaseDatabaseMeta.java:1657
}
}
} finally {
if ( indexList != null ) {
indexList.close();
}
}
// See if all the fields are indexed...
boolean all = true;
for ( int i = 0; i < exists.length && all; i++ ) {
if ( !exists[i] ) {
all = false;
}
}
return all;
} catch ( Exception e ) {
throw new KettleDatabaseException( "Unable to determine if indexes exists on table [" + tablename + "]", e );
}
}
/**
* @return true if the database supports the NOMAXVALUE sequence option. The default is false, AS/400 and DB2 support
* this.
*/
@Override
public boolean supportsSequenceNoMaxValueOption() {
return false;
}
/**
* @return true if we need to append the PRIMARY KEY block in the create table block after the fields, required for
* Cache.
*/
@OverrideView on GitHub (pinned to f3058517a1)