I have a batch apex class that makes an http (GET) callout to external api from salesforce. It returns x number of JSON objects which are decoded to create lists of cases but the dml upon insert never exceeds 200. The code runs as expected in sandbox but when run in production, i get the : First error: connection was cancelled here. How can i solve this issue?

I have also tried setting req.setTimeout(2000); but this has had no effect. Does the setTimeout() just time out the request after an x period of time with no response or just it time out until the specified time?

Your help is much appreciated.

  • 1
    timeout can go as high as 120000 = 120 seconds = 2 minutes – cropredy Feb 10 '15 at 17:56
  • 4
    I'm voting to close this question as off-topic because it appears to be abandoned. – Adrian Larson Nov 11 '16 at 22:08

I know this is a late response but I've encountered this error in a similar situation (using Apex to make HTTP callouts to an external database). In my case I suspect the error was due to the large amounts of data being repeatedly created and deleted during testing, with a Data Storage limit approaching full.


The guy in that thread says it was resolved by getting Salesforce support to do a hard delete of records in the recycling bin (where records go when us lowly none-SFDC admins 'delete' records).

Not the answer you're looking for? Browse other questions tagged or ask your own question.