{"record":{"id":"5f0a14f2596413ae","repo":"pentaho/pentaho-kettle","slug":"error-while-connecting-to-monetdb-for-bulk-loading","errorCode":null,"errorMessage":"Error while connecting to MonetDB for bulk loading : ","messagePattern":"Error while connecting to MonetDB for bulk loading : ","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/monet-db-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/monetdbbulkloader/MonetDBBulkLoader.java","lineNumber":123,"sourceCode":"\n      if ( log.isDetailed() ) {\n        logDetailed( \"Auto String Length flag: \" + meta.isAutoStringWidths() );\n      }\n\n      DatabaseMeta dm = meta.getDatabaseMeta();\n\n      String user = environmentSubstitute( Const.NVL( dm.getUsername(), \"\" ) );\n      String password = Utils.resolvePassword( variables, Const.NVL( dm.getPassword(), \"\" ) );\n\n      MapiSocket mserver = getMonetDBConnection();\n      data.mserver = mserver;\n\n      data.in = mserver.getReader();\n      data.out = mserver.getWriter();\n\n      String error = data.in.waitForPrompt();\n      if ( error != null ) {\n        throw new KettleException( \"Error while connecting to MonetDB for bulk loading : \" + error );\n      }\n\n      data.outputLogger = new StreamLogger( log, mserver.getInputStream(), \"OUTPUT\" );\n\n      // If the truncate table checkbox is checked, we can do the truncate here.\n      if ( meta.isTruncate() ) {\n        truncate();\n      }\n\n      Database db = null;\n      // get table metadata, will be used later for date type identification (DATE, TIMESTAMP, ...)\n      try {\n\n        db = new Database( meta.getParent(), dm );\n        db.connect( user, password );\n        physicalTableRowMeta = db.getTableFields( data.schemaTable );\n      } catch ( Exception e ) {\n        // try again, with the unquoted table...","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/monet-db-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/monetdbbulkloader/MonetDBBulkLoader.java#L105-L141","documentation":"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.","triggerScenarios":"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.","commonSituations":"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).","solutions":["Verify the MonetDB database is running and reachable at the configured host/port (e.g. monetdb status, check port 50000)","Check username/password on the step/connection settings","Confirm the MonetDB client binary exists and is executable on the PDI server's PATH","Read the error text appended to the message — it contains the MAPI-side reason"],"exampleFix":"// before: database not released/running\n$ monetdb status  (stopped)\n// after\n$ monetdb start mydb && monetdb release mydb","handlingStrategy":"validation","validationCode":"// Pre-flight MonetDB MAPI connectivity\ntry (Socket s = new Socket()) {\n  s.connect(new InetSocketAddress(host, 50000), 3000); // MAPI port\n}\nProcess p = new ProcessBuilder(\"mclient\", \"--version\").start();\nif (p.waitFor(5, TimeUnit.SECONDS) != true) {\n  throw new IllegalStateException(\"MonetDB client not available on PATH\");\n}","typeGuard":"null","tryCatchPattern":"try {\n  step.run();\n} catch (KettleException e) {\n  if (e.getMessage().startsWith(\"Error while connecting to MonetDB for bulk loading\")) {\n    logError(\"MAPI handshake failed: \" + e.getMessage() + \" — check server/credentials/client binary\");\n  }\n}","preventionTips":["Verify MonetDB is running (monetdb status) and the port is open before scheduling","Install MonetDB client tools on every PDI execution node","Validate credentials with the mclient CLI before configuring the step","Read the error string in the message — it carries the MAPI-side reason"],"tags":["monetdb","mapi","connection","bulk-loader"],"backgroundTag":"connection-refused","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"}