It is impossible to deploy the bot ("make sure that only one bot instance is running")

Hi everyone!
I have a bot written in Ruby using the telegram-bot-ruby gem. It is successfully running locally using bundle exec ruby my_file_name.rb, the bot successfully accepts commands and responds to them. Sidekiq background worker is also connected to the bot to send some reminders, which also works well. After that, I tried to deploy the bot to Render, at the first stage without background workers. When I deploy the bot to Render, the deployment breaks down and gives an error Telegram API has returned the error. (ok: "false", error_code: "409", description: "Conflict: terminated by other getUpdates request; make sure that only one bot instance is running") (Telegram::Bot::Exceptions::ResponseError)
Naturally, the first thing I did was check if my bot was running locally at the same time. I killed all processes related to the bot, including Sidekiq and Redis. I also recreated the web service on Render to exclude the possibility of pulling up some cache. But unfortunately the error has not disappeared.
If I run it locally again, everything works perfectly
Does anyone have any thoughts or advice on this?
I will be grateful for any help

Hey there,
It’s difficult to provide any assistance as I can’t locate the Render account for you here.

There’s a possibility during the deploy of a service that 2 instances are running for a period of time whilst we perform checks on the deployment as part of our zero down time deploys. We hear this ALL the time from folks deploying bots to us as the services they’re interacting with typically only allow one instance.

It’s not clear here whether you are deploying as a webservice or a background worker here either.

John B

Hey, thanks for the answer!
I deploy the bot as a web service, not as a worker
I created a Render account using the same github profile with which I signed up for community.render.com
I can also specify the mail to which the account on render is linked, if it helps

A feature of Render and webservices is zero down time deploys (https://render.com/docs/deploys#zero-downtime-deploys) as you want to always have a web service available.

Bots are much better deployed as a background worker.

John B

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.