Operations
Runbook
Common incidents and the first three things to check for each.
Skim this once on a quiet day. The first three checks per incident usually localise the problem in under five minutes.
API returns 502 from nginx
docker ps --filter name=infra-api | grep healthy— is the container up and healthy?docker logs --tail 30 infra-api-1— any traceback at startup?curl http://127.0.0.1:8000/healthzfrom the host — bypasses nginx; if this works the problem is in nginx, not the API.
Bot stopped responding
docker logs --tail 30 infra-bot-1— anything since the lastbot.bootlog line?- From inside the container:
docker exec infra-bot-1 sh -c 'curl -sS "https://api.telegram.org/bot${BOT_TOKEN}/getMe"'— does Telegram still recognise the bot? - Check the rate-limit page from Telegram — botpark blocks abuse: if
getMereturns 429, wait.
Postgres auth failure on app startup
- Did you regenerate
.envafter the first boot? Thehelios_approle was created with the original password. Either:- revert the password in
.envto what was used at first boot, or docker compose -f infra/docker-compose.yml down -vto drop the volume and re-init with the new credentials (destroys local data).
- revert the password in
docker logs infra-postgres-1 | tail -20— look forFATAL: password authentication failed.- From inside the postgres container,
\dulists roles — confirmhelios_appexists withLoginattribute.
Payment failure spike
HeliosPaymentFailuresSpike alert in Prometheus.
- Is Telegram Stars itself down?
t.me/durovfor the public status. - Audit log:
GET /v1/owner/audit?event_name_prefix=payment.— what's the error breakdown? helios_payments_total{status="paid"}in Prometheus — flat = funnel broken upstream; with paid steady = checkout-stage failure.
A single bad SKU configuration explains most real-world spikes. Verify
billing.tier_price.pro_stars_month etc. match the Mini App's offer
page.
Userbot pool understaffed
HeliosUserbotPoolUnderstaffed alert.
- Owner panel → Userbots — how many are
activevsquarantined? - Quarantined: read the most-recent
audit_logrow withevent_name="userbot.quarantined"— what was the trigger (AUTH_KEY_UNREGISTERED,USER_DEACTIVATED, etc.)? - Re-import a fresh session via Owner panel → Userbots → Import. The resilience dispatcher hot-swaps active tracks once the new session is healthy.
Mini App initData verification fails
Symptom: every /v1/me call returns 401.
curl https://api.your-domain.tld/v1/public/config— does the API itself respond? If not, this is an API problem, not an auth one.- Open the Mini App → DevTools → Network — the
X-Telegram-Init-Dataheader should be present on every request. - Check the bot's webhook + Mini App URL configuration in
@BotFather—setdomainmust matchMINIAPP_PUBLIC_URL.
TLS expiring within 30 days
certbot renewal already runs nightly via systemd-timer. Verify:
sudo systemctl list-timers | grep certbot
sudo certbot certificates
If Expires within shows a problem:
sudo certbot renew --dry-run
sudo certbot renew
sudo systemctl reload nginx
"Stealth violation" alert
This is a P0. The runtime guard raised StealthViolation for a call
that wasn't on the whitelist.
audit_logrow withevent_name="stealth.violation_attempted"lists the method + caller stack.- Look at the most recent userbot-touching code commit — is there a new RPC that snuck past CI?
- Do not whitelist the method to make the alert go away. Fix the caller. The whitelist is a safety net, not a knob.