pentaho/pentaho-kettle · error · KettleException

MonetDBBulkLoaderMeta.Exception.ErrorGettingFields

MonetDBBulkLoaderMeta.Exception.ErrorGettingFields

Error message

MonetDBBulkLoaderMeta.Exception.ErrorGettingFields

What it means

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.

Solutions

  1. Inspect the cause chain for the underlying KettleDatabaseException/SQLException and fix that (connectivity, credentials, or SQL)
  2. Test the step's database connection in Spoon (Test button) to isolate connection vs metadata issues
  3. Confirm the MonetDB JDBC driver is on the classpath and the server is reachable from the PDI host
  4. Verify the user has SELECT/metadata privileges on the schema.table

Example fix

// before
Database db = new Database(loggingObject, databaseMeta);
db.connect();
RowMetaInterface fields = meta.getTableFields();
// after
try {
  meta.getTableFields();
} catch (KettleException e) {
  logError("Could not read fields from target table: " + e.getCause(), e);
  throw e;
} finally {
  db.disconnect();
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Test connectivity before field discovery
DatabaseMeta dbm = meta.getDatabaseMeta();
if (dbm == null) throw new KettleException("No database connection configured");
Database test = new Database(parentLoggingObject, dbm);
test.connect();
test.disconnect();

Try / catch

try {
  RowMetaInterface rmi = meta.getTableFields();
} catch (KettleException e) {
  Throwable c = e.getCause();
  if (c instanceof KettleDatabaseException) {
    // connection/SQL problem: check host, port, credentials, driver
  }
  throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

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

Appendix: source

Thrown at plugins/monet-db-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/monetdbbulkloader/MonetDBBulkLoaderMeta.java:791

      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, "MonetDBBulkLoaderMeta.Exception.TableNotFound" ) );
          }
        } else {
          throw new KettleException( BaseMessages.getString(
              PKG, "MonetDBBulkLoaderMeta.Exception.TableNotSpecified" ) );
        }
      } catch ( Exception e ) {
        throw new KettleException( BaseMessages.getString(
            PKG, "MonetDBBulkLoaderMeta.Exception.ErrorGettingFields" ), e );
      } finally {
        db.close();
      }
    } else {
      throw new KettleException( BaseMessages.getString(
          PKG, "MonetDBBulkLoaderMeta.Exception.ConnectionNotDefined" ) );
    }

  }

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

View on GitHub (pinned to f3058517a1)