#Error 1006
1 messages · Page 1 of 1 (latest)
I can see the error: "WebSocket closed with code 1006 (no reason given)" in Telegram. This is a WebSocket abnormal closure - the connection dropped without Telegram giving a specific reason.
Common Causes & Fixes
-
Gateway restart - Most common! If the gateway restarted while Telegram connection was active, you'll see this. Just restart the gateway again and it should reconnect.
-
Bot token issues - Try regenerating your Telegram bot token at @BotFather and updating your config.
-
Network/firewall - Check if your server can reach Telegram's API (port 443). Some hosts block outgoing connections.
-
Webhook conflicts - If you have a webhook set AND long polling, they can conflict. Make sure you only use one.
Quick Debug Steps
# Check gateway status
clawdbot gateway status
# If not running, restart it
clawdbot gateway restart
# Check logs for more context
clawdbot gateway logs
Most likely fix: Just restart the gateway (clawdbot gateway restart). The 1006 often happens on transient network blips or gateway updates, and reconnecting usually resolves it.
If it keeps happening repeatedly, check:
- Is your server's IP rate-limited by Telegram?
- Do you have a webhook configured that might be timing out?
Let me know what clawdbot gateway status shows and we can dig deeper! đŠ
I try restart, uninstall, disable firewall, everything but not work. I dont have rate-limit, and it start in the first message
Maybe i went very restrictive in security configurations, but i canât restart from default
That narrows it down! First message failure suggests something more fundamental.
A few questions:
-
Does it fail immediately on ANY message (even
/startor a simple text), or only specific types? -
Bot permissions - Check what your bot can do:
- Does it have privacy mode enabled? (
/setprivacyin BotFather - try disabling it) - Is it admin in the group with proper permissions?
- Does it have privacy mode enabled? (
-
Webhook vs Long Polling - Which are you using? Check your config:
clawdbot config getLook for
telegramsection - do you have awebhookUrlset? -
Test the bot directly - Can you message your bot directly in Telegram? Does that work?
- Token fresh - Is this a newly created token? Some old tokens have compatibility issues.
The "first message only" pattern is odd - it suggests the connection establishes but the message handling fails. Could be:
- Bot was added to group but lacks admin rights
- Privacy settings blocking message delivery
- Webhook returning non-200 before messages process
What's your telegram config look like? đŠ
I'm having the same problem I think. Messaging my Telegram bot does seem to help it
Solved. I fix it changed communication via IPv6 to IPv4, and improve a lot.
Anyway in the new version I havenât the same problem! GL
On a fresh install with the latest package I am no longer having the issue
I just did a fresh instal but still getting it I think modifying the json and few other tweeks is needed
i was close to solving it and had just disconnected no reason error
but been on that for two hours so will take a break and refresh my mind lol
That âDisconnected 1006 (no reason)â is almost always the Control UI WebSocket getting dropped because the gateway threw an error / restarted / or the connection got interrupted. Sending a Telegram message is just what triggers the underlying crash.
To narrow it down quickly, can you paste these (with tokens redacted)?
- Version + status
openclaw --version
openclaw status
openclaw gateway status
openclaw channels status --probe
- Logs at the moment it happens
openclaw logs --follow
Then send a Telegram message again and paste the stack trace / error lines that appear right when the UI disconnects.
- Also: where do you see â1006â exactly?
- in the Dashboard/Control UI (browser tab)?
- or in the gateway logs?
If you also want a quick sanity check on config: paste just your channels.telegram block (JSON5) with botToken removed. Most âtweak the jsonâ situations are actually just a wrong key name or policy mismatch.
Docs refs (same steps as above):
also my issue is for the browser not telegram.. YES exactly my websocket closes before it opens
âDisconnected / 1006 / no reasonâ is the UIâs WebSocket dropping â the real reason is in the gateway logs right before it disconnects (often a crash/restart when the Telegram send triggers some error).
Can you grab one repro with logs?
- Paste these first (theyâre the fastest signal, and
--allredacts secrets):
openclaw --version
openclaw status --all
openclaw gateway status
openclaw channels status --probe
- Then tail logs, reproduce, paste the error block
openclaw logs --follow
While thatâs running: send the Telegram message again â copy the lines immediately before/after the disconnect (stack trace / âFATALâ / âUnhandledâ / âEADDRINUSEâ, etc.).
- If itâs specifically Telegram-related, also run right after the failure:
openclaw channels logs --channel telegram
Also quick check: are you opening the UI from a bookmark? If yes, try launching it via:
openclaw dashboard
(bookmarked URLs can have stale token/URL settings and reconnect weirdly).
Once you paste the log snippet around the disconnect, we can tell if this is (a) Telegram API error, (b) gateway restart loop, (c) config mismatch, or (d) a known version-specific bug.
Got it â if the WebSocket closes before it even opens, thatâs a Control UI â Gateway connectivity/auth problem (not Telegram). The browser tool never gets a chance if the UI canât keep the gateway WS up.
Do this minimal triage (itâll usually reveal the exact cause):
- Is the gateway actually reachable over WS?
openclaw gateway status
openclaw status
Youâre looking for Runtime: running and RPC probe: ok.
If itâs running but probe fails â wrong URL/port/auth, or youâre hitting the wrong gateway instance.
- Open the UI using the âknown-goodâ URL
openclaw dashboard
(helps avoid stale bookmarks / wrong host / wrong token in the UI)
- Tail logs while you refresh the UI
openclaw logs --follow
Then refresh the dashboard once and paste the lines that appear at that moment (common smoking guns: unauthorized, invalid handshake, EADDRINUSE, refusing to bind ⊠without auth, etc.).
- Double-check the UI auth input
In the dashboard go to Control â Overview â Gateway Access and make sure you paste the token into the Gateway Token field (there are usually two auth boxes side-by-side: token + password).
If you paste just the output of openclaw gateway status + the log snippet from the refresh attempt, we can tell you exactly what to change (URL vs token vs bind vs remote/tunnel).
Totally fair â stepping away helps.
When youâre back, quickest way to make progress is to capture one clean repro with evidence:
- Paste this (safe, redacts secrets):
openclaw status --all
openclaw gateway status
openclaw channels status --probe
- Then run:
openclaw logs --follow
Send one Telegram message, wait for the disconnect, and paste the log lines right around the moment it drops (thatâs where the real cause is).