pentaho/pentaho-kettle · error · KettleException

SalesforceInput.ErrorInsert

Error message

SalesforceInput.ErrorInsert

What it means

KettleException thrown by SalesforceConnection.insert() when the SOAP create() call fails. Like upsert(), the exception text is embedded in the message rather than as a cause. Records are first normalized into SObjects; any transport/API failure during create() triggers this error.

Solutions

  1. Read the embedded Salesforce fault in the message for the exact record/field error
  2. Ensure all required fields (and required-by-validation-rule fields) are populated
  3. Verify Create object permission for the integration user
  4. Check field value formats (dates ISO 8601, valid picklist values, valid lookup IDs)
  5. Split large buffers into smaller batches (connection.setRowsInBatch)

Example fix

// before
SaveResult[] r = connection.insert(buffer); // missing required Name
// after
// populate required fields on each SObject first
SaveResult[] r = connection.insert(buffer);
for (SaveResult res : r) if (!res.isSuccess()) handleErrors(res.getErrors());
Defensive patterns

Strategy: validation

Validate before calling

if (sfBuffer == null || sfBuffer.length == 0) throw new IllegalArgumentException("Empty insert buffer"); // also pre-check required fields via getFields() metadata

Type guard

boolean insertReady(SObject[] buf) { return buf != null && buf.length > 0 && Arrays.stream(buf).allMatch(o -> o != null && o.getType() != null); }

Try / catch

try { results = connection.insert(buffer); } catch (KettleException e) { log.logError("Insert failed: " + e.getMessage(), e); throw e; } // fault text is in e.getMessage()

Prevention

When it happens

Trigger: Calling insert(sfBuffer) when the binding's create() throws: invalid session, malformed SObject (bad field/value), missing create permission, or an empty/oversized batch rejected by the API.

Common situations: Required Salesforce fields missing in the incoming rows, picklist/lookup values not matching existing records, API user lacking Create permission, sending more records than the SOAP batch limits allow.

Related errors


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

Appendix: source

Thrown at plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforce/SalesforceConnection.java:877

  public UpsertResult[] upsert( String upsertField, SObject[] sfBuffer ) throws KettleException {
    try {
      return getBinding().upsert( upsertField, sfBuffer );
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString( PKG, "SalesforceInput.ErrorUpsert", e ) );
    }
  }

  public SaveResult[] insert( SObject[] sfBuffer ) throws KettleException {
    try {
      List<SObject> normalizedSfBuffer = new ArrayList<>();
      for ( SObject part : sfBuffer ) {
        if ( part != null ) {
          normalizedSfBuffer.add( part );
        }
      }
      return getBinding().create( normalizedSfBuffer.toArray( new SObject[normalizedSfBuffer.size()] ) );
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString( PKG, "SalesforceInput.ErrorInsert", e ) );
    }
  }

  public SaveResult[] update( SObject[] sfBuffer ) throws KettleException {
    try {
      return getBinding().update( sfBuffer );
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString( PKG, "SalesforceInput.ErrorUpdate", e ) );
    }
  }

  public DeleteResult[] delete( String[] id ) throws KettleException {
    try {
      return getBinding().delete( id );
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString( PKG, "SalesforceInput.ErrorDelete", e ) );
    }
  }

View on GitHub (pinned to f3058517a1)