Telegram Troubleshooting
Diagnostic procedures for Telegram connection issues, including reconnection handling and rate limit recovery.Quick Diagnostics
Symptom: Bot Not Responding
Diagnostic Steps
Common Causes
| Symptom | Cause | Resolution |
|---|---|---|
| Health OK but no responses | Bot blocked or chat not allowed | Check allowFrom config |
| Connection shows offline | Network issue or token invalid | Verify token, check network |
| Intermittent failures | Rate limiting | Wait and retry |
| ”Conflict” errors | Multiple instances | Stop duplicate gateways |
Symptom: Connection Offline
Check Token Validity
Verify Network Connectivity
Re-link Telegram
Symptom: Rate Limit Errors (HTTP 429)
Rate limiting occurs when too many requests are sent to Telegram API.Identify Rate Limiting
Immediate Recovery
- Wait for cooldown - Telegram rate limits typically last 1-60 seconds
- Do not restart repeatedly - Restarts trigger reconnection floods
Prevent Future Rate Limits
- Avoid sending messages in tight loops
- Use built-in throttling (enabled by default via
@grammyjs/transformer-throttler) - For group messages, ensure proper spacing between sends
Symptom: Conflict Errors
Conflict errors occur when multiple bot instances use the same token.Identify Conflict
Resolution
Symptom: Messages Not Delivered
Bot is connected but messages are not being received or sent.Check Allowlist Configuration
Find Your Chat ID
Check Group Chat Settings
For group chats, verify:Reconnection Procedures
Automatic Reconnection
The gateway automatically reconnects with exponential backoff:- Disconnect detected
- Wait 1 second
- Attempt reconnection
- If fails, wait 2s, 4s, 8s… (max 60s)
- Continue until successful
Manual Reconnection
Full Re-authentication
If automatic reconnection fails repeatedly:Monitoring Telegram Health
Key Metrics
Health Check Script
Alert Integration
Critical Telegram issues trigger alerts via the alerting system:| Error | Severity | Example |
|---|---|---|
| Connection failed | Critical | ”Telegram auth failed” |
| Rate limited | Warning | ”429 Too Many Requests” |
| Reconnection | Info | ”Telegram reconnecting” |
Common Error Messages
| Error | Meaning | Resolution |
|---|---|---|
Unauthorized | Invalid bot token | Get new token from @BotFather |
Conflict: terminated by other getUpdates request | Multiple instances | Stop duplicate instances |
Too Many Requests: retry after N | Rate limited | Wait N seconds |
Bad Request: chat not found | Invalid chat ID | Verify chat ID exists |
Forbidden: bot was blocked by the user | User blocked bot | User must unblock |
ETIMEOUT | Network timeout | Check network connectivity |
Related Documentation
- Telegram Channel - Configuration reference
- Alerting - Alert configuration
- Incident Response - General troubleshooting
- Health Checks - Health endpoint interpretation
