others-how to solve 'TelegramApiRequestException: Error getting updates' error when starting my telegram bot ?
Problem
When we start a telegram bot, we get this error :
jvm 1 | org.telegram.telegrambots.meta.exceptions.TelegramApiRequestException: Error getting updates
jvm 1 | at org.telegram.telegrambots.meta.api.methods.updates.GetUpdates.deserializeResponse(GetUpdates.java:118) ~[telegrambots-meta-4.4.0.2.jar:na]
jvm 1 | at org.telegram.telegrambots.updatesreceivers.DefaultBotSession$ReaderThread.getUpdatesFromServer(DefaultBotSession.java:263) ~[telegrambots-4.4.0.2.jar:na]
jvm 1 | at org.telegram.telegrambots.updatesreceivers.DefaultBotSession$ReaderThread.run(DefaultBotSession.java:194) ~[telegrambots-4.4.0.2.jar:na]
The core error is :
org.telegram.telegrambots.meta.exceptions.TelegramApiRequestException: Error getting updates
Why do this error happen? The telegram bot is correctly configured, I promise!!!
Environment
- Telegram bot
Reason
I have a production environment and a test environment, the production bot is running when I try to start the test bot.
The keypoint is we can not start the same telegram bot simultaneously.
Solution
We should stop the production bot and then start the test bot.
Run the app again, No error messages ,It works!