Customer Support​

 View Only

 Salesforce Input - ArrayIndexOutOfBoundsException when retrieving Deleted records

  • Customer Support
  • Customer Support
  • Pentaho
  • Pentaho
Ingo Levin's profile image
Ingo Levin posted 06-14-2018 14:52

Hi, I had raised a JIRA for this ages ago and was wondering if someone else has experienced the same problem.

I want to retrieve all the Deleted records for a given Salesforce object. The Salesforce Input step supports three Retrieval options: All, Updated, Deleted. The prior two work fine, but trying to get the Deleted records always throws the below error for me.

Steps to reproduce:

  • Create a blank Transformation and add the Salesforce input step
    • Settings:
      • Enter Username/password
      • Module: Account
    • Content
      • Retrieve: Deleted
      • StartDate: select some date via the date picker < 30 days in the past
      • EndDate: select today's date/time
    • Fields:
      • Add one return field "Id" type String
  • Save the Transformation
  • Preview the Salesforce Input step
2018/06/14 14:47:03 - Salesforce Input.0 - ERROR (version, build from 2018-04-30 09.42.24 by buildguy) : org.pentaho.di.core.exception.KettleException: 2018/06/14 14:47:03 - Salesforce Input.0 - Can not read data from Salesforce! 2018/06/14 14:47:03 - Salesforce Input.0 - 62 2018/06/14 14:47:03 - Salesforce Input.0 - 2018/06/14 14:47:03 - Salesforce Input.0 - at org.pentaho.di.trans.steps.salesforceinput.SalesforceInput.getOneRow( 2018/06/14 14:47:03 - Salesforce Input.0 - at org.pentaho.di.trans.steps.salesforceinput.SalesforceInput.processRow( 2018/06/14 14:47:03 - Salesforce Input.0 - at 2018/06/14 14:47:03 - Salesforce Input.0 - at Source) 2018/06/14 14:47:03 - Salesforce Input.0 - Caused by: java.lang.ArrayIndexOutOfBoundsException: 62 2018/06/14 14:47:03 - Salesforce Input.0 - at org.pentaho.di.trans.steps.salesforce.SalesforceConnection.getRecord( 2018/06/14 14:47:03 - Salesforce Input.0 - at org.pentaho.di.trans.steps.salesforceinput.SalesforceInput.getOneRow(

My hunch is that the issue lies in the fact that the GetDeleted API call from Salesforce returns two fixed properties only (Id, DeletedDate), while the other two retrieval options (All, Updated) return the actual record with the full set of field (Id, Name, etc)

Would appreciate if anyone could help with this!

John Eicher's profile image
John Eicher

Hi Ingo,

It looks like the Jira you've referenced was closed originally because it could not be reproduced by Pentaho/Hitachi engineers. I have tried just now to reproduce this using Spoon version 8.1 and I also could not reproduce it using the settings/steps you've listed here. It appears this issue may be related to your specific instance of Salesforce.

Until Hitachi engineers have a reliable reproduction path, there is no way to resolve the bug, if it is a bug.


Ingo Levin's profile image
Ingo Levin

Hi Chris, thanks for the hint.

I have now also tried it with a Salesforce Developer instance of mine and there it works.

However on two Salesforce instances (from our clients) it does not work. Getting repeatedly the same error as on the JIRA.

That would indeed suggest something related to the instance. My first thought was that maybe it's a permissions thing on the Salesforce GetDeleted() procedure (see Salesforce Developers ).

So instead of using PDI's Salesforce Input step, I decided to try CData's Salesforce JDBC driver and create a Generic JDBC database connection with this driver in PDI for one of the salesforce instances that was throwing errors.

And with that Driver I am able to successfully Get deleted records (See CData JDBC Driver for Salesforce 2017 - GETDELETED Statements ) . That would suggest that I have all necessary permissions on the instance to query deleted data..

Unless the driver uses a different method than PDI to call those records. but no idea how to find that out.

Is there a way for me to trace the PDI error I am getting further in the tool??