node-red-contrib-telegrambot-home icon indicating copy to clipboard operation
node-red-contrib-telegrambot-home copied to clipboard

Bot not reacting after some time

Open HSoeren opened this issue 5 years ago • 11 comments

I'm using your telegram bot now for two weeks and i have noticed that sometimes - if there was no interaction with the bot for 1-2 days - it doesn't react to commands any more and the messages seem to go nowhere, which can only be fixed by a new deploy.

Is there something you can do about or any logfiles which help to troubleshoot that?

HSoeren avatar Oct 13 '19 09:10 HSoeren

Same Problem to me

Speeedy0815 avatar Feb 04 '20 08:02 Speeedy0815

I would also like to take a look at log files if there are any. Whenever I update my flows, deploying just the modified files is insufficient, and requires a full flow restart, which is disruptive for some of my other flows.

I would like to provide or assist with looking at any available logs or details to get to the bottom of this.

I would prefer not to switch modules, as this one has an extremely convenient switch node.

danielnguyen avatar Mar 27 '21 23:03 danielnguyen

I installed this a few days ago, and everything worked really nice except I started noticing the same problem: after a couple of hours.. the command node stops working. Editing the node and modifying the command to another one makes it start working back which makes it unusable for me.. a pitty as mentioned before the switch node is really powerful.

patximlg avatar May 09 '21 23:05 patximlg

Any updates on this? Without this it any actions can't be processed

skynet01 avatar Aug 31 '21 00:08 skynet01

Howdy, sorry for taking so long to check in on this issue. If someone could provide some logs from their node-red server and/or the debug panel, that would be helpful. Also, do all of the nodes show a green "connected" status or does it switch to something else?

I suspect the websocket connection to Telegram gets interrupted at some point and fails to reconnect. It'd be nice to auto-recover from this, but I've not personally experienced this issue so I'll need some extra details on how to address it. :)

scraton avatar Oct 10 '21 15:10 scraton

I'll see what i can find in the logs, all the nodes continue to show green and sending still works it just replies never get processed anymore.

skynet01 avatar Oct 10 '21 21:10 skynet01

Hi, I have the same problem. The bot works fine, but after some time it stops responding. All the nodes show they are connected, sending messages works just fine. The bot just does not respond anymore to any /something messages. I checked my logs, the only error i could find that relates to telegram is this:

Unhandled rejection RequestError: Error: connect ETIMEDOUT 149.154.167.220:443 at new RequestError (/data/node_modules/request-promise-core/lib/errors.js:14:15) at Request.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/request/request.js:185:22) at Request.emit (events.js:400:28) at Request.emit (domain.js:475:12) at Request.onRequestError (/data/node_modules/request/request.js:877:8) at ClientRequest.emit (events.js:400:28) at ClientRequest.emit (domain.js:475:12) at TLSSocket.socketErrorListener (_http_client.js:475:9) at TLSSocket.emit (events.js:400:28) at TLSSocket.emit (domain.js:475:12) at emitErrorNT (internal/streams/destroy.js:106:8) at emitErrorCloseNT (internal/streams/destroy.js:74:3) at processTicksAndRejections (internal/process/task_queues.js:82:21)

pl0ink avatar Dec 05 '21 13:12 pl0ink

The error above does not mention telegram, but the IP is from Telegram.

pl0ink avatar Dec 05 '21 13:12 pl0ink

Is there a way to make the bot automatically reconnect after some specific set interval? Like once an hour? Maybe it can be an option in the config?

I think this could be a good temporary solution to this since this issue bin open for years. I have to restart NODE once a day just to fix this.

skynet01 avatar May 16 '22 21:05 skynet01

I tried digging into this more today, but I'm still not able to reproduce. :(

I misspoke earlier, though. I thought the Telegram connection was done through web sockets, but it is in fact done through HTTP polling. So there should be no need to reconnect anything. If a request fails, the next polling attempt should resume functionality. But clearly that's not happening...

Could there be internet connectivity issues with the server you're running Node-RED on by chance? Unreliable DNS settings for the telegram API?

I released version 0.7.1 which adds more verbosity to error messages and also updates the UI to show when a request/connection fails. Give that a try and let me know if you notice any changes that might help lead to a fix.

scraton avatar Dec 17 '22 17:12 scraton

I'll monitor this error more closely. It usually happens if I use telegrambot-switch node and don't respond to commands. Then if telegrambot-switch is used again and I try to respond to bots prompts, nothing happens (even though sending to telegram from NodeRed still works fine). I don't think this is a connectivity issue as multiple people are reporting this and I don't have any outages. Thank you for looking into this.

 

skynet01 avatar Dec 28 '22 22:12 skynet01