Search code examples
pythonherokutelegram-botpy-telegram-bot-apirender.com

Telegram bot logs Error code 409 even though there is single instance running


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"

Solution

  • 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 :-/