Skip to content

Bot silent

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. /health does not tell you whether the bot is alive.
  • Conflict in 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 Конфигурация некорректна or STARTUP отменён.

One of:

  • a guest scans the QR code, presses Start in Telegram, and the bot sends nothing;
  • the bot does not answer /stats from 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”).
  1. The sticker-bot service is stopped, or is crash-looping on a configuration error.
  2. A second instance polls the same bot token (a laptop running python bot\main.py, or another server).
  3. Maintenance mode is on (env, admin or auto).
  4. A second main.py was started by hand on the server; the instance lock stops the systemd unit from starting.
  5. The guest writes in a group chat, or an admin command is sent from an account that is not in ADMIN_USER_IDS.
  6. Telegram is unreachable from the server.
Terminal window
systemctl is-active sticker-bot
systemctl status sticker-bot --no-pager | head -12
journalctl -u sticker-bot -n 60 --no-pager -o cat
curl -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:

Terminal window
# 2: how often the conflict happens
journalctl -u sticker-bot --since -10min --no-pager | grep -c Conflict
# 4: who holds the lock
cat /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

Terminal window
nano /opt/ai-sticker-pack/bot/.env # only if the journal named a setting
systemctl enable --now sticker-bot
systemctl restart sticker-bot

2 — second instance on the same token

  1. Find and stop the other copy: on every laptop that has the token, close the terminal running python bot\main.py.
  2. 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.
  3. 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

Terminal window
ps -eo pid,user,cmd | grep '[m]ain.py' # find the manually started process
kill <pid> # SIGTERM: it stops cleanly
systemctl restart sticker-bot

The 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.

Terminal window
systemctl is-active sticker-bot
journalctl -u sticker-bot -n 20 --no-pager -o cat | grep -E 'STARTUP|Воркер очереди запущен'
journalctl -u sticker-bot --since -2min --no-pager | grep -c Conflict # 0
curl -s localhost:8000/health # "maintenance":null

Then send /stats from an admin account and run one guest pass from the tablet up to the consent screen.

  • 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.py by hand on the server; use systemctl.
  • Add an external check that the bot process is alive; see the recommendation in Monitoring and alerts.

Last verified: 2026-11-13 against ai-sticker-pack@b715418 and ai-stickers-landing@e350ff5.