Description
Telegram channel fails to start with repeated 404: Not Found errors on all Bot API methods (deleteWebhook, setMyCommands, deleteMyCommands, sendMessage). The channel enters a retry loop (up to 10/10) and never recovers.
Root Cause
When channels.telegram.botToken is set to a $VARIABLE reference (e.g. $TELEGRAM_BOT_TOKEN), v2026.3.2 does not resolve the variable before passing it to grammY. The literal string $TELEGRAM_BOT_TOKEN is used as the bot token, causing Telegram API to return 404.
Evidence
- Direct
curl calls with the actual token from the same server return 200 OK
- grammY with the actual token works (tested via
node -e)
openclaw doctor reported Telegram: failed (404)
- Variable was correctly defined in
.secrets.json, .env.secrets, and systemd environment
Workaround
Replace the variable reference with the literal token:
openclaw config set channels.telegram.botToken "ACTUAL_TOKEN_HERE"
After this, gateway hot-reloads and openclaw doctor reports Telegram: ok.
Expected Behavior
$VAR references in channels.telegram.botToken should resolve from .secrets.json, .env.secrets, or environment variables before passing to grammY.
Environment
- OpenClaw: 2026.3.2
- Node.js: v22.22.0
- OS: Ubuntu 24.04 LTS
- Gateway: systemd user service
Logs
[gateway/channels/telegram] telegram deleteWebhook failed: Call to 'deleteWebhook' failed! (404: Not Found)
[gateway/channels/telegram] [default] channel exited: Call to 'deleteWebhook' failed! (404: Not Found)
[gateway/channels/telegram] [default] auto-restart attempt 7/10 in 300s
Related
Description
Telegram channel fails to start with repeated
404: Not Founderrors on all Bot API methods (deleteWebhook,setMyCommands,deleteMyCommands,sendMessage). The channel enters a retry loop (up to 10/10) and never recovers.Root Cause
When
channels.telegram.botTokenis set to a$VARIABLEreference (e.g.$TELEGRAM_BOT_TOKEN), v2026.3.2 does not resolve the variable before passing it to grammY. The literal string$TELEGRAM_BOT_TOKENis used as the bot token, causing Telegram API to return 404.Evidence
curlcalls with the actual token from the same server return 200 OKnode -e)openclaw doctorreportedTelegram: failed (404).secrets.json,.env.secrets, and systemd environmentWorkaround
Replace the variable reference with the literal token:
After this, gateway hot-reloads and
openclaw doctorreportsTelegram: ok.Expected Behavior
$VARreferences inchannels.telegram.botTokenshould resolve from.secrets.json,.env.secrets, or environment variables before passing to grammY.Environment
Logs
Related