Telegram send fails after upgrade to NR19

I’m using nodered to send a message to a telegram group when the status of an alarm system changes.

When I update NR to 19, sending stops and the error log fills up with these every 3 seconds:

21 Mar 09:45:00 - [warn] [telegram bot:8aca1d0dc2ab1e8e] EFATAL: AggregateError
21 Mar 09:45:00 - [warn] [telegram bot:8aca1d0dc2ab1e8e] Unknown error. Trying again.
Unhandled rejection RequestError: AggregateError
    at new RequestError (/config/node_modules/request-promise-core/lib/errors.js:14:15)
    at Request.plumbing.callback (/config/node_modules/request-promise-core/lib/plumbing.js:87:29)
    at Request.RP$callback [as _callback] (/config/node_modules/request-promise-core/lib/plumbing.js:46:31)
    at self.callback (/config/node_modules/request/request.js:185:22)
    at Request.emit (node:events:524:28)
    at Request.onRequestError (/config/node_modules/request/request.js:877:8)
    at ClientRequest.emit (node:events:524:28)
    at emitErrorEvent (node:_http_client:104:11)
    at TLSSocket.socketErrorListener (node:_http_client:518:5)
    at TLSSocket.emit (node:events:524:28)
    at emitErrorNT (node:internal/streams/destroy:170:8)
    at emitErrorCloseNT (node:internal/streams/destroy:129:3)
    at processTicksAndRejections (node:internal/process/task_queues:90:21)

Reverting to 18.1.1 resolves the issue.

Is there a breaking change I missed that means I need make changes to my flow? I’m assuming that the issue lies somewhere in the bot configuration, because there is only one error reported each time, not an error for every flow that uses the bot.

Thanks

The Home Assistant Node-RED add-on v19+ changes the included node.js from v18 to v22.

On the assumption that you are using node-red-contrib-telegrambot there are open issues on Github that probably relate to this.

Something to do with IPv4 calls timing out too quickly, switching to unrouted IPv6, and the telegram server complaining as it does not accept polling from the same token from two different parties. This post https://github.com/windkh/node-red-contrib-telegrambot/issues/345#issuecomment-2639096226 covers the node.js issue in v22 and a possible solution.

Otherwise, a Google search on EFATAL: AggregateError brings up a few more ideas along the same lines.