{"record":{"id":"136bec5ea2150e6e","repo":"pentaho/pentaho-kettle","slug":"salesforceupsert-failedupsert","errorCode":null,"errorMessage":"SalesforceUpsert.FailedUpsert","messagePattern":"SalesforceUpsert\\.FailedUpsert","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforceupsert/SalesforceUpsert.java","lineNumber":289,"sourceCode":"            logDebug( BaseMessages.getString( PKG, \"SalesforceUpsert.PassingRowToErrorStep\" ) );\n          }\n          putError( getInputRowMeta(), data.outputBuffer[j], 1, errorMessage, null, \"SalesforceUpsert001\" );\n        }\n\n      }\n\n      // reset the buffers\n      data.sfBuffer = new SObject[meta.getBatchSizeInt()];\n      data.outputBuffer = new Object[meta.getBatchSizeInt()][];\n      data.iBufferPos = 0;\n\n    } catch ( Exception e ) {\n      if ( !getStepMeta().isDoingErrorHandling() ) {\n        if ( e instanceof KettleException ) {\n          // I know, bad form usually. But I didn't want to duplicate the logic with a catch(KettleException). MB\n          throw (KettleException) e;\n        } else {\n          throw new KettleException(\n            BaseMessages.getString( PKG, \"SalesforceUpsert.FailedUpsert\", e.getMessage() ), e );\n        }\n      }\n      // Simply add this row to the error row\n      if ( log.isDebug() ) {\n        logDebug( \"Passing row to error step\" );\n      }\n\n      for ( int i = 0; i < data.iBufferPos; i++ ) {\n        putError( data.inputRowMeta, data.outputBuffer[i], 1, e.getMessage(), null, \"SalesforceUpsert002\" );\n      }\n    } finally {\n      if ( data.upsertResult != null ) {\n        data.upsertResult = null;\n      }\n    }\n\n  }","sourceCodeStart":271,"sourceCodeEnd":307,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforceupsert/SalesforceUpsert.java#L271-L307","documentation":"Thrown in SalesforceUpsert.flushBuffers when the whole upsert call itself throws (transport/login/SOAP failure) and the step is NOT configured for error handling. Non-Kettle exceptions are wrapped with this message including e.getMessage(); KettleExceptions are rethrown unchanged. If error handling is enabled, the row goes to the error stream instead.","triggerScenarios":"The Salesforce upsert SOAP call throws — invalid session, connection failure, endpoint timeout, WS client error — while getStepMeta().isDoingErrorHandling() is false.","commonSituations":"Salesforce session expired mid-transformation; network/firewall interruption; wrong API endpoint for the Salesforce instance; Salesforce service outage during a long run.","solutions":["Check the chained cause for the underlying Salesforce/transport error.","Enable error handling on the step to route failed batches to an error stream instead of aborting.","Reconnect/re-authenticate to Salesforce and re-run the transformation.","Add retry logic or split large batches to reduce exposure to transient failures."],"exampleFix":"// before: no error handling configured\n// transformation aborts on transient Salesforce outage\n// after: in the step dialog, enable error handling and set an error target step\nstepMeta.setSupportsErrorHandling(true); // or check 'Error handling' in the UI","handlingStrategy":"retry","validationCode":"// confirm session/endpoint health before batch upserts\nif (!salesforceConnection.isLoggedIn()) salesforceConnection.login(username, password + securityToken);","typeGuard":null,"tryCatchPattern":"try { writeToSalesForce(rowData); } catch (KettleException e) { if (isTransient(e)) { backoffRetry(rowData); } else throw e; }","preventionTips":["Enable error handling on the step to avoid whole-transformation aborts","Use correct API endpoint URLs for your Salesforce instance","Batch records in moderate sizes to limit transient failure impact","Schedule around Salesforce maintenance windows"],"tags":["pentaho","kettle","salesforce","upsert","api-failure"],"backgroundTag":"upstream-api-error","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}