T
T
temakorolev12020-11-06 20:48:57
PHP
temakorolev1, 2020-11-06 20:48:57

Telegram bot crashes with FetchError: request to url: connect ETIMEDOUT, what's the problem?

Bot crashes with an error


FetchError: request to https://domain.ru/api/get/token failed, reason: connect ETIMEDOUT here IP(Cloudflare):443
at ClientRequest. (/home/user/bot/node_modules/node-fetch/lib/index.js:1461:11)
at ClientRequest.emit (events.js:315:20)
at TLSSocket.socketErrorListener (_http_client.js:426:9)
at TLSSocket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/ task_queues.js:84:21) {
type: 'system',
errno: 'ETIMEDOUT',
code: 'ETIMEDOUT'
}

I read that such an error occurs when the server does not respond to a request within a certain period of time.
The most interesting thing is that the bot initially works very well and responds to many requests, but after 20 minutes, do not use the bot, for example, the bot does not respond to requests in the logs, that is the same error. I also have Cloudflare protection, it acts as a proxy. That is, all requests go from the bot to the site through Cloudflare. Can the bot fall because of it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Gavrilov, 2020-11-07
@thexaver

Because the wrong user agent

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question