{"record":{"id":"dfc1de732e155903","repo":"pentaho/pentaho-kettle","slug":"gploadmeta-exception-errorgettingfields","errorCode":"GPLoadMeta.Exception.ErrorGettingFields","errorMessage":"GPLoadMeta.Exception.ErrorGettingFields","messagePattern":"GPLoadMeta\\.Exception\\.ErrorGettingFields","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/gpload/core/src/main/java/org/pentaho/di/trans/steps/gpload/GPLoadMeta.java","lineNumber":789,"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, \"GPLoadMeta.Exception.TableNotFound\" ) );\n          }\n        } else {\n          throw new KettleException( BaseMessages.getString( PKG, \"GPLoadMeta.Exception.TableNotSpecified\" ) );\n        }\n      } catch ( Exception e ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"GPLoadMeta.Exception.ErrorGettingFields\" ), e );\n      } finally {\n        db.close();\n      }\n    } else {\n      throw new KettleException( BaseMessages.getString( PKG, \"GPLoadMeta.Exception.ConnectionNotDefined\" ) );\n    }\n  }\n\n  /**\n   * @return the schemaName\n   */\n  public String getSchemaName() {\n    return schemaName;\n  }\n\n  /**\n   * @param schemaName\n   *          the schemaName to set","sourceCodeStart":771,"sourceCodeEnd":807,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/gpload/core/src/main/java/org/pentaho/di/trans/steps/gpload/GPLoadMeta.java#L771-L807","documentation":"GPLoadMeta's table-fields lookup wraps its whole body in try/catch(Exception) and rethrows any failure as a KettleException with the ErrorGettingFields message key, chaining the original cause. It is a generic wrapper: any error while connecting to the database or reading the table's field metadata surfaces under this message.","triggerScenarios":"Any exception inside getTableFields()'s try block — connection failure, SQL error in checkTableExists/getTableFields, or the TableNotFound/TableNotSpecified KettleExceptions — is caught and re-wrapped with this key.","commonSituations":"Database unreachable or credentials wrong; underlying 'table not found'/'table not specified' errors wrapped by this outer message; driver issues; insufficient privileges to query system catalogs.","solutions":["Inspect the chained cause exception in the stack trace for the real root problem","Test the database connection in the step dialog (wrong host/port/user/password are the usual roots)","Confirm the target table exists and the name/schema fields are filled (avoids the wrapped TableNotFound/TableNotSpecified)","Verify the Greenplum JDBC driver is on the classpath and the user can read catalog metadata"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Pre-check connection and table before invoking the metadata API\nDatabase db = new Database(loggingObject, databaseMeta);\ndb.connect();\nboolean ok = db.checkTableExists(schema + \".\" + table);\ndb.disconnect();","typeGuard":null,"tryCatchPattern":"try { return meta.getTableFields(); } catch (KettleException e) { Throwable root = e; while (root.getCause() != null) root = root.getCause(); log.error(\"getTableFields failed, root cause: \", root); throw e; }","preventionTips":["Always unwrap and log the chained cause — this error is a generic wrapper","Test the DB connection in the dialog before running","Confirm table existence and name fields before calling metadata APIs"],"tags":["pdi","gpload","greenplum","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"}