pentaho/pentaho-kettle · error · KettleException

InsertUpdateMeta.Exception.ErrorGettingFields

Error message

InsertUpdateMeta.Exception.ErrorGettingFields

What it means

Thrown by InsertUpdateMeta.getTableFields() as the wrapping error when any exception occurs while reading the target table's field metadata (e.g. the table does not exist, or the JDBC metadata call fails). It preserves the original exception as the cause. It is the generic failure path of the fields lookup.

Solutions

  1. Inspect the cause chain (getCause()) to see the real JDBC error.
  2. Verify the table exists in the configured schema (or add a 'Create table' / SQL step before the transformation).
  3. Check the database connection details (host, port, user, password, database) in the connection dialog.
  4. Grant the DB user SELECT privileges on the target schema/table.

Example fix

// before: running transform on empty database
// after: create the table first via a 'Execute SQL script' step:
CREATE TABLE PUBLIC.CUSTOMERS (ID BIGINT PRIMARY KEY, NAME VARCHAR(100));
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-flight: confirm connectivity and table existence
DatabaseMeta dbMeta = meta.getDatabaseMeta();
Database db = new Database(parent, dbMeta);
db.connect();
if (!db.checkTableExists(schema, table)) throw new IllegalStateException("Table missing: " + table);

Try / catch

try { db.getTableFields(schema, table); } catch (KettleException e) { logError("Field lookup failed: " + e.getCause(), e); throw e; }

Prevention

When it happens

Trigger: getTableFields() invoked with a valid connection and table name, but checkTableExists/getTableFieldsMeta throws: the table does not exist (inner TableNotFound), bad credentials, network failure, or insufficient privileges.

Common situations: Running the transformation before the target table was created; pointing at a different schema/environment (test vs prod); database user lacking SELECT on the table; DB temporarily unreachable.

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/153c77ea04328825. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/insertupdate/InsertUpdateMeta.java:818

    String realTableName = space.environmentSubstitute( tableName );

    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, "InsertUpdateMeta.Exception.TableNotFound" ) );
          }
        } else {
          throw new KettleException( BaseMessages.getString( PKG, "InsertUpdateMeta.Exception.TableNotSpecified" ) );
        }
      } catch ( Exception e ) {
        throw new KettleException(
          BaseMessages.getString( PKG, "InsertUpdateMeta.Exception.ErrorGettingFields" ), e );
      } finally {
        db.close();
      }
    } else {
      throw new KettleException( BaseMessages.getString( PKG, "InsertUpdateMeta.Exception.ConnectionNotDefined" ) );
    }

  }

  /**
   * @return the schemaName
   */
  public String getSchemaName() {
    return schemaName;
  }

  @Override public String getMissingDatabaseConnectionInformationMessage() {

View on GitHub (pinned to f3058517a1)