OpenClaw Telegram: 2,000+ EADDRINUSE Errors in Your Logs — And Your Bot is Working Fine
Your OpenClaw gateway is running. Your Telegram bot responds to messages perfectly. But your logs look like this — every 30 minutes:
[telegram:default] health-monitor: restarting (reason: stuck)
[default] starting provider (@your_bot)
canvas host mounted at http://0.0.0.0:18789
Gateway is binding to a non-loopback address
Gateway failed to start: another gateway instance is already listening on ws://0.0.0.0:18789
Port 18789 is already in use.
- pid 1234 openclaw: openclaw-gateway (*:18789)
~67 lines of errors per cycle, repeating indefinitely. One user reported 2,204 EADDRINUSE errors in 27 hours across 33 restart cycles — while their bot worked perfectly the entire time.
What's Happening
OpenClaw's channel health-monitor watches for "stuck" channels. Its logic: if no events have arrived in 30 minutes, the channel must be unhealthy — restart it.
This makes sense for WebSocket-based channels like Slack, where a stale socket genuinely means something broke. For Telegram's long-polling, it doesn't — quiet periods with no incoming messages are completely normal. Nobody messaged you. That's not a bug.
When the health-monitor triggers a restart anyway, the Telegram channel restart path attempts to rebind the main WebSocket port (18789). That port is already owned by the running gateway — so you get EADDRINUSE. The channel never actually restarts. The loop repeats.
This is the same class of bug that affected MS Teams channels in issues #22169, #24522, and #25527 — fixed for Teams, but the same path exists in the Telegram restart code.
The Impact
- Functional: Zero. Your bot works fine throughout.
- Operational: Logs become useless noise. Monitoring alerts fire constantly. Hard to spot real errors.
- Performance: Minor CPU overhead from repeated failed bind attempts.
Workarounds (Until Patched)
Option 1: Increase the stale event threshold
Raise the health-monitor's "stuck" threshold so it doesn't trigger during normal quiet periods. Add to your openclaw.json:
{
"gateway": {
"health": {
"staleEventThresholdMs": 7200000
}
}
}
This sets it to 2 hours. For a personal bot with infrequent messages, you might go even higher (4–8 hours).
Option 2: Disable health-monitor for Telegram only
If your Telegram channel is stable and you don't want the overhead:
{
"channels": {
"discord": {
"health": { "enabled": false }
}
}
}
Replace "discord" with your channel key (e.g. "telegram"). Check your config for the exact key name.
Option 3: Disable health-monitor globally
{
"gateway": {
"health": {
"enabled": false
}
}
}
Trade-off: you lose automatic recovery if a channel genuinely gets stuck. Acceptable for stable single-channel setups.
Option 4: Filter logs while waiting for the patch
openclaw gateway logs | grep -v "EADDRINUSE\|already in use\|health-monitor: restarting"
Not a fix, but makes logs readable in the meantime.
Root Cause (Technical)
In channel-health-monitor.ts (~line 1595), isChannelHealthy() uses a single stale-event threshold for all channel types. Long-polling channels (Telegram) should be excluded from the "no events = unhealthy" check, or the threshold should be channel-type-aware. The fix is tracked in issue #68153.
Is Your Bot Actually Broken?
Quick check:
openclaw gateway status
If it shows running and your bot responds to test messages, the errors are cosmetic. You're hitting this bug, not a real outage.
Summary
| Symptom | 2000+ EADDRINUSE errors in logs, every 30 min |
|---|---|
| Cause | Health-monitor treats Telegram quiet periods as stuck |
| Bot affected? | No — fully functional throughout |
| Best fix | Raise staleEventThresholdMs to 2–8 hours |
| Tracked in | Issue #68153 |
Need help configuring OpenClaw for Telegram or diagnosing gateway issues? ClawReady offers setup and audit services — we'll get your config clean and your logs quiet.