Skip to content

[Bug]: Telegram polling enters silent crash loop after transient network timeout — health monitor cannot recover #93375

Description

@Yachiyo1680

Describe the bug

After a transient network timeout connecting to api.telegram.org, the Telegram polling worker exits silently (exit code not logged, no error output). The health monitor detects it as "stopped" and keeps restarting every ~10-15 minutes, but each new polling process starts and exits immediately without producing any error log or consuming updates. The only recovery is a full gateway restart (systemctl restart openclaw-gateway.service).

The network itself was fine during the crash loop — subsequent curl and ping to api.telegram.org returned 200 and 0% packet loss.

Logs

Initial failure (19:51-19:52)

[Jun 15 19:51:37] [telegram] transport attempt marked temporarily unhealthy for 40000ms (codes=UND_ERR_CONNECT_TIMEOUT)
[Jun 15 19:52:07] [telegram] [default] channel exited: telegram transport attempt temporarily unhealthy; retry after 9972ms | Telegram ingress worker exited with code 1
[Jun 15 19:52:07] [telegram] [default] auto-restart attempt 1/10 in 5s
[Jun 15 19:52:28] [fetch-timeout] fetch timeout after 3509ms (elapsed 3509ms) operation=fetchWithTimeout url=https://api.telegram.org/botxxx/getMe
[Jun 15 19:52:28] [telegram] [default] starting provider
[Jun 15 19:52:29] [telegram] deleteWebhook failed: Network request for 'deleteWebhook' failed!
[Jun 15 19:52:29] [telegram] deleteWebhook failed with a recoverable network error; continuing to polling so getUpdates can confirm webhook state

Crash loop begins (19:57 onwards)

[Jun 15 19:57:03] [health-monitor] [telegram:default] health-monitor: restarting (reason: disconnected)
[Jun 15 19:57:08] [telegram] [default] released stopped Telegram polling lease
[Jun 15 19:57:56] [telegram] [diag] isolated polling ingress started spool=...
[Jun 15 20:12:03] [health-monitor] [telegram:default] health-monitor: restarting (reason: stopped)
[Jun 15 20:22:03] [health-monitor] [telegram:default] health-monitor: restarting (reason: stopped)
[Jun 15 20:37:03] [health-monitor] [telegram:default] health-monitor: restarting (reason: stopped)
... (continues every 10-15 minutes until midnight)

After gateway restart (fixed)

[Jun 16 00:51:49] [telegram] [default] starting provider (@yachiyo1680_bot)
[Jun 16 00:51:50] [telegram] [diag] isolated polling ingress started spool=...
[Jun 16 00:51:50] [telegram] Inbound message telegram:xxx -> @yachiyo1680_bot (direct, 26 chars)

Expected behavior

  1. The Telegram polling worker should recover from transient network failures (e.g., exponential backoff with reconnection)
  2. If recovery fails, the crash/exit should be logged with a clear error
  3. The health monitor restart should actually resolve the issue, OR the system should escalate (e.g., auto-graceful-restart after N consecutive failures)
  4. At minimum, a polling failure should produce an error message visible to the user so they know their bot is down

Actual behavior

  • Polling process exits silently with no error output
  • Health monitor restarts every ~10-15 minutes but the new process immediately exits again
  • No error is surfaced to the user via any channel
  • Only a full gateway restart resolves the state

Environment

  • OpenClaw version: 2026.6.1
  • Platform: Raspberry Pi 4B (arm64, Linux 6.12.75+rpt-rpi-2712)
  • Node: v22.22.2
  • Gateway: local, systemd user service
  • Telegram provider: polling mode (no webhook URL configured; webhook URL empty in getWebhookInfo response)
  • Network: Behind NAT, standard home broadband (China)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions