windkh / node-red-contrib-telegrambot

Telegram bot nodes for node-red.
Other
256 stars 116 forks source link

Not recovering from network down: getaddrinfo EAI_AGAIN api.telegram.org #317

Closed ivanvaccari closed 10 months ago

ivanvaccari commented 1 year ago

I'm hosting a nodered instance at my home server (docker image on ubuntu 20.04), which controls various stuff and uses telegram to provide real time notifications and interactions.

My network connection is quite stable, but once a week it drop for some reasons. The downtime duration is mostly some minutes only, but it's enough to break the telegram polling.

The error never recover itself and persist until a manual deploy is executed, and mostly appear as "getaddrinfo EAI_AGAIN api.telegram.org". On web ui, the node displays "polling" forever:

image

See log attached, relevant events: 11 Jun 11:07:12 - connection drops 11 Jun 11:14:34 - connection reappear. Mqtt broker reconnect succesfully.

nr_log.txt

Nodered version: 3.0.2, custom docker build (https://github.com/ivanvaccari/node-red-docker, which is just a fork of official nodered but built with debian instead of alpine, mostly for glibc issues with one node i'm using)

windkh commented 1 year ago

That was reported in the past, too but I was never able to reproduce... I will try with your docker image

ivanvaccari commented 1 year ago

Fyi: the docker image probably is ininfluent, had the same problem with the official one before using the one built by me

windkh commented 1 year ago

The ones that reported that error ran node-red on a raspberry pi. Is your homeserver a similar platform?

ivanvaccari commented 1 year ago

No, i'm using a intel nuc( i3, 8gb RAM, msata ssd), connected via cable to the router.

ivanvaccari commented 1 year ago

Failed again, but this time the origin of the failure might differ: yesterday morning i did some electrical works, and i switched the house power breaker off. The server powered down, and when the power was restored, the server surely powered up before the router can connect to internet. The telegram node apparently does not like this, see attached log: nr_log_18-06-2023.txt

windkh commented 1 year ago

Hi you are at HS Augsburg?I live nearbyVon meinem iPhone gesendetAm 18.06.2023 um 09:15 schrieb Ivan Vaccari @.***>: Failed again, but this time the origin of the failure might differ: yesterday morning i did some electrical works, and i switched the house power breaker off. The server powered down, and when the power was restored, the server surely powered up before the router can connect to internet. The telegram node apparently does not like this, see attached log: nr_log_18-06-2023.txt

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

ivanvaccari commented 1 year ago

Nope.. i live in north italy

windkh commented 1 year ago

Hm strange, when I attempted to download your file that page opened. Never mind.

proton555 commented 1 year ago

The ones that reported that error ran node-red on a raspberry pi. Is your homeserver a similar platform?

That was me i think or someone i know :D I still face that issue sometimes (rarely though) but i came to conclusion that its related to connectivity. Once i shifted to a better uptime connection, i stopped having issues. Once connectivity is lost (especially for long), the node/configuration node needs to be reenabled (or a nodered restart) @windkh can you test a longer connectivity breakdown scenario? like an hr or so?

@ivanvaccari just a wild idea, also try having a https certificate enabled in nodered (if not). May be that helps, otherwise its connectivity (Perhaps also manually test the relation of duration of disconnection with failure)

ivanvaccari commented 1 year ago

@ivanvaccari just a wild idea, also try having a https certificate enabled in nodered (if not). May be that helps, otherwise its connectivity (Perhaps also manually test the relation of duration of disconnection with failure)

mmh.. my nodered intance is not public, i can access it only via lan (or via vpn to my router). I particularly don't like having stuff on public ports, that's why i prefer polling.. Without a public domain https is out of question.

I'll check for dropout duration but i mostly see some minutes a couple of times at week. Most of the times it don't even change the connection ip.

windkh commented 1 year ago

Well the polling calls to the telegram server are long polls with a timeout of ... some 300seconds if I remember correctly. Maybe the downtime must be longer that a longpoll. I can try it out

windkh commented 10 months ago

@ivanvaccari any news?

ivanvaccari commented 10 months ago

Ended up using webhooks, the polling was broken most of the times i needed it.