{"record":{"id":"9b49cbdddbcdf8f7","repo":"pentaho/pentaho-kettle","slug":"error-loading-data","errorCode":null,"errorMessage":"Error loading data: ","messagePattern":"Error loading data: ","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":491,"sourceCode":"        logDetailed( cmd );\n      }\n\n      data.out.write( 's' );\n      data.out.write( cmdBuff.toString() );\n      data.out.newLine();\n\n      for ( int i = 0; i < data.bufferIndex; i++ ) {\n        String buffer = data.rowBuffer[i];\n        data.out.write( buffer );\n        if ( log.isRowLevel() ) {\n          logRowlevel( buffer );\n        }\n      }\n\n      // wait for the prompt\n      String error = data.in.waitForPrompt();\n      if ( error != null ) {\n        throw new KettleException( \"Error loading data: \" + error );\n      }\n      // write an empty line, forces the flush of the stream\n      data.out.writeLine( \"\" );\n\n      // again...\n      error = data.in.waitForPrompt();\n      if ( error != null ) {\n        throw new KettleException( \"Error loading data: \" + error );\n      }\n\n      if ( !meta.isCompatibilityDbVersionMode() ) {\n        // write an empty line, forces the flush of the stream\n        data.out.writeLine( \"\" );\n\n        // again...\n        error = data.in.waitForPrompt();\n        if ( error != null ) {\n          throw new KettleException( \"Error loading data: \" + error );","sourceCodeStart":473,"sourceCodeEnd":509,"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#L473-L509","documentation":"In writeBufferToMonetDB(), after the buffer is flushed to the MAPI mserver child process, data.in.waitForPrompt() returns a non-null error string when the MonetDB COPY INTO loader reports a problem. The step converts that string into a KettleException prefixed 'Error loading data: '.","triggerScenarios":"The first waitForPrompt() after writing buffered rows to the mserver stdin returns an error message, e.g. a rejected row (wrong number of fields, bad value format for a column, NOT NULL violation) during the COPY INTO load.","commonSituations":"Incoming row fields don't match the table's column count/types; special characters or unescaped field/record separators in the data; NULL handling mismatches; a schema change after the table was created leaves rows incompatible.","solutions":["Inspect the error string after the prefix - it names the offending row/column from MonetDB","Verify the row's field count and formats match the target table definition","Escape or remove occurrences of the field/record separator characters in the data","Re-run autoAdjustSchema/DDL so the table matches the current row layout"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// validate row shape against table before writing to buffer\nif ( row.length != expectedColumnCount ) throw new KettleException( \"Field count mismatch\" );\nfor each value: check it contains no unescaped field/record separator characters","typeGuard":"null","tryCatchPattern":"try { loader.putRow( row ); } catch ( KettleException e ) { log.error( \"MonetDB load error: \" + e.getMessage() ); quarantine the offending row and continue or abort }","preventionTips":["Keep the table schema in sync with the transformation row layout","Escape special/separator characters in string fields","Validate field formats (dates, numbers) before the load","Compare field count in the step mapping with the actual row"],"tags":["database","bulk-load","monetdb","data-format"],"backgroundTag":"database-write-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"}