function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DavserDavser 

Batch Processing: "Read Timed Out" Error

Hey

Periodically when running my batch process from a VisualForce page I get a "Read Timed Out" error.

 

I am not calling out to any external systems in my batch.

 

I have gotten this message from code that worked both before and after the problem batch, with no changes to the code in between.

 

Any explanation for this would be highly appreciated!

 

Thanks

Dave

Best Answer chosen by Admin (Salesforce Developers) 
JustinCJustinC

Hi all,

 

The issue should be resolved now. I spoke with support this morning and ran several tests and all have completed successfully.

 

I've only tested on tapp0 so far, but I'm told this fix is across all servers.

 

This affects you if your issue stemmed from Batch Apex taking too long to pick up a connection and you were getting a "Read Timed Out" or Connection Could not be established (or a similar message) in your Monitoring > Debug Logs.

 

If your problem persists, you might want to make sure it isn't something unrelated. As a tip, when doing unit testing make sure to use Test.startTest(); and Test.stopTest(); on anything that calls Batch Apex, which will force it to run synchronously (at the moment stopTest is called). Make sure that you put the Test.stopTest(); before any code that checks the result of the Batch Apex.

 

Justin

All Answers

ARUNBLIKESCLOUDARUNBLIKESCLOUD

Hi,

I am also facing this issue only recently. The code was working properly earlier for me but now get the 'read timed out' error frequently. Any help or hints around this would be appreciated.

 

 

Thanks.

J&A-DevJ&A-Dev
Same here. I've been messing with Batch Apex and I'm too getting the "Read Time Out" status. Does anyone know what could be causing it?
robpowerrobpower
Does anyone else notice this pattern for the timeouts?  If multiple batches are run within a single job, the batches that take less than 2000ms seem to succeed, while the batches that take longer than 2000ms seem to be the only ones that time out.  I do occasionally see batches over 2000ms succeed, but I've never seen one time out in less than 2000ms.  Is that just me, or are the rest of you seeing the same trend?
J&A-DevJ&A-Dev
That seems to be the case with me as well. All the batches that are timing out are the ones that are taking over 2,000ms. In fact, by taking a closer look at my debug logs, along with the "Read Timed out" status, I'm also getting a few that read: "The host did not accept the connection within timeout of 2000 ms".
DJ009DJ009

We have encountered the same error on the batch process job. The jobs failed at the process that takes >2000ms. Does the server running the batch job matters?

 

Has anyone try running apex batch in different Salesforce instance that hosted in different server?

 

Seems like we are constantly getting the error at tapp0.

 

Anyone has idea??

DILIP KUMAR MISTRYDILIP KUMAR MISTRY

Hi all, I am also  getting the same exception. It is completely weired. i Added my lot off efforts on it but still not able to resolve the issue. The same batch job is running fine on my dev org, it is breaking only in case on test org [with tapp0 in url].

 

 

All the contributor are requested to reply on this and that can be a major support to all of us.

 

 

fgwarbfgwarb
Add me to the list of the confused.  I'm getting the read time out failure in the debug logs, and 5 out of 5 batches failed, but I'm seeing the data in my test org??  
ARUNBLIKESCLOUDARUNBLIKESCLOUD

I think its high time we are being helped out by SFDC experts. I got this last time on my production instance for 3 or 4 times and after that it started working fine. This is really scary because it doesn't give us a clue of whats going wrong ..... experts please look into this thread and advise us. Batch Apex is a great feature and we wanted to leverage it fully. Help !!!

JustinCJustinC

I seem to be having the same problem. I'm on tapp0 and I've had Batch Apex code not work, be fine for awhile, and then not work again all without code changes in between.

 

If I use the Monitoring > Debug Logs feature the relevant debug log reads "Read Timed Out" under "Status".

 

I'm new to Batch Apex but I've looked for everything and looked through the debug logs and I can't find any exception errors or any other indications on why the code would fail.

 

Justin

Scapelli77Scapelli77

We have the same problem,

sometimes our batch process has a failure record but any exception are invoked by batch so we cannot trace error to manage record.

 

In our Monitoring > Debug Logs feature we have some operation with "Read Timed Out" under "Status".

 

Why? Any help or hints around this would be appreciated.

 

Thanks

Simone

JustinCJustinC
I spoke with Salesforce Developer support today and was told that they are experiencing some issues with Batch Apex and that they hope to have a fix next week. It's possible this issue is related. I'll post again if I hear anything else, and if it addresses my issue.
fgwarbfgwarb
I'm dubious that it's exclusively the undocumented processing time issue, because as you can see in the image below I've had successes with > 2K ms processing time.
 
Processing Times
 
 
 
Tangent:  In the log below the entire process took 1960ms, but I'm only seeing 1057ms logged =(
 
Duration (ms) 1,960
Log:
20091130204236.567:Class.name.start: line 21, column 24: SOQL query with 1 row finished in 35 ms
20091130204236.567:Class.name.start: line 29, column 6: Update: SOBJECT:sObject
20091130204236.567:Class.name.start: line 29, column 6:     DML Operation executed in 306 ms
20091130204236.567:Class.name.start: line 30, column 46: SOQL query with 330 rows finished in 184 ms
20091130204236.567:External entry point:     returning LIST:SOBJECT:sObject from method global Iterable<SOBJECT:sObject> start(Database.BatchableContext) in 532 ms
 
Thanks for keeping us in the loop JustinC 
 
(edit was for grammar) 
Message Edited by fgwarb on 11-30-2009 01:46 PM
JustinCJustinC

Despite my code not working on tapp0 (unit tests failed, real tests failed) I decided to try deploying to production (na4). Unit tests and real world tests have worked so far.

 

So it really does seem like this issue is isolated to tapp0 which I think everyone else in this forum has been referring to.

 

Justin

ARUNBLIKESCLOUDARUNBLIKESCLOUD

Justin,

Occasionally this happens in prod(na6) too. It happened for me thrice. But occasionally.

Scapelli77Scapelli77

For us occasionally happens in prod(emea).

 

Simone

JustinCJustinC

Hi all,

 

The issue should be resolved now. I spoke with support this morning and ran several tests and all have completed successfully.

 

I've only tested on tapp0 so far, but I'm told this fix is across all servers.

 

This affects you if your issue stemmed from Batch Apex taking too long to pick up a connection and you were getting a "Read Timed Out" or Connection Could not be established (or a similar message) in your Monitoring > Debug Logs.

 

If your problem persists, you might want to make sure it isn't something unrelated. As a tip, when doing unit testing make sure to use Test.startTest(); and Test.stopTest(); on anything that calls Batch Apex, which will force it to run synchronously (at the moment stopTest is called). Make sure that you put the Test.stopTest(); before any code that checks the result of the Batch Apex.

 

Justin

This was selected as the best answer
fgwarbfgwarb

Stellar stuff!  Thanks for the update.

 

For complete transparency, I'm still expecting complete resolution after this weekend's maintenance as I just executed the same job with the same data 4 times and got 3 different processing results.

 

Processing 1: 3 batches failed out of 28

Processing 2: 1 out of 1 batch failed with error: "Unable to write to any of the ACS stores in the alloted time." 10147ms

Processing 3: 0 batches failed out of 28 (100% success) 

Processing 4: 0 batches failed out of 28 (100% success)

JustinCJustinC
What server is this on?
fgwarbfgwarb
tapp0
JustinCJustinC
I've done a fair amount of testing over the past 24 hours and I just encountered the "Unable to write to any of the ACS stores in the alloted time." error for the first time, and another "Read Timed Out". It's definitely been better, but looks like it's not fixed entirely.