openclaw - 💡(How to fix) Fix [Bug]: Telegram channel fails to initialize after gateway restart - silent failure [1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#62031Fetched 2026-04-08 03:10:03
View on GitHub
Comments
1
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
commented ×1

Error Message

Telegram channel fails to start during gateway startup. No error is logged, but the channel simply never initializes. This happens consistently after gateway restarts.

  • Either work with env references or provide clear error when env var is not accessible

Root Cause

The issue has multiple contributing factors:

  1. Environment Variable Reference Conflict: When botToken is configured as an env reference (e.g., "botToken": {"source": "env", "provider": "default", "id": "TELEGRAM_BOT_TOKEN"}), there's a race condition between:

    • The .env file being loaded
    • The systemd service's hardcoded Environment variables
    • The gateway reading the config
  2. Plugin Loading Race Condition (Related - Issue #56626): External plugin loading (via plugins.load.paths or plugins.installs) can interfere with channel initialization. The Telegram channel silently fails to start when plugins are loaded.

  3. Stale Webhook: After regenerating a bot token, the old token's webhook remains registered. The gateway tries to deleteWebhook with the new token but fails with 401, causing auto-restart loops.

Fix Action

Workaround

  1. Remove plugins from config:

    openclaw config unset plugins
  2. Set botToken directly (not as env reference):

    # Edit openclaw.json directly
    "channels": {
      "telegram": {
        "enabled": true,
        "botToken": "YOUR_NEW_TOKEN_HERE"
      }
    }
  3. Clear stale webhook before starting gateway:

    curl "https://api.telegram.org/bot<NEW_TOKEN>/deleteWebhook"
  4. Restart gateway cleanly:

    systemctl --user stop openclaw-gateway
    systemctl --user start openclaw-gateway

Code Example

openclaw config unset plugins

---

# Edit openclaw.json directly
   "channels": {
     "telegram": {
       "enabled": true,
       "botToken": "YOUR_NEW_TOKEN_HERE"
     }
   }

---

curl "https://api.telegram.org/bot<NEW_TOKEN>/deleteWebhook"

---

systemctl --user stop openclaw-gateway
   systemctl --user start openclaw-gateway
RAW_BUFFERClick to expand / collapse

Bug Report: Telegram channel fails to initialize silently after gateway restart in v2026.3.24+

Bug Summary

Telegram channel fails to start during gateway startup. No error is logged, but the channel simply never initializes. This happens consistently after gateway restarts.

Environment

  • OpenClaw version: 2026.3.24+
  • Platform: Ubuntu (ARM64), Oracle Cloud VM
  • Node: 22.x
  • Gateway mode: systemd user service

Steps to Reproduce

  1. Have a working Telegram configuration with botToken set as an environment variable reference (SecretRef)
  2. Restart the gateway (via systemctl --user restart openclaw-gateway or after config changes)
  3. Observe: Telegram channel never starts - no [telegram] [default] starting provider log appears
  4. openclaw health shows empty channels: {}

Root Cause Analysis

The issue has multiple contributing factors:

  1. Environment Variable Reference Conflict: When botToken is configured as an env reference (e.g., "botToken": {"source": "env", "provider": "default", "id": "TELEGRAM_BOT_TOKEN"}), there's a race condition between:

    • The .env file being loaded
    • The systemd service's hardcoded Environment variables
    • The gateway reading the config
  2. Plugin Loading Race Condition (Related - Issue #56626): External plugin loading (via plugins.load.paths or plugins.installs) can interfere with channel initialization. The Telegram channel silently fails to start when plugins are loaded.

  3. Stale Webhook: After regenerating a bot token, the old token's webhook remains registered. The gateway tries to deleteWebhook with the new token but fails with 401, causing auto-restart loops.

What Works

  • Setting botToken directly as a plaintext string in openclaw.json (not as env reference)
  • Removing all plugin configurations (plugins: {})
  • Manually clearing the webhook via Telegram API before starting the gateway

Workaround

  1. Remove plugins from config:

    openclaw config unset plugins
  2. Set botToken directly (not as env reference):

    # Edit openclaw.json directly
    "channels": {
      "telegram": {
        "enabled": true,
        "botToken": "YOUR_NEW_TOKEN_HERE"
      }
    }
  3. Clear stale webhook before starting gateway:

    curl "https://api.telegram.org/bot<NEW_TOKEN>/deleteWebhook"
  4. Restart gateway cleanly:

    systemctl --user stop openclaw-gateway
    systemctl --user start openclaw-gateway

Expected Behavior

  • Telegram channels should initialize reliably on every gateway restart
  • Either work with env references or provide clear error when env var is not accessible
  • Plugin loading should not interfere with channel initialization

Related Issues

  • #56626 - External plugin loading prevents Telegram channel from initializing
  • #55304 - Telegram channels fail to initialize silently after gateway restart in v2026.3.24
  • #55844 - Channels not initializing on gateway startup (channels: {} in health)

Reported on: 2026-04-06 OpenClaw Version: 2026.3.31

extent analysis

TL;DR

Setting the botToken directly in the openclaw.json configuration file instead of using an environment variable reference may resolve the Telegram channel initialization issue after gateway restarts.

Guidance

  • Verify that the botToken is correctly set and accessible by checking the openclaw.json file and ensuring that the token is valid.
  • Remove any plugin configurations to prevent potential interference with channel initialization using openclaw config unset plugins.
  • Clear any stale webhooks before starting the gateway using curl "https://api.telegram.org/bot<NEW_TOKEN>/deleteWebhook" to prevent auto-restart loops.
  • Restart the gateway cleanly using systemctl --user stop openclaw-gateway followed by systemctl --user start openclaw-gateway to ensure a fresh start.

Example

To set the botToken directly in the openclaw.json file:

"channels": {
  "telegram": {
    "enabled": true,
    "botToken": "YOUR_NEW_TOKEN_HERE"
  }
}

Replace YOUR_NEW_TOKEN_HERE with the actual bot token.

Notes

This solution assumes that the issue is related to the environment variable reference conflict or plugin loading race condition. If the problem persists, further investigation into the gateway's configuration and environment may be necessary.

Recommendation

Apply the workaround by setting the botToken directly in the openclaw.json file and removing plugin configurations, as this approach has been reported to resolve the issue in similar cases.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING