pentaho/pentaho-kettle · error · KettleException

GPBulkLoaderMeta.Exception.ErrorGettingFields

Error message

GPBulkLoaderMeta.Exception.ErrorGettingFields

What it means

Wrapping error thrown by GPBulkLoaderMeta.getRequiredFields: any exception while connecting to the database, checking the table, or reading its field metadata is caught and rethrown as KettleException with the localized ErrorGettingFields message, chained to the original cause. It masks the low-level failure (connection, SQL, driver issues) behind a uniform message.

Solutions

  1. Inspect getCause() for the real error (connect vs SQL) and fix accordingly
  2. Test the database connection in Spoon (Test button) before running getRequiredFields
  3. Verify the JDBC driver jar is on the classpath
  4. Check privileges of the repository/runtime user on the target table
Defensive patterns

Strategy: try-catch

Validate before calling

// test the connection first
Database db = new Database( loggingObject, databaseMeta );
try { db.connect(); db.disconnect(); } catch ( KettleDatabaseException e ) {
  throw new IllegalStateException( "DB connection unusable: " + e.getMessage(), e );
}

Try / catch

try { meta.getRequiredFields( transMeta ); } catch ( KettleException e ) { log.error( "getRequiredFields failed: " + e.getCause(), e ); }

Prevention

When it happens

Trigger: getRequiredFields fails inside its try block — e.g. Database.connect throws (bad host/credentials), checkTableExists or getTableFields raises a SQL error, or the driver class is missing.

Common situations: Database unreachable/firewalled; wrong JDBC credentials; missing PostgreSQL/Greenplum JDBC driver in classpath; table exists but user lacks privileges to describe it.

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

Appendix: source

Thrown at plugins/gp-bulk-loader/core/src/main/java/org/pentaho/di/trans/steps/gpbulkloader/GPBulkLoaderMeta.java:677

    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
   */
  @Override
  public String getSchemaName() {
    return schemaName;
  }

View on GitHub (pinned to f3058517a1)