{"record":{"id":"7f3c15f24898ba17","repo":"pentaho/pentaho-kettle","slug":"monetdbbulkloadermeta-exception-errorgettingfields","errorCode":"MonetDBBulkLoaderMeta.Exception.ErrorGettingFields","errorMessage":"MonetDBBulkLoaderMeta.Exception.ErrorGettingFields","messagePattern":"MonetDBBulkLoaderMeta\\.Exception\\.ErrorGettingFields","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/monet-db-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/monetdbbulkloader/MonetDBBulkLoaderMeta.java","lineNumber":791,"sourceCode":"      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(\n                PKG, \"MonetDBBulkLoaderMeta.Exception.TableNotFound\" ) );\n          }\n        } else {\n          throw new KettleException( BaseMessages.getString(\n              PKG, \"MonetDBBulkLoaderMeta.Exception.TableNotSpecified\" ) );\n        }\n      } catch ( Exception e ) {\n        throw new KettleException( BaseMessages.getString(\n            PKG, \"MonetDBBulkLoaderMeta.Exception.ErrorGettingFields\" ), e );\n      } finally {\n        db.close();\n      }\n    } else {\n      throw new KettleException( BaseMessages.getString(\n          PKG, \"MonetDBBulkLoaderMeta.Exception.ConnectionNotDefined\" ) );\n    }\n\n  }\n\n  /**\n   * @return the schemaName\n   */\n  public String getSchemaName() {\n    return schemaName;\n  }\n","sourceCodeStart":773,"sourceCodeEnd":809,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/monet-db-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/monetdbbulkloader/MonetDBBulkLoaderMeta.java#L773-L809","documentation":"MonetDBBulkLoaderMeta wraps any failure during the database field-discovery sequence (connect, checkTableExists, getTableFields) in a KettleException carrying 'ErrorGettingFields'. It indicates metadata about the target table's columns could not be retrieved; the original exception is preserved as the cause. The database connection is closed in a finally block.","triggerScenarios":"Any Exception thrown inside the try block — connection failure to MonetDB, authentication failure, SQL error from getTableFields, or the TableNotFound/TableNotSpecified KettleExceptions — is re-wrapped as this error.","commonSituations":"MonetDB server down or wrong host/port in the connection; wrong username/password; insufficient privileges to read table metadata; JDBC driver missing; network/firewall blocking the port.","solutions":["Inspect the cause chain for the underlying KettleDatabaseException/SQLException and fix that (connectivity, credentials, or SQL)","Test the step's database connection in Spoon (Test button) to isolate connection vs metadata issues","Confirm the MonetDB JDBC driver is on the classpath and the server is reachable from the PDI host","Verify the user has SELECT/metadata privileges on the schema.table"],"exampleFix":"// before\nDatabase db = new Database(loggingObject, databaseMeta);\ndb.connect();\nRowMetaInterface fields = meta.getTableFields();\n// after\ntry {\n  meta.getTableFields();\n} catch (KettleException e) {\n  logError(\"Could not read fields from target table: \" + e.getCause(), e);\n  throw e;\n} finally {\n  db.disconnect();\n}","handlingStrategy":"try-catch","validationCode":"// Test connectivity before field discovery\nDatabaseMeta dbm = meta.getDatabaseMeta();\nif (dbm == null) throw new KettleException(\"No database connection configured\");\nDatabase test = new Database(parentLoggingObject, dbm);\ntest.connect();\ntest.disconnect();","typeGuard":null,"tryCatchPattern":"try {\n  RowMetaInterface rmi = meta.getTableFields();\n} catch (KettleException e) {\n  Throwable c = e.getCause();\n  if (c instanceof KettleDatabaseException) {\n    // connection/SQL problem: check host, port, credentials, driver\n  }\n  throw e;\n}","preventionTips":["Use the Test Connection button in the database dialog before designing steps","Ensure the MonetDB JDBC driver is installed in lib/ or the plugin's lib directory","Whitelist the MonetDB port on firewalls between PDI and the database","Grant the connecting user metadata SELECT privileges on the target schema"],"tags":["database","monetdb","connection","metadata"],"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"}