{"record":{"id":"f1ca5f6cc585fe77","repo":"pentaho/pentaho-kettle","slug":"gpbulkloadermeta-exception-errorgettingfields","errorCode":null,"errorMessage":"GPBulkLoaderMeta.Exception.ErrorGettingFields","messagePattern":"GPBulkLoaderMeta\\.Exception\\.ErrorGettingFields","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/gp-bulk-loader/core/src/main/java/org/pentaho/di/trans/steps/gpbulkloader/GPBulkLoaderMeta.java","lineNumber":677,"sourceCode":"    if ( databaseMeta != null ) {\n      Database db = new Database( loggingObject, databaseMeta );\n      try {\n        db.connect();\n\n        if ( !Utils.isEmpty( realTableName ) ) {\n          String schemaTable = databaseMeta.getQuotedSchemaTableCombination( realSchemaName, realTableName );\n\n          // Check if this table exists...\n          if ( db.checkTableExists( schemaTable ) ) {\n            return db.getTableFields( schemaTable );\n          } else {\n            throw new KettleException( BaseMessages.getString( PKG, \"GPBulkLoaderMeta.Exception.TableNotFound\" ) );\n          }\n        } else {\n          throw new KettleException( BaseMessages.getString( PKG, \"GPBulkLoaderMeta.Exception.TableNotSpecified\" ) );\n        }\n      } catch ( Exception e ) {\n        throw new KettleException(\n          BaseMessages.getString( PKG, \"GPBulkLoaderMeta.Exception.ErrorGettingFields\" ), e );\n      } finally {\n        db.close();\n      }\n    } else {\n      throw new KettleException( BaseMessages.getString( PKG, \"GPBulkLoaderMeta.Exception.ConnectionNotDefined\" ) );\n    }\n\n  }\n\n  /**\n   * @return the schemaName\n   */\n  @Override\n  public String getSchemaName() {\n    return schemaName;\n  }\n","sourceCodeStart":659,"sourceCodeEnd":695,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/gp-bulk-loader/core/src/main/java/org/pentaho/di/trans/steps/gpbulkloader/GPBulkLoaderMeta.java#L659-L695","documentation":"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.","triggerScenarios":"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.","commonSituations":"Database unreachable/firewalled; wrong JDBC credentials; missing PostgreSQL/Greenplum JDBC driver in classpath; table exists but user lacks privileges to describe it.","solutions":["Inspect getCause() for the real error (connect vs SQL) and fix accordingly","Test the database connection in Spoon (Test button) before running getRequiredFields","Verify the JDBC driver jar is on the classpath","Check privileges of the repository/runtime user on the target table"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// test the connection first\nDatabase db = new Database( loggingObject, databaseMeta );\ntry { db.connect(); db.disconnect(); } catch ( KettleDatabaseException e ) {\n  throw new IllegalStateException( \"DB connection unusable: \" + e.getMessage(), e );\n}","typeGuard":null,"tryCatchPattern":"try { meta.getRequiredFields( transMeta ); } catch ( KettleException e ) { log.error( \"getRequiredFields failed: \" + e.getCause(), e ); }","preventionTips":["Always unwrap getCause() — the ErrorGettingFields message hides the real fault","Use the connection Test button before running","Ship the Greenplum/PostgreSQL JDBC driver with your distribution","Grant the runtime user DESCRIBE/SELECT rights on target tables"],"tags":["kettle","database","jdbc","wrapped-exception"],"backgroundTag":"database-query-failed","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}