Salesforce pull operation error: INVALID_QUERY_LOCATOR: invalid query locator

  • 65Views
  • Last Post 07 May 2020
Sunil Ciszewski posted this 06 May 2020

We keep getting this error  after  INVALID_QUERY_LOCATOR: invalid query locator   when we run a sunch package for the Campaign Members object. we have 965K records in Salesforce. It transferred 599K the first time we ran it. Every time we try running it again it end up updating several hundered thousand records, but only adding a few more (e.g. 441 on the second run). This worked previously and we have a synch package for that same object connected to our test system.

Order By: Standard | Newest | Votes
Sunil Ciszewski posted this 07 May 2020

Thanks. I will keep running it until I get all my data synched. Then this package can run daily and only have a smaller amount to update in a single run.

Mariia Zaharova posted this 07 May 2020

Hello Sunil,


This error occurs at the Salesforce side. Please refer to:


"Each Salesforce user can have up to 10 query cursors open at a time. This is a hard coded limit that cannot be increased. If 10 query locator cursors are opened when a client application attempts to open a new one, then the oldest cursor is released. If a call is attempted to an expired or released cursor, will return the INVALID_QUERY_LOCATOR error. To avoid this error, ensure that the client code is not holding open more than 10 query locator cursors. If multiple processes are running using the same user, make sure that their combined query locator cursor count remains at 10 or below."


Most likely, a lot of your packages run at the same time (other tools that use the same Salesforce account are also taken into account) and, thus, try to open more than 10 query cursors. Please try re-scheduling your packages.


Best regards,