question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Log spam on getUpdates when BOT token is wrong / revoked

See original GitHub issue

Hello, with the latest version (4.3.0) i’m experiencing loops caused by wrong tokens on my BOTS. I have a BOT where users can configure their own BOT, so they enter their own token, and if they revoke the token I start getting a huge spam in logs:

INFO: Update listener error for request {"method":"getUpdates"} with response 401 Unauthorized
Jun 13, 2019 8:41:56 PM okhttp3.internal.platform.Platform log
INFO: Update listener error for request {"method":"getUpdates"} with response 401 Unauthorized
Jun 13, 2019 8:41:56 PM okhttp3.internal.platform.Platform log
INFO: Update listener error for request {"method":"getUpdates"} with response 401 Unauthorized
Jun 13, 2019 8:41:57 PM okhttp3.internal.platform.Platform log
INFO: Update listener error for request {"method":"getUpdates"} with response 401 Unauthorized

As you can see I get about 4 per second, so it’s like it’s looping. Is there any way to intercept this and kill the update listener?

Thanks a lot!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
pengradcommented, Jun 19, 2019

Released in 4.3.1 New usage is:

bot.setUpdatesListener(updates -> {
    // process updates
    return UpdatesListener.CONFIRMED_UPDATES_ALL;
}, e -> {
    if (e.response() != null) {
        // god bad response from telegram 
        e.response().errorCode();
        e.response().description();
    } else {
        // probably network error
        e.printStackTrace();
    }
});
0reactions
mircoianesecommented, Jul 7, 2019

No, I’m on 4.3.1. Shall I update?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Help on telegram extension "Error while getting Updates ...
I found the solution. revoke your bot token and create a new, that prevents all old instances from working naturally.
Read more >
Conflict: terminated by other getUpdates request; make sure ...
This happens when 2 different clients send getUpdates method to Telegram servers for one bot token. You should make sure you're not running ......
Read more >
Telegram bot + GoogleSheets: solving some problems
The API currently supports two ways to handle bot updates: getUpdates and setWebhook. getUpdates is a pull mechanism, setWebhook is a push ...
Read more >
A Cable for You, Sir! :: In Focus - Luxriot
It will give them complete control over your bot. If you think the token has been compromised, ask the botfather to revoke the...
Read more >
Telegram bot Go service doesn't deploy - Render community
I can't figured out what wrong with the service. Logs: Conflict: terminated by other getUpdates request; make sure that only one bot ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found