Skip to content

[Bug]: Telegram channel fails with 404 - $VARIABLE references in botToken not resolved (v2026.3.2) #34247

Description

@FmBlueSystem

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions