pentaho/pentaho-kettle · error · KettleStepException

SalesforceInsert.log.Exception

Error message

SalesforceInsert.log.Exception

What it means

processRow() calls writeToSalesForce(outputRowData) and wraps any Exception it throws into a KettleStepException with the 'log.Exception' message. This is a generic wrapper: the real problem (SOAP call failure, data conversion, buffer issue) is in the cause, and note the message swallows the stack trace since the cause is only interpolated into the text.

Solutions

  1. Inspect writeToSalesForce's wrapped cause / log the full stack — enable detailed logging to see the underlying error
  2. Verify Salesforce connection (username/password/security token, endpoint URL) is still valid
  3. Handle error rows (step error handling) so bad rows are routed instead of killing the transformation
  4. Improve diagnostics: pass 'e' as cause instead of embedding via message interpolation

Example fix

// before
throw new KettleStepException(BaseMessages.getString(PKG, "SalesforceInsert.log.Exception", e));
// after
throw new KettleStepException(BaseMessages.getString(PKG, "SalesforceInsert.log.Exception", e.getMessage()), e);
Defensive patterns

Strategy: try-catch

Try / catch

try {
  trans.execute(null);
  trans.waitUntilFinished();
} catch (KettleException e) {
  Throwable root = e;
  while (root.getCause() != null) root = root.getCause();
  log.error("SalesforceInsert write failed, root cause: {}", root.getMessage(), root);
}

Prevention

When it happens

Trigger: Any Exception from writeToSalesForce() during processRow: Salesforce SOAP call fails, SObject construction fails on the row data, or connection to the Salesforce API breaks.

Common situations: Salesforce API outage or session expiry mid-transformation; invalid field value for the SObject type; network failure; batch write raising an unexpected exception type.

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


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

Appendix: source

Thrown at plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforceinsert/SalesforceInsert.java:105

      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,
                      metaStore );

      // Build the mapping of input position to field name
      data.fieldnrs = new int[meta.getUpdateStream().length];
      for ( int i = 0; i < meta.getUpdateStream().length; i++ ) {
        data.fieldnrs[i] = getInputRowMeta().indexOfValue( meta.getUpdateStream()[i] );
        if ( data.fieldnrs[i] < 0 ) {
          throw new KettleException( BaseMessages.getString( PKG, "SalesforceInsert.CanNotFindField", meta
            .getUpdateStream()[i] ) );
        }
      }
    }

    try {
      writeToSalesForce( outputRowData );

    } catch ( Exception e ) {
      throw new KettleStepException( BaseMessages.getString( PKG, "SalesforceInsert.log.Exception", e ) );
    }
    return true;
  }

  @VisibleForTesting
  void writeToSalesForce( Object[] rowData ) throws KettleException {
    try {

      if ( log.isDetailed() ) {
        logDetailed( BaseMessages.getString( PKG, "SalesforceInsert.WriteToSalesforce", data.iBufferPos, meta
          .getBatchSizeInt() ) );
      }

      // if there is room in the buffer
      if ( data.iBufferPos < meta.getBatchSizeInt() ) {
        ArrayList<XmlObject> insertfields = new ArrayList<>();
        // Reserve for empty fields
        ArrayList<String> fieldsToNull = new ArrayList<String>();

View on GitHub (pinned to f3058517a1)