pentaho/pentaho-kettle · error · KettleException

GPBulkLoaderMeta.Exception.ErrorGettingFields

GPBulkLoaderMeta.Exception.ErrorGettingFields

Error message

GPBulkLoaderMeta.Exception.ErrorGettingFields

What it means

getRequiredFields() wraps its whole table-introspection body (connect, checkTableExists, getTableFields) in a catch-all that rethrows as KettleException with GPBulkLoaderMeta.Exception.ErrorGettingFields and the original exception as cause. It is a generic wrapper meaning field metadata for the target table could not be retrieved; the real reason is in the cause (connection failure, SQL error, permission denied).

Solutions

  1. Read the cause exception — it names the actual JDBC/SQL error; fix that root cause first.
  2. Test the step's database connection (Test button) and fix credentials/host/port/driver.
  3. Grant the connecting user SELECT on the target table (PostgreSQL: GRANT SELECT ON schema.table TO user;).
  4. Retry after resolving transient network/DB outages.

Example fix

// before: user cannot read table metadata
// GRANT needed
// after (run on PostgreSQL)
GRANT SELECT ON staging.sales_facts TO kettle_user;
Defensive patterns

Strategy: try-catch

Validate before calling

DatabaseMeta dm = meta.getDatabaseMeta();
if ( dm != null ) { try ( Database db = new Database( loggingObject, dm ) ) { db.connect(); } } // fail fast on connectivity

Try / catch

try { meta.getRequiredFields( transMeta ); } catch ( KettleException e ) { logError( "Cause: " + e.getCause(), e ); } // inspect cause for JDBC error

Prevention

When it happens

Trigger: Any exception inside getRequiredFields()'s try block after a connection exists: db.connect() failing (bad credentials/host), db.getTableFields() throwing on a malformed/odd table, or SQLException during metadata queries.

Common situations: Wrong database credentials or unreachable host for the step's connection; driver not on classpath; user lacking SELECT privilege on the target table (PostgreSQL refuses column metadata); intermittent DB outage during transformation check.

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/588cedb423b401dd. Report an issue: GitHub.

Appendix: source

Thrown at plugins/postgresql-db-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/pgbulkloader/PGBulkLoaderMeta.java:609

    if ( databaseMeta != null ) {
      Database db = new Database( loggingObject, databaseMeta );
      try {
        db.connect();

        if ( !Utils.isEmpty( realTableName ) ) {
          String schemaTable = databaseMeta.getQuotedSchemaTableCombination( realSchemaName, realTableName );

          // Check if this table exists...
          if ( db.checkTableExists( schemaTable ) ) {
            return db.getTableFields( schemaTable );
          } else {
            throw new KettleException( BaseMessages.getString( PKG, "GPBulkLoaderMeta.Exception.TableNotFound" ) );
          }
        } else {
          throw new KettleException( BaseMessages.getString( PKG, "GPBulkLoaderMeta.Exception.TableNotSpecified" ) );
        }
      } catch ( Exception e ) {
        throw new KettleException(
          BaseMessages.getString( PKG, "GPBulkLoaderMeta.Exception.ErrorGettingFields" ), e );
      } finally {
        db.close();
      }
    } else {
      throw new KettleException( BaseMessages.getString( PKG, "GPBulkLoaderMeta.Exception.ConnectionNotDefined" ) );
    }

  }

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

  /**

View on GitHub (pinned to f3058517a1)