pentaho/pentaho-kettle · error · KettleException

SalesforceUpdate.Error.FlushBuffer

Error message

SalesforceUpdate.Error.FlushBuffer

What it means

In SalesforceUpdate.flushBuffers(), after calling Salesforce update() the step inspects each SaveResult. If a result reports failure and the step is not in error-handling mode, it throws a KettleException keyed 'SalesforceUpdate.Error.FlushBuffer' with the row index, the first error's StatusCode, and its message. This is Salesforce rejecting one or more records in the committed batch.

Solutions

  1. Read the StatusCode and message embedded in the exception — it names the exact Salesforce field and problem.
  2. Fix the offending data in the stream (bad Id, null on a required field, value failing a validation rule).
  3. Enable step error handling to route failed records to an error stream instead of aborting the batch.
  4. Check field-level security/permissions on the Salesforce object for the integration user.

Example fix

// before: invalid 15/18-char Id passed in the stream
row[0] = "12345"; // not a valid Salesforce Id
// after: use a full record Id fetched from Salesforce
row[0] = "001XXXXXXXXXXXXXXX";
Defensive patterns

Strategy: try-catch

Validate before calling

// Validate Salesforce Id format before sending
if (idField != null && !idField.matches("^[a-zA-Z0-9]{15}(?:[a-zA-Z0-9]{3})?$")) {
  throw new IllegalArgumentException("Invalid Salesforce Id: " + idField);
}

Try / catch

try {
  trans.execute(null);
} catch (KettleException e) {
  // 'SalesforceUpdate.Error.FlushBuffer ... <rowIndex> <StatusCode> <message>'
  // route failed rows to an error stream by enabling error handling on the step
  log.error("Salesforce rejected record: {}", e.getMessage());
}

Prevention

When it happens

Trigger: data.saveResult[j].getSuccess() is false: Salesforce rejected record j of the batch — e.g. invalid field value, missing required field, record locked, INVALID_FIELD / MALFORMED_ID status codes returned by the partner API.

Common situations: Updating a record with an invalid Id format; writing a value that violates a Salesforce validation rule; insufficient field-level security; updating a required field with null.

Related errors


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

Appendix: source

Thrown at plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforceupdate/SalesforceUpdate.java:218

            if ( log.isDetailed() ) {
              logDetailed( BaseMessages.getString( PKG, "SalesforceUpdate.log.LineRow", "" + getLinesInput() ) );
            }
          }

        } else {
          // there were errors during the create call, go through the
          // errors
          // array and write them to the screen

          if ( !getStepMeta().isDoingErrorHandling() ) {
            if ( log.isDetailed() ) {
              logDetailed( "Found error from SalesForce and raising the exception" );
            }

            // Only send the first error
            //
            com.sforce.soap.partner.Error err = data.saveResult[j].getErrors()[0];
            throw new KettleException( BaseMessages.getString( PKG, "SalesforceUpdate.Error.FlushBuffer", new Integer(
                j ), err.getStatusCode(), err.getMessage() ) );
          }

          String errorMessage = "";
          for ( int i = 0; i < data.saveResult[j].getErrors().length; i++ ) {
            // get the next error
            com.sforce.soap.partner.Error err = data.saveResult[j].getErrors()[i];
            errorMessage +=
                BaseMessages.getString( PKG, "SalesforceUpdate.Error.FlushBuffer", new Integer( j ), err
                    .getStatusCode(), err.getMessage() );
          }

          // Simply add this row to the error row
          if ( log.isDebug() ) {
            logDebug( "Passing row to error step" );
          }

          putError( getInputRowMeta(), data.outputBuffer[j], 1, errorMessage, null, "SalesforceUpdate001" );

View on GitHub (pinned to f3058517a1)