pentaho/pentaho-kettle · error · KettleException
SalesforceInsert.FailedToInsertObject
Error message
SalesforceInsert.FailedToInsertObject
What it means
At the end of flushBuffers(), after an Exception occurs, the step either routes the row to error handling or throws KettleException 'Failed to insert object' with e.getMessage(). The throw happens only when the step is NOT configured with error handling (getStepMeta().isDoingErrorHandling() is false).
Solutions
- Configure step error handling (error stream with ' Nr of errors' settings) so failures are captured instead of aborting — this bypasses the throw
- Fix the data/Salesforce error in the wrapped cause, then rerun
- Enable detailed logging to see which row/record failed and why
- Validate record payloads against Salesforce field requirements before the step
Defensive patterns
Strategy: fallback
Validate before calling
if (!stepMeta.isDoingErrorHandling()) {
log.warn("SalesforceInsert has no error handling; any insert failure will abort the transformation");
} Try / catch
try {
trans.execute(null);
} catch (KettleException e) {
Throwable root = e;
while (root.getCause() != null) root = root.getCause();
log.error("Insert failed (no error handling configured): {}", root.getMessage(), root);
} Prevention
- Configure an error-handling target step on Salesforce Insert so errors divert instead of throwing
- Validate record payloads against Salesforce schema before batch flush
- Monitor Salesforce session validity for long-running jobs
When it happens
Trigger: Exception during Salesforce insert/buffer flush with no error-handling configured: SOAP fault, connection failure, or invalid SObject data on the row being flushed.
Common situations: Records failing Salesforce validation rules on a plain run without error handling; session expired mid-batch; network interruption during flush; developers running transformations without error streams configured.
Understand the failure class
Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.
Related errors
- Errors encountered (first 10): ...
- SalesforceDelete.Error.WriteToSalesforce
- SalesforceDelete.FailedToDeleted
- SalesforceInsert.Error
- SalesforceInsert.Error.FlushBuffer
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/5a3eab96384a1070.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforceinsert/SalesforceInsert.java:250
// Simply add this row to the error row
if ( log.isDetailed() ) {
logDetailed( BaseMessages.getString( PKG, "SalesforceInsert.PassingRowToErrorStep" ) );
}
putError( getInputRowMeta(), data.outputBuffer[j], 1, errorMessage, null, "SalesforceInsert001" );
}
}
// reset the buffers
data.sfBuffer = new SObject[meta.getBatchSizeInt()];
data.outputBuffer = new Object[meta.getBatchSizeInt()][];
data.iBufferPos = 0;
} catch ( Exception e ) {
if ( !getStepMeta().isDoingErrorHandling() ) {
throw new KettleException( BaseMessages.getString( PKG, "SalesforceInsert.FailedToInsertObject", e
.getMessage() ) );
}
// Simply add this row to the error row
if ( log.isDebug() ) {
logDebug( "Passing row to error step" );
}
for ( int i = 0; i < data.iBufferPos; i++ ) {
putError( data.inputRowMeta, data.outputBuffer[i], 1, e.getMessage(), null, "SalesforceInsert002" );
}
} finally {
if ( data.saveResult != null ) {
data.saveResult = null;
}
}
}
View on GitHub (pinned to f3058517a1)