{"record":{"id":"87df2190322ab94d","repo":"pentaho/pentaho-kettle","slug":"salesforceinput-exception-cannotreadfromsalesforce","errorCode":null,"errorMessage":"SalesforceInput.Exception.CanNotReadFromSalesforce","messagePattern":"SalesforceInput\\.Exception\\.CanNotReadFromSalesforce","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforceinput/SalesforceInput.java","lineNumber":255,"sourceCode":"      // See if we need to add the server timestamp to the row...\n      if ( meta.includeTimestamp() && !Utils.isEmpty( meta.getTimestampField() ) ) {\n        outputRowData[rowIndex++] = data.connection.getServerTimestamp();\n      }\n\n      // See if we need to add the row number to the row...\n      if ( meta.includeRowNumber() && !Utils.isEmpty( meta.getRowNumberField() ) ) {\n        outputRowData[rowIndex++] = new Long( data.rownr );\n      }\n\n      if ( meta.includeDeletionDate() && !Utils.isEmpty( meta.getDeletionDateField() ) ) {\n        outputRowData[rowIndex++] = srvalue.getDeletionDate();\n      }\n\n      RowMetaInterface irow = getInputRowMeta();\n\n      data.previousRow = irow == null ? outputRowData : irow.cloneRow( outputRowData ); // copy it to make\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages\n        .getString( PKG, \"SalesforceInput.Exception.CanNotReadFromSalesforce\" ), e );\n    }\n\n    return outputRowData;\n  }\n\n  // DO CONVERSIONS...\n  void doConversions( Object[] outputRowData, int i, String value ) throws KettleValueException {\n    ValueMetaInterface targetValueMeta = data.outputRowMeta.getValueMeta( i );\n    ValueMetaInterface sourceValueMeta = data.convertRowMeta.getValueMeta( i );\n\n    if ( ValueMetaInterface.TYPE_BINARY != targetValueMeta.getType() ) {\n      outputRowData[i] = targetValueMeta.convertData( sourceValueMeta, value );\n    } else {\n      // binary type of salesforce requires specific conversion\n      if ( value != null ) {\n        outputRowData[ i ] = Base64.decode( value );\n      } else {","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforceinput/SalesforceInput.java#L237-L273","documentation":"SalesforceInput wraps any Exception thrown while producing a row inside getOneRow() into a KettleException with the message 'Can not read from Salesforce'. getOneRow() builds the output row (from the query result or field defaults) and clones the previous row; if anything fails there (typically a problem evaluating field mappings against the current row), this error is raised to the transformation runtime.","triggerScenarios":"Any Exception inside getOneRow() during processRow: e.g. a mapped input field expression fails on the current row, outputRowData construction throws, or irow.cloneRow() fails on a malformed/absent input row meta.","commonSituations":"Transformation with a field lookup/mapping that references a value not present in the incoming row; null input row meta on the first batch; a step upstream emitting unexpected data types.","solutions":["Inspect the wrapped 'cause' exception in the Kettle log — this message is only a wrapper; the root cause names the real failure","Verify all fields configured in the Salesforce Input step exist in the incoming row stream","Run the transformation with detailed logging and check the row being processed when the error occurs","Test the transformation with a sample of the actual input rows to reproduce the failing row"],"exampleFix":"// before\nString value = row.getString(\"Amount\"); // throws if field missing\n// after\nint idx = getInputRowMeta().indexOfValue(\"Amount\");\nString value = idx >= 0 ? row.getString(idx) : null;","handlingStrategy":"try-catch","validationCode":"int idx = transMeta.getPrevStepFields(stepMeta).indexOfValue(fieldName);\nif (idx < 0) throw new IllegalStateException(\"Missing input field: \" + fieldName);","typeGuard":null,"tryCatchPattern":"try {\n  trans.execute(null);\n} catch (KettleException e) {\n  Throwable root = e;\n  while (root.getCause() != null) root = root.getCause();\n  log.error(\"SalesforceInput row processing failed: {}\", root.getMessage(), root);\n}","preventionTips":["Always verify upstream field names match the Salesforce Input step's field mappings before running","Keep the wrapped cause chain in logs, not just the wrapper message","Test transformations with representative production data samples"],"tags":["kettle","salesforce","row-processing","wrapped-exception"],"backgroundTag":"unexpected-response-shape","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"}