#latest release error - invalid handshake

1 messages ยท Page 1 of 1 (latest)

nimble summit
#

What is this?

13:14:35 [ws] closed before connect conn=7bd6c4ce-341e-460b-bb63-c86d577137f6 remote=127.0.0.1 code=1008 reason=invalid handshake

agile pathBOT
#

That's a WebSocket connection error. Breaking it down:

  • [ws] closed before connect โ€” A WebSocket connection was rejected before it could fully establish
  • code=1008 โ€” WebSocket close code for "Policy Violation"
  • reason=invalid handshake โ€” The initial handshake failed authentication/validation

Common causes:

  1. Missing or incorrect auth token when connecting to the WebSocket
  2. Mismatched protocol version between client and server
  3. 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?

nimble summit
#

it is from webchat window

agile pathBOT
#

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:

  1. URL token โ€” The webchat URL should have ?token=YOUR_GATEWAY_TOKEN (or it's embedded in the config). Is that token current?

  2. 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)

  3. 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?

nimble summit
#

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

agile pathBOT
#

@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.

bitter shard
#

just adding that I updated and I'm getting that too

agile pathBOT
#

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 ๐Ÿ‘€

near rain
#

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?

nimble summit
#

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

near rain
#

I upped security, might just be missing token?

agile pathBOT
# near rain 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:

  1. Token/API key mismatch - Double-check your CLAWDBOT_TOKEN or provider tokens
  2. Port/host change - Security updates might've moved the WebSocket endpoint
  3. Missing/invalid headers - Especially Authorization or X-API-Key
  4. 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?