ECONNRESET
See original GitHub issueHi There,
First, as always I like to say thank you for your hard work on this library.
Recently I wrote a syncer script using jsforce, and I can’t help but notice when executing a very large query on a very large table the connection gets reset multiple times.
Now I have built in recovery procedure into the script to handle the problem, but my Project Manager asked me if there was anything I could do to increase the timeout time on my end.
My very simple log file looks like this:
starting another job: Task
begin working on job Task
updated job Task status {running:true}
beginSync
{ [Error: socket hang up] code: 'ECONNRESET' }
gotResults
salesforce error: { [Error: socket hang up] code: 'ECONNRESET' }
beginSync
{ [Error: socket hang up] code: 'ECONNRESET' }
gotResults
salesforce error: { [Error: socket hang up] code: 'ECONNRESET' }
beginSync
{ [Error: socket hang up] code: 'ECONNRESET' }
gotResults
salesforce error: { [Error: socket hang up] code: 'ECONNRESET' }
beginSync
gotResults
updating job Task lastDate:2014-11-14T00:37:00.000+0000
continueSync
gotResults
updating job Task lastDate:2014-11-19T19:31:30.000+0000
continueSync
...
After three hangups, everything begins to work correctly. This has been a consistent pattern with one table and query.
Please do let me know if there is some setting on my end I can control to extend how long the connection is open for.
Thank you!
Issue Analytics
- State:
- Created 8 years ago
- Reactions:7
- Comments:8 (4 by maintainers)
Top Results From Across the Web
How do I debug error ECONNRESET in Node.js?
ECONNRESET occurs when the server side closes the TCP connection and your request to the server is not fulfilled. The server ...
Read more >What does “Error: read ECONNRESET” mean? - Quora
You might have guessed it already: it's a connection error. "ECONNRESET" means the other side of the TCP conversation abruptly closed its end...
Read more >Fixing an ECONNRESET error - Postman
The ECONRESET error means that the server unexpectedly closed the connection and the request to the server was not fulfilled. Connection-related ...
Read more >How do I debug error ECONNRESET in Node.js?
“ECONNRESET” means the other side of the TCP conversation abruptly closed its end of the connection. This is most probably due to one...
Read more >Return code ECONNRESET for TCP/IP - IBM
Depending upon the platform or platforms your enterprise uses, you receive the following return code when the connection is reset by peer (ECONNRESET):....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We submit a lot of batch jobs to Salesforce on a daily basis and I can tell you 1st hand that we see this error regularly. We process about 100-200 batch jobs a day. It’s become much more frequent in the past 3-4 months. I agree with @tejasmanohar in that we get these most commonly when trying to close jobs - As though Salesforce simply can’t get the job done at times and so the API call will timeout. All-in-all their API is extremely unreliable.
Currently forced to issue retries and/or alternative designs that limit the amount of jobs needed just to attempt to avoid the unreliable Salesforce job system. Suggestions welcome however short of opening a support ticket with Salesforce I believe this is out of jsforce’s control. Please leave this ticket open for now in case a creative solution presents itself.
Encountered this issue when sending multiple queries through a Promise.all(). Interestingly the first retry hit an issue where a query returned 0 results (not possible with ‘SELECT Id, DeveloperName FROM RecordType’). The next retry succeeded with no issue. If this is a timeout issue, is there a way to define the timeout for the http.request() to allow more time for SF to complete the request at “busy” times?