pentaho/pentaho-kettle · error · KettleException

Error while connecting to MonetDB for bulk loading :

Error message

Error while connecting to MonetDB for bulk loading : 

What it means

In MonetDBBulkLoader.execute, after starting the MAPI client process, the code reads the prompt via data.in.waitForPrompt(). If waitForPrompt returns a non-null error string, the connection handshake failed and a KettleException is thrown. It means the bulk loader could not establish a working MAPI session with MonetDB before any rows are sent.

Solutions

  1. Verify the MonetDB database is running and reachable at the configured host/port (e.g. monetdb status, check port 50000)
  2. Check username/password on the step/connection settings
  3. Confirm the MonetDB client binary exists and is executable on the PDI server's PATH
  4. Read the error text appended to the message — it contains the MAPI-side reason

Example fix

// before: database not released/running
$ monetdb status  (stopped)
// after
$ monetdb start mydb && monetdb release mydb
Defensive patterns

Strategy: validation

Validate before calling

// Pre-flight MonetDB MAPI connectivity
try (Socket s = new Socket()) {
  s.connect(new InetSocketAddress(host, 50000), 3000); // MAPI port
}
Process p = new ProcessBuilder("mclient", "--version").start();
if (p.waitFor(5, TimeUnit.SECONDS) != true) {
  throw new IllegalStateException("MonetDB client not available on PATH");
}

Type guard

null

Try / catch

try {
  step.run();
} catch (KettleException e) {
  if (e.getMessage().startsWith("Error while connecting to MonetDB for bulk loading")) {
    logError("MAPI handshake failed: " + e.getMessage() + " — check server/credentials/client binary");
  }
}

Prevention

When it happens

Trigger: execute() (called from processRow) starts the MonetDB client process and waitForPrompt() reports an error — wrong host/port, bad credentials, database not running, or the client emitting an error at startup.

Common situations: MonetDB server stopped or wrong port in the connection settings; incorrect username/password; client binary not installed or not on PATH on the PDI server; firewall blocking the MAPI port (default 50000).

Understand the failure class

Background: ECONNREFUSED and "connection refused" / "could not connect to server" errors: what they mean and how to fix them — this error's family across 44 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/5f0a14f2596413ae. Report an issue: GitHub.

Appendix: source

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

      if ( log.isDetailed() ) {
        logDetailed( "Auto String Length flag: " + meta.isAutoStringWidths() );
      }

      DatabaseMeta dm = meta.getDatabaseMeta();

      String user = environmentSubstitute( Const.NVL( dm.getUsername(), "" ) );
      String password = Utils.resolvePassword( variables, Const.NVL( dm.getPassword(), "" ) );

      MapiSocket mserver = getMonetDBConnection();
      data.mserver = mserver;

      data.in = mserver.getReader();
      data.out = mserver.getWriter();

      String error = data.in.waitForPrompt();
      if ( error != null ) {
        throw new KettleException( "Error while connecting to MonetDB for bulk loading : " + error );
      }

      data.outputLogger = new StreamLogger( log, mserver.getInputStream(), "OUTPUT" );

      // If the truncate table checkbox is checked, we can do the truncate here.
      if ( meta.isTruncate() ) {
        truncate();
      }

      Database db = null;
      // get table metadata, will be used later for date type identification (DATE, TIMESTAMP, ...)
      try {

        db = new Database( meta.getParent(), dm );
        db.connect( user, password );
        physicalTableRowMeta = db.getTableFields( data.schemaTable );
      } catch ( Exception e ) {
        // try again, with the unquoted table...

View on GitHub (pinned to f3058517a1)