Conflict: terminated by other getUpdates request — how to fix it
Telegram is telling your bot that another process called getUpdates with the same token and took the connection over. Two copies of the bot are polling at once: stop the other one (usually the copy still running on your computer or an old server), or get a new token from @BotFather, and the error stops.
By Livops team, the people who build and run LivopsUpdated
The full message, as Telegram returns it with error code 409:
Conflict: terminated by other getUpdates request; make sure that only one bot instance is running
This page explains what the conflict means, lists the causes from the most common, shows how to prove the fix before you deploy again, and ends with what Livops does when it sees it.
What does the error mean?
Telegram delivers updates to a bot in one of two ways, and they are mutually exclusive: the bot calls getUpdates (long polling), or Telegram calls the bot’s webhook[1]. With polling, each getUpdates request stays open until something arrives. When a second process calls getUpdates with the same token, Telegram ends the first process’s request with this 409.
Neither process crashes. Most libraries log the error and poll again, so the two copies take turns ending each other’s request. Messages go to whichever copy happens to hold the connection, which is why some messages are answered by the old code, some by the new, and some seem to vanish. Updates wait on Telegram’s server until a bot receives them, but no longer than 24 hours[1].
Causes, most common first
1. The bot is still running on your computer
You ran python bot.py or npm start to try it, then deployed, and the local copy is still polling. Stop it with Ctrl+C in that terminal. If you are not sure which terminal, find it:
ps aux | grep -E "bot.py|node .*bot" | grep -v grep
pkill -f bot.py
docker ps # a bot in a local container: docker stop <id>
2. An old server or another host still runs it
A VPS with a systemd service or pm2, the free tier of a host you tried last month, a second project you made while testing. Stop it where it runs:
sudo systemctl stop mybot && sudo systemctl disable mybot
pm2 delete all
docker compose down
If you no longer have access to that machine, use /token in @BotFather to generate a new token[3]. Put the new token only where the bot should run; the forgotten copy keeps the old one and can no longer poll.
3. Two polling processes inside one deployment
The bot is started by code that runs more than once:
- a web server with several workers (
gunicorn -w 4,uvicorn --workers 4) that starts polling at import, so each worker polls; - Node’s cluster mode or
pm2 start bot.js -i max; - two replicas or instances of the same service;
- a file watcher (
nodemon,watchfiles) that starts a new process before the old one has exited.
Fix it so that exactly one process polls: run the bot as its own process with one instance, and keep the web server’s workers out of it.
4. The new version starts before the old one stops
A platform that keeps the old version running until the new one is up — good for websites — runs two pollers for a moment on every deploy. The conflict appears for that window and stops once the old copy is gone. If it never stops, the old copy was not stopped; treat it as cause 2.
5. A webhook is set: “can’t use getUpdates method while webhook is active”
The related 409 says the bot has a webhook while it is trying to poll. Updates cannot be received with getUpdates while an outgoing webhook is set[1][2]. Remove it, and add drop_pending_updates=true if you want to throw away what queued up meanwhile[1]:
curl "https://api.telegram.org/bot$BOT_TOKEN/deleteWebhook?drop_pending_updates=true"
How to confirm the fix locally
-
Check which mode the token is in.
getWebhookInforeturns an emptyurlwhen the bot usesgetUpdates[1]:curl -s "https://api.telegram.org/bot$BOT_TOKEN/getWebhookInfo" -
Stop every copy you know of, then start exactly one and watch its log for a few minutes while you write to the bot. No new 409 lines means there is no other poller.
-
If the 409 comes back with only one copy running, there is a copy you do not know about. Generate a new token and use it in the one place you control.
Do not test by calling getUpdates by hand while a bot runs: your request takes the connection over, ends the bot’s request with the same 409, and marks the updates it returns as received[1].
On Livops
What Livops does for this error, and nothing more:
- Deploys do not overlap for bots. On every deploy the bot’s old container is stopped before the new one starts, because two pollers on one token conflict. Cause 4 does not happen here.
- The first 30 seconds are watched. After a polling bot starts, the deploy watches it for 30 seconds. If its log shows
terminated by other getUpdates requestorcan't use getUpdates method while webhook is active, the deploy fails right there and its log says why: another copy is running with this token, or a webhook is set. You do not get a green deploy for a bot that answers nobody. - Later conflicts are reported. If the conflict starts while the bot is running and the line keeps repeating, the project page stops showing the bot as working, and you get a notification: a bot is running elsewhere with the same token (Telegram: 409 Conflict); stop it or get a new token.
- The token is yours to change. Put the new token under Variables (often
BOT_TOKEN) and deploy. The assistant can explain the failure and take you to Variables, but it never sees variable values and does not change the token for you. - Webhooks are set by the platform. To use a webhook instead, switch the bot’s Connection to Telegram in the project; Livops tells Telegram the address. Do not call
setWebhookfrom your code.
The deploy errors are explained in The app did not start and the full list is in Deploy errors.
Questions
Does this error crash my bot?
Usually not. aiogram, python-telegram-bot, Telegraf and grammY log the 409 and poll again, so the process stays up while the two copies keep knocking each other off. That is why the bot looks online and answers only some messages, or none.
Will a new token fix it?
Yes, when you cannot find the other copy. Generate a new token with /token in @BotFather, put it only where the bot should run, and the old copy can no longer poll.
Can one token use polling in one place and a webhook in another?
No. getUpdates and webhooks are mutually exclusive: while a webhook is set, getUpdates fails with a different 409, can't use getUpdates method while webhook is active. Call deleteWebhook to go back to polling.
Why do I see it for a few seconds on every deploy?
Your platform starts the new version before it stops the old one, so for a moment two copies poll. It stops on its own once the old one is gone. If it does not stop, the old copy was never stopped.
Does a deploy on Livops cause the conflict?
No. Livops stops the bot's old container before it starts the new one, and then watches the new one for 30 seconds. If it sees this error in that time, the deploy fails and its log says another copy is polling with the same token.
Sources
- Telegram Bot API — Getting updates, getUpdates, setWebhook, deleteWebhook, getWebhookInfo (core.telegram.org). Checked .
- Telegram — Bots FAQ (core.telegram.org). Checked .
- Telegram — Bot features (BotFather) (core.telegram.org). Checked .
Put your project online today
Connect GitHub or drop a folder. No card is asked for.
Deploy your botRelated
- Telegram bot hosting in 2026: the options comparedA Telegram bot needs a process that never stops, or a public HTTPS address for a webhook. On Livops it runs from a GitHub push for 19 credits a month (19,000 so'm). Here is how a VPS, Railway, Render, Fly.io and Vercel compare.
- App not listening on $PORT: why the health check failed after deployThe platform started your app, tried the port it gave it, and nothing answered in time. Almost always the app listens on its own fixed port instead of the PORT variable, listens on localhost (127.0.0.1) instead of 0.0.0.0, or crashed or was still starting when the check gave up. Listen on 0.0.0.0 and the port in PORT, and it passes.
- ModuleNotFoundError: No module named — after a deployPython searched sys.path and could not find the module you import. After a deploy that almost always means the package is not in requirements.txt, is listed under a different name than the one you import, or the start command runs a Python that the packages were not installed into.