pentaho/pentaho-kettle · error · KettleException
An error occurred writing data to the MonetDB API (MAPI)…
Error message
An error occurred writing data to the MonetDB API (MAPI) process
What it means
Catch-all wrapper for the entire writeBufferToMonetDB() body: any exception thrown while streaming buffered rows to the MAPI mserver process (I/O errors on the socket streams, process died, or the nested KettleExceptions above) is rethrown as this KettleException with the original as cause. It means the pipe to the MonetDB bulk-loader process broke during a write.
Solutions
- Inspect the wrapped cause (e.g. IOException/broken pipe) to see if the mserver process died
- Check MonetDB server logs around the failure time for crashes or fatal errors
- Verify the connection stays alive (timeouts, firewall idle disconnects) during long loads
- Re-run the transformation; if a bad row killed the session, fix the data or enable compatibility mode
Defensive patterns
Strategy: retry
Validate before calling
// before writing, confirm the mserver process/socket is alive if ( !data.mserverAlive() ) reopenConnection();
Type guard
if ( data == null || data.out == null || data.in == null ) throw new KettleException( "MAPI streams not initialized" );
Try / catch
try { writeBuffer(); } catch ( KettleException e ) { if ( e.getCause() instanceof IOException ) { reconnect and retry the batch once; } else rethrow; } Prevention
- Avoid killing/restarting mserver during loads
- Configure keepalives/timeouts to survive long idle flushes
- Check server logs for crashes after seeing this error
- Retry idempotent loads after a reconnection
When it happens
Trigger: data.out.writeLine() fails because the mserver subprocess has exited (server crash, killed process, socket closed); waitForPrompt() throws; or any other Exception during buffer flushing is caught by the outer catch block.
Common situations: MonetDB server restarted or crashed mid-load; mserver terminated due to a previous fatal COPY error closing stdin; network/pipe interruption; misconfigured MAPI connection dropped during the transaction.
Related errors
- Error loading data:
- Error serializing rows of data to the fifo file
- Error while closing output
- Error while creating table
- Error while dropping table
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/aa2be5f6bc4d8e04.
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:521
// write an empty line, forces the flush of the stream
data.out.writeLine( "" );
// again...
error = data.in.waitForPrompt();
if ( error != null ) {
throw new KettleException( "Error loading data: " + error );
}
}
if ( log.isRowLevel() ) {
logRowlevel( Const.CR );
}
// reset the buffer pointer...
//
data.bufferIndex = 0;
} catch ( Exception e ) {
throw new KettleException( "An error occurred writing data to the MonetDB API (MAPI) process", e );
}
}
protected void verifyDatabaseConnection() throws KettleException {
// Confirming Database Connection is defined.
if ( meta.getDatabaseMeta() == null ) {
throw new KettleException( BaseMessages.getString( PKG, "MonetDBBulkLoaderMeta.GetSQL.NoConnectionDefined" ) );
}
}
@Override
public boolean init( StepMetaInterface smi, StepDataInterface sdi ) {
meta = (MonetDBBulkLoaderMeta) smi;
data = (MonetDBBulkLoaderData) sdi;
if ( super.init( smi, sdi ) ) {
try {View on GitHub (pinned to f3058517a1)