Tooling REST API CalloutException Read timed out

Salesforce Asked on January 4, 2022

We’ve got an issue regarding Salesforce improperly cleaning out FlowElementTestCoverage records, leaving over a million "stranded" on an old/inactive Flow Version. This is causing us to be unable to delete said Flow Version.

The object in question can only be queried/deleted via the Tooling API, and I’ve written the following just to test retrieval:

HttpRequest req = new HttpRequest();
req.setHeader('Authorization','Bearer '+accessToken);

String urlQuery = EncodingUtil.urlEncode('SELECT Id, FlowVersionId FROM FlowElementTestCoverage WHERE FlowVersionId = '[myFlowVersionId]' LIMIT 1', 'UTF-8');

HttpResponse res = new Http().send(req);

Problem is, I always get System.CalloutException: Read timed out. However, when I remove the WHERE clause such that the query is SELECT Id, FlowVersionId FROM FlowElementTestCoverage LIMIT 1, it works fine.

I guess I’m just a little lost as to how to proceed. I don’t understand how adding a FlowVersionId filter would cause this problem.

One Answer

Well, in thinking further about the WHERE clause specifically causing the issue, I wondered if it was a spacing issue. I edited that line to remove spaces in the SELECT and WHERE:

SELECT Id,FlowVersionId FROM FlowElementTestCoverage WHERE FlowVersionId='[myFlowVersionId]' LIMIT 1'

...and it worked!

Answered by Mike on January 4, 2022

Add your own answers!

Related Questions

Getting field value from Map an using it in For Loop

1  Asked on October 4, 2021 by user1669296


Integrating Mobile SDK in existing React Native app

2  Asked on October 4, 2021 by user85549


Associating new contacts/cases with an account?

2  Asked on October 4, 2021 by akor


Case Owner for portal users is showing up as blank

1  Asked on October 4, 2021 by matthew-metros


Is it ok to delete a managed package?

1  Asked on October 4, 2021 by jayesh-babu


Issue in Guest User : post Summer release 2020

0  Asked on October 4, 2021 by suggs


Ask a Question

Get help from others!

© 2023 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP