#latest release error - invalid handshake
1 messages ยท Page 1 of 1 (latest)
That's a WebSocket connection error. Breaking it down:
[ws] closed before connectโ A WebSocket connection was rejected before it could fully establishcode=1008โ WebSocket close code for "Policy Violation"reason=invalid handshakeโ The initial handshake failed authentication/validation
Common causes:
- Missing or incorrect auth token when connecting to the WebSocket
- Mismatched protocol version between client and server
- A stale client trying to reconnect with old credentials
If this is Clawdbot: This usually means something tried to connect to the gateway WebSocket without proper authentication โ could be a browser extension, a script, or an old session trying to reconnect.
Is this showing up repeatedly, or was it a one-off? And what were you doing when it appeared?
it is from webchat window
Ah, webchat โ that narrows it down.
The webchat connects via WebSocket to the gateway and needs the right token to authenticate. "Invalid handshake" means the token didn't match.
Quick checks:
-
URL token โ The webchat URL should have
?token=YOUR_GATEWAY_TOKEN(or it's embedded in the config). Is that token current? -
Gateway restart โ Did you recently restart Clawdbot or change the gateway token? If so, hard-refresh the webchat page (Ctrl+Shift+R / Cmd+Shift+R)
-
Multiple tabs โ Sometimes stale tabs try to reconnect with old auth. Close other webchat tabs.
To verify your token matches:
# Check what token the gateway expects
grep -i "gatewayToken" ~/.config/clawdbot/config.yaml
Then compare that to what's in your webchat URL or config.
Does the webchat work after a hard refresh, or is it consistently failing?
i dont have time today to troubleshoot. Please let @near rain know i am getting handshake errors from Mac webchat client. Could be just me
@near rain heads up โ robok_ is getting "invalid handshake" errors from the Mac webchat client. Could be client-specific or might be a broader issue worth checking. They'll dig in later when they have time.
just adding that I updated and I'm getting that too
ok that's two people now โ @near rain looks like the webchat handshake issue is happening after the latest update, not just a one-off ๐
did you update the mac app?
it needs to be from source after the big protocol change I posted earlier today
or do you run all from the release?
Sorry โMacโ was a misleading modifier- was talking about browser WebChat client, it happens to be on Mac but not the Mac app
I can test again later on
I upped security, might just be missing token?
This error (code=1008 reason=invalid handshake) typically means the WebSocket connection is failing during the initial handshake. Since you mentioned "upped security," here are the most likely causes:
Common culprits:
- Token/API key mismatch - Double-check your
CLAWDBOT_TOKENor provider tokens - Port/host change - Security updates might've moved the WebSocket endpoint
- Missing/invalid headers - Especially
AuthorizationorX-API-Key - Protocol mismatch - Trying to connect via HTTP instead of WS/WSS
Quick things to verify:
- Restart the gateway after config changes:
clawdbot gateway restart - Check your config has correct WebSocket settings
- Ensure any firewall rules weren't accidentally tightened
Can you share:
- Your
clawdbot --version? - Relevant config sections (without secrets)?
- When exactly did you "up security" โ after an update?