Bot silent
Who is this for
Section titled “Who is this for”The engineer on call when guests scan the QR code and nothing happens in Telegram, or when the bot answers something other than the normal flow.
- Check the service first:
systemctl is-active sticker-bot./healthdoes not tell you whether the bot is alive. Conflictin the journal means a second copy of the bot is polling the same token. Stop the other copy.- A guest who gets
Сейчас идёт техобслуживание…is not facing a silent bot: maintenance mode is on. - The bot ignores guests in group chats by design. Guests must talk to it in a private chat.
- If the service is in a restart loop, the reason is in the journal as
Конфигурация некорректнаorSTARTUP отменён.
Symptom
Section titled “Symptom”One of:
- a guest scans the QR code, presses Start in Telegram, and the bot sends nothing;
- the bot does not answer
/statsfrom an admin; - the bot answers only some messages, or some guests get an unexpected “session closed” message;
- every guest gets
Сейчас идёт техобслуживание, загляни чуть позже 🛠(“maintenance in progress, check back later”).
Likely causes
Section titled “Likely causes”- The
sticker-botservice is stopped, or is crash-looping on a configuration error. - A second instance polls the same bot token (a laptop running
python bot\main.py, or another server). - Maintenance mode is on (
env,adminorauto). - A second
main.pywas started by hand on the server; the instance lock stops the systemd unit from starting. - The guest writes in a group chat, or an admin command is sent from an account that is not in
ADMIN_USER_IDS. - Telegram is unreachable from the server.
Diagnose
Section titled “Diagnose”systemctl is-active sticker-botsystemctl status sticker-bot --no-pager | head -12journalctl -u sticker-bot -n 60 --no-pager -o catcurl -s localhost:8000/health| What you see | Cause |
|---|---|
inactive or failed |
1 — service stopped |
activating (auto-restart) and Конфигурация некорректна: … (“configuration is invalid”) in the journal |
1 — bad or missing value in bot/.env |
STARTUP отменён: main.py уже запущен (PID N, …) (“start cancelled: main.py is already running”) |
4 — instance lock |
TelegramConflictError / Conflict: terminated by other getUpdates request repeating |
2 — second instance on the same token |
TelegramUnauthorizedError / Unauthorized |
The token was revoked or is wrong; see Secrets |
"maintenance":"env", "admin" or "auto" in /health; journal lines MAINTENANCE: ответ user=… |
3 — maintenance mode |
TelegramNetworkError, timeouts |
6 — network or Telegram outage |
Service active, journal quiet, the admin’s /stats works, one guest gets nothing |
5 — group chat or the guest never pressed Start in a private chat |
More checks:
# 2: how often the conflict happensjournalctl -u sticker-bot --since -10min --no-pager | grep -c Conflict
# 4: who holds the lockcat /opt/ai-sticker-pack/bot/data/main.pid; ps -eo pid,user,lstart,cmd | grep '[m]ain.py'
# 6: is Telegram reachable (any HTTP code means yes, 000 means no)curl -s -m 10 -o /dev/null -w '%{http_code}\n' https://api.telegram.org/Notes on cause 5: guest handlers accept private chats only, so in a group the bot stays silent. /stats,
/admin_stats, /pause and /resume work only in a private chat and only for ADMIN_USER_IDS; for everyone else the
bot does not react at all.
1 — service stopped or misconfigured
nano /opt/ai-sticker-pack/bot/.env # only if the journal named a settingsystemctl enable --now sticker-botsystemctl restart sticker-bot2 — second instance on the same token
- Find and stop the other copy: on every laptop that has the token, close the terminal running
python bot\main.py. - If you cannot find it, revoke the token in BotFather and put the new one on the server: Secrets → Bot token. The unknown copy dies with the old token.
systemctl restart sticker-bot.
While two instances run, each update goes to one of them at random, and each instance has its own database. That is why some guests get nothing or a wrong answer.
3 — maintenance mode
Source in /health |
Lift it |
|---|---|
admin |
/resume in a private chat with the bot |
auto |
Top up the AI provider first, then /resume: Billing 402 |
env |
Set MAINTENANCE_MODE=0 in bot/.env, then bash /opt/ai-sticker-pack/deploy/update.sh --yes |
4 — instance lock
ps -eo pid,user,cmd | grep '[m]ain.py' # find the manually started processkill <pid> # SIGTERM: it stops cleanlysystemctl restart sticker-botThe lock is held by the operating system and disappears when the process exits. A leftover main.lock file is
harmless; do not delete files to “unlock”.
5 — group chat or not an admin
Ask the guest to scan the QR code on the tablet again; it opens the private chat with the bot. For admin commands,
check that the account’s numeric id is in ADMIN_USER_IDS and restart the bot after changing it.
6 — Telegram unreachable
The bot reconnects on its own. Check the server’s network (ping -c 3 api.telegram.org), the hosting status page and
Telegram’s status. Generation continues for photos already taken; links are sent when the connection returns, within
the 15 minute delivery deadline.
Verify
Section titled “Verify”systemctl is-active sticker-botjournalctl -u sticker-bot -n 20 --no-pager -o cat | grep -E 'STARTUP|Воркер очереди запущен'journalctl -u sticker-bot --since -2min --no-pager | grep -c Conflict # 0curl -s localhost:8000/health # "maintenance":nullThen send /stats from an admin account and run one guest pass from the tablet up to the consent screen.
Prevent
Section titled “Prevent”- Before every event confirm that no local copy of the bot is running: Event playbook.
- Use a separate bot token for development. Never put the production token into a local
.env. - Never start
main.pyby hand on the server; usesystemctl. - Add an external check that the bot process is alive; see the recommendation in Monitoring and alerts.
Where to go next
Section titled “Where to go next”- Billing 402 — when maintenance mode was switched on automatically.
- Services stopped on a shared droplet — when the service was stopped by someone else.
- Configuration — start-up validation errors.
- Runbooks — back to the symptom table.
Last verified: 2026-11-13 against ai-sticker-pack@b715418 and ai-stickers-landing@e350ff5.