4

I have deployed my Telegram bot on Heroku written in Python (PyTelegramBotAPI) before and it was working without any issue. Today I tried to migrate it to Render.com. I stopped my Dyno and deployed it on Render and it logs below error. I tried deleting the Dyno completely and render still logs the same error. Finally I tried revoking the bot key but the issue is still the same. I'm certain I don't run any extra instance of the bot. The weird part is the bot still responds for a little time after all the instances are stopped or deleted. Finally I deployed it again on Heroku and it's working just fine. How can I fix that?

Botcode

Error:

(__init__.py:688 MainThread) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. Error code: 409. Description: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running"

1 Answer 1

3

Running into the same issue here. Looks like an incarnation of Heroku's "preboot" feature, more details here: https://community.render.com/t/having-2-instances-after-deploy/3640.

TL;DR: It's impossible to disable it on render.com :-/

4
  • So the only option here is to go back to Heroku right?
    – pasindu
    Mar 19, 2022 at 5:28
  • I believe it should be possible to implement via distributed locking (redis.io/topics/distlock) but it's your call about whether it's worth the effort. Mar 20, 2022 at 13:06
  • I just ignore the error, and It goes away after 10 seconds. Though it is not an optimized solution, I want to keep all of my apps in 1 place.
    – Peter
    Oct 25, 2022 at 11:31
  • I'd argue that ignoring a problem is not a solution... Oct 26, 2022 at 12:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.