F
F
ff0xff2019-03-15 16:42:35
Node.js
ff0xff, 2019-03-15 16:42:35

How to cure ESOCKETTIMEDOUT error in nodejs?

I send an http request to the server
. From time to time I get this error:

Error: ESOCKETTIMEDOUT
at ClientRequest. (/home/master/TESTANUS0.005/node_modules/request/request.js:816:19)
at Object.onceWrapper (events.js:285:13)
at ClientRequest.emit (events.js:197:13)
at TLSSocket .emitRequestTimeout (_http_client.js:669:40)
at Object.onceWrapper (events.js:285:13)
at TLSSocket.emit (events.js:197:13)
at TLSSocket.Socket._onTimeout (net.js:447: eight)
at listOnTimeout (timers.js:327:15)
at processTimers (timers.js:271:5) code: 'ESOCKETTIMEDOUT', connect: false

I googled: - the only advice that everyone gives is: put this at the beginning of the script and you will be happy! But there is no happiness .... the error has not gone anywhere. Who struggled with this? nodejs v11
process.env.UV_THREADPOOL_SIZE=128;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
marsv, 2021-10-19
@marsv

A similar situation arose with similar symptoms.
As a result of debugging, I found a problem with DNS requests in NodeJS.
Solving Node DNS issues and other things
Switched to GOT + cacheable-lookup, problem gone.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question