Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TelegramApiErrorResponseException: null while GetUpdates Request #1401

Open
bratinghosh opened this issue Jul 11, 2024 · 3 comments
Open

TelegramApiErrorResponseException: null while GetUpdates Request #1401

bratinghosh opened this issue Jul 11, 2024 · 3 comments

Comments

@bratinghosh
Copy link

Describe the bug
I have been noticing TelegramApiErrorResponseException if I leave the long polling bot running for couple of days without any updates.

Surprisingly, if i restart the application, the error goes away. Any idea if this is a persistent issue?

To Reproduce
Starting the long polling bot application and leave it running for couple of days without activity.

Expected behavior
The bot is expected to receive 0 updates without any exception as no new updates are created during that period.

Screenshots
Screenshot 2024-07-08 at 3 18 37 PM
roblem.

@aNNiMON
Copy link
Contributor

aNNiMON commented Jul 11, 2024

The problem on Telegram servers end, or with the network when reaching them. Here's mine logs:

2024-06-14 04:11:24.694 [pool-3-thread-1] ERROR org.telegram.telegrambots.longpolling.BotSession - Error received from Telegram GetUpdates Request, retrying in 647 millis...
2024-06-16 04:11:22.187 [pool-5-thread-1] ERROR org.telegram.telegrambots.longpolling.BotSession - Error received from Telegram GetUpdates Request, retrying in 327 millis...
2024-06-17 02:28:18.716 [pool-7-thread-1] ERROR org.telegram.telegrambots.longpolling.BotSession - Error received from Telegram GetUpdates Request, retrying in 655 millis...
2024-06-17 02:45:52.528 [pool-7-thread-1] ERROR org.telegram.telegrambots.longpolling.BotSession - Error received from Telegram GetUpdates Request, retrying in 463 millis...
2024-06-25 04:10:43.180 [pool-3-thread-1] ERROR org.telegram.telegrambots.longpolling.BotSession - Error received from Telegram GetUpdates Request, retrying in 726 millis...
2024-06-26 04:10:15.938 [pool-7-thread-1] ERROR org.telegram.telegrambots.longpolling.BotSession - Error received from Telegram GetUpdates Request, retrying in 579 millis...
2024-07-01 04:46:14.304 [pool-7-thread-1] ERROR org.telegram.telegrambots.longpolling.BotSession - Error received from Telegram GetUpdates Request, retrying in 694 millis...
2024-07-07 02:08:43.632 [pool-7-thread-1] ERROR org.telegram.telegrambots.longpolling.BotSession - Error received from Telegram GetUpdates Request, retrying in 451 millis...

@bratinghosh
Copy link
Author

I do receive the occasional Exceptions and then resets to usual behaviour. But for the case posted above, it is quite peculiar as it reaches the backoff limit of 90000 millis and any getUpdate after always leads to an Exception. But if backoff limit is not reached, most of the time the retries reset to normal behaviour without exception.

The only way I have managed to reproduce this issue is to keep the bot idle and not give it any updates for several days (1 week to be safe).

@aNNiMON
Copy link
Contributor

aNNiMON commented Jul 11, 2024

@brating actually, I've never reached such timeouts. Sometimes Telegram servers are not available for 2-4 minutes, the maximum is 12830 according to my logs.
I also tried to reproduce with maximum timeout, but after that the updates are received as well.

I guess it's something on your end. Possibly network configuration. Also try to update the library to the latest version and/or enable debug logs for a week and check them later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants