LucaTNT/telegram-bot-amazon

Bot freezed / error logs with no time

Closed this issue · 7 comments

Still haven't understant exactly what causes the issue, but on long running my bot seems freezed and the last container logs are

error: [polling_error] {"code":"EFATAL","message":"EFATAL: Error: getaddrinfo EAI_AGAIN api.telegram.org"}
error: [polling_error] {"code":"EFATAL","message":"EFATAL: Error: getaddrinfo EAI_AGAIN api.telegram.org"}
error: [polling_error] {"code":"EFATAL","message":"EFATAL: Error: getaddrinfo EAI_AGAIN api.telegram.org"}
error: [polling_error] {"code":"EFATAL","message":"EFATAL: Error: getaddrinfo EAI_AGAIN api.telegram.org"}
error: [polling_error] {"code":"EFATAL","message":"EFATAL: Error: getaddrinfo EAI_AGAIN api.telegram.org"}
error: [polling_error] {"code":"EFATAL","message":"EFATAL: Error: getaddrinfo EAI_AGAIN api.telegram.org"}

the only way to get it back to work is to restart the container (is still running but just does not reply to messages)... do you know what can be the culprit? can we add the date and time also on these exception?

From what I read online it is due to a DNS failure and it is not related to the bot itself.

Maybe yes, unfortunately without the time prefix in the log i cannot exactly identify when this happens... the main issue is that is not autorestoring... container remains up but not parsing messages received

Try adding the -t flag to your docker logs command, it will add a timestamp.

yep pretty sure these log were due to an internet downtime so maybe should not be related to the freeze...

?? i was asking mainly why it freezes...

This bug keep happening on my end, after a days or weeks of running the bot dies and i must restart the docker container (that is running but bot not replying)...

docker logs, does not show anything useful, so hard to understand whats happening and when

maybe a side effect of this deprecation notice...

...
2022-04-08T13:50:23.706596707Z error: [polling_error] {"code":"EFATAL","message":"EFATAL: Error: getaddrinfo EAI_AGAIN api.telegram.org"}
2022-04-08T17:27:06.409615645Z Fri, 08 Apr 2022 17:27:06 GMT node-telegram-bot-api deprecated Automatic enabling of cancellation of promises is deprecated.
2022-04-08T17:27:06.411017309Z In the future, you will have to enable it yourself.
2022-04-08T17:27:06.416956882Z See https://github.com/yagop/node-telegram-bot-api/issues/319. at node:internal/modules/cjs/loader:1092:14
2022-04-08T17:27:06.459381025Z Missing GROUP_REPLACEMENT_MESSAGE env variable, using the default one

PS. this is how it'ts configured

            - 'TELEGRAM_BOT_TOKEN=20xxxx'
            - AMAZON_TAG=xxxx
            - SHORTEN_LINKS=true
            - BITLY_TOKEN=xxx
            - CHECK_FOR_REDIRECTS=true
            - CHECK_FOR_REDIRECT_CHAINS=true
            - AMAZON_TLD=it

It's not something I can control, it looks like a networking issue.