windkh / node-red-contrib-telegrambot

Telegram bot nodes for node-red.
Other
268 stars 119 forks source link

EFATAL: AggregateError Polling error --> Trying again on Ubuntu only, not Windows #385

Closed bairhys closed 2 months ago

bairhys commented 4 months ago

When I run Node Red docker container on Ubuntu with a basic flow including a Telegram sender, the Telegram sender reports a error EFATAL: AggregateError and no message is sent. When I run the exact same flow on Node Red docker container on Windows, it runs fine and message is sent. I am not sure why on Ubuntu messages won't send.

I also use this module on a Node Red instance running on a RPi HaOS and sends messages fine there.

When I start a terminal session inside the Node Red docker container on Ubuntu, I can ping api.telegram.org fine so it doesn't seem to be a networking issue. Then I think, why is it working on Windows and not Ubuntu?

When I read the Node Red docker container on Ubuntu logs, it shows a Unhandled rejection RequestError: AggregateError, the full error shown below

The flow I am using to test is:

image

Where the function has this code inside:

msg.payload = {}
msg.payload['chatId'] = my-chat-id;
msg.payload['type'] = "message";
msg.payload.content = "abcde";
return msg;

This is the error shown from the docker container:

[warn] [telegram bot] EFATAL: AggregateError
[warn] [telegram bot] Polling error --> Trying again.
Unhandled rejection RequestError: AggregateError
    at new RequestError (/data/node_modules/request-promise-core/lib/errors.js:14:15)
    at plumbing.callback (/data/node_modules/request-promise-core/lib/plumbing.js:87:29)
    at Request.RP$callback [as _callback] (/data/node_modules/request-promise-core/lib/plumbing.js:46:31)
    at self.callback (/data/node_modules/@cypress/request/request.js:183:22)
    at Request.emit (node:events:519:28)
    at Request.onRequestError (/data/node_modules/@cypress/request/request.js:869:8)
    at ClientRequest.emit (node:events:519:28)
    at TLSSocket.socketErrorListener (node:_http_client:500:9)
    at TLSSocket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
windkh commented 4 months ago

Hm no idea... strange

bairhys commented 4 months ago

Yeah very strange. I have used this module for probably a year now on RPi HAOS and been very reliable and fast. I ended up not using Node Red and instead making a python docker image with python-telegram-bot.