pentaho/pentaho-kettle · error · KettleException

SalesforceUpsert.Error.FlushBuffer

Error message

SalesforceUpsert.Error.FlushBuffer

What it means

Thrown in SalesforceUpsert.flushBuffers when Salesforce returns an upsertResult whose success flag is false: the first error's status code and message (plus the row index j) are formatted into this KettleException. It surfaces a record-level Salesforce rejection, e.g. a field-level validation or invalid external ID.

Solutions

  1. Read the status code (e.g. INVALID_FIELD, MALFORMED_ID, REQUIRED_FIELD_MISSING) and message in the exception to identify the failing row.
  2. Fix the field mapping or data that violates the Salesforce status code reported.
  3. Verify the external-ID field name and that it's marked as external ID in Salesforce.
  4. Enable step error handling so rejected records go to an error stream instead of failing the whole transformation.

Example fix

// before: mapping a non-existent field
<lookup>Account_Ext_Id__c</lookup> // field deleted in Salesforce
// after: recreate or remap
<lookup>Account_External_Id__c</lookup>
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-validate mapped fields exist on the Salesforce object
connectionManager.describeSObject(objectName); // check each updateLookup field against describe results

Try / catch

try { writeToSalesForce(rowData); } catch (KettleException e) { if (e.getMessage().contains("FlushBuffer")) { parseStatusCode(e.getMessage()); routeRowToErrorStream(rowData, e); } else throw e; }

Prevention

When it happens

Trigger: An upsert call completes but data.upsertResult[j].getSuccess() is false for record j — Salesforce rejected the record. Thrown only when detailed logging shows errors are found; the first error of the batch is raised.

Common situations: INVALID_FIELD errors from wrong external-ID field; required Salesforce fields missing from the mapping; validation rules failing; duplicate/malformed external-ID values; insufficient object permissions in Salesforce.

Related errors


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

Appendix: source

Thrown at plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforceupsert/SalesforceUpsert.java:255

            if ( log.isDetailed() ) {
              logDetailed( BaseMessages.getString( PKG, "SalesforceUpsert.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( BaseMessages.getString( PKG, "SalesforceUpsert.ErrorFound" ) );
            }

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

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

          // Simply add this row to the error row
          if ( log.isDebug() ) {
            logDebug( BaseMessages.getString( PKG, "SalesforceUpsert.PassingRowToErrorStep" ) );
          }
          putError( getInputRowMeta(), data.outputBuffer[j], 1, errorMessage, null, "SalesforceUpsert001" );

View on GitHub (pinned to f3058517a1)