pentaho/pentaho-kettle · error · KettleException
TableOutputMeta.Exception.ErrorGettingFields
TableOutputMeta.Exception.ErrorGettingFields
Error message
TableOutputMeta.Exception.ErrorGettingFields
What it means
A catch-all wrapper raised inside the TableOutputMeta table-field lookup: any Exception thrown while connecting to the database or reading the target table's metadata (getTableFieldsMeta) is rethrown as a KettleException with this keyed message and the original as cause. It signals the field-introspection operation failed for a reason other than the specific TableNotFound/TableNotSpecified checks.
Solutions
- Inspect the cause chain (getCause()) for the underlying JDBC/SQL error.
- Test the database connection in the connection dialog (Test button) to isolate connectivity/credentials.
- Ensure the JDBC driver for your database is on the classpath (lib/ or libext/).
- Grant the user permission to query metadata (e.g. INFORMATION_SCHEMA / system catalogs) for the target schema.
Defensive patterns
Strategy: validation
Validate before calling
// verify connectivity and driver before metadata lookup
try (Connection c = dbMeta.getConnectionTest()) { /* or use Database.test() */
// connection OK
} Try / catch
try { fields = meta.getTableFields(); }
catch (KettleException e) {
Throwable root = ExceptionUtils.getRootCause(e);
log.error("Field lookup failed: " + root, root); // shows real JDBC error
} Prevention
- Test the database connection before deploying transformations
- Install the JDBC driver in lib/ and restart Pentaho
- Grant metadata-reading privileges to the runtime user
When it happens
Trigger: db.checkTableExists or db.getTableFieldsMeta throws — e.g. JDBC connection failure, SQL error during metadata queries, driver missing — while executing the getTableFields() path on TableOutputMeta.
Common situations: Database unreachable (network/firewall), wrong credentials, missing JDBC driver jar in lib/, database permissions insufficient for metadata queries, schema/table names with characters requiring quoting.
Understand the failure class
Background: "query failed", "%w: SQL error" — wrapped database query errors in Go libraries explained — this error's family across 3 libraries.
Related errors
- ElasticSearchBulkMeta.Exception.ErrorReadingRepository
- ElasticSearchBulkMeta.Exception.ErrorSavingToRepository
- Error evaluating Internet address value metadata
- Error inserting row into table [tableName] with values…
- Error updating batch
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/b1364c8f2bb60000.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/trans/steps/tableoutput/TableOutputMeta.java:923
String realSchemaName = space.environmentSubstitute( schemaName );
if ( databaseMeta != null ) {
Database db = new Database( loggingObject, databaseMeta );
try {
db.connect();
if ( !Utils.isEmpty( realTableName ) ) {
// Check if this table exists...
if ( db.checkTableExists( realSchemaName, realTableName ) ) {
return db.getTableFieldsMeta( realSchemaName, realTableName );
} else {
throw new KettleException( BaseMessages.getString( PKG, "TableOutputMeta.Exception.TableNotFound" ) );
}
} else {
throw new KettleException( BaseMessages.getString( PKG, "TableOutputMeta.Exception.TableNotSpecified" ) );
}
} catch ( Exception e ) {
throw new KettleException(
BaseMessages.getString( PKG, "TableOutputMeta.Exception.ErrorGettingFields" ), e );
} finally {
db.close();
}
} else {
throw new KettleException( BaseMessages.getString( PKG, "TableOutputMeta.Exception.ConnectionNotDefined" ) );
}
}
public DatabaseMeta[] getUsedDatabaseConnections() {
if ( databaseMeta != null ) {
return new DatabaseMeta[] { databaseMeta };
} else {
return super.getUsedDatabaseConnections();
}
}
View on GitHub (pinned to f3058517a1)