openclaw - 💡(How to fix) Fix Bug: Gateway WebSocket handshake fails with token_mismatch on Ubuntu Kylin 20.04 [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#74449Fetched 2026-04-30 06:23:53
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
2
Author
Timeline (top)
labeled ×2commented ×1cross-referenced ×1

After a clean install of v2026.4.23 on Ubuntu Kylin 20.04, the Web Control UI cannot establish a WebSocket connection. The gateway logs show token_mismatch and device_token_mismatch errors (code 4008) even after manually approving the device. A direct curl test confirms the server resets the WebSocket handshake. This behavior was not present on v2026.4.11 with the same configuration, indicating a regression.

Root Cause

After a clean install of v2026.4.23 on Ubuntu Kylin 20.04, the Web Control UI cannot establish a WebSocket connection. The gateway logs show token_mismatch and device_token_mismatch errors (code 4008) even after manually approving the device. A direct curl test confirms the server resets the WebSocket handshake. This behavior was not present on v2026.4.11 with the same configuration, indicating a regression.

RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

After a clean install of v2026.4.23 on Ubuntu Kylin 20.04, the Web Control UI cannot establish a WebSocket connection. The gateway logs show token_mismatch and device_token_mismatch errors (code 4008) even after manually approving the device. A direct curl test confirms the server resets the WebSocket handshake. This behavior was not present on v2026.4.11 with the same configuration, indicating a regression.

Steps to reproduce

   1. Clean install [email protected] on Ubuntu Kylin 20.04.

   2. Run openclaw doctor --fix.

  3.  Configure a custom model provider (e.g., zai/glm-4.7-flash) in openclaw.json.

 4.   Start the gateway: systemctl --user start openclaw-gateway.service.

  5.  Get the tokenized URL: openclaw dashboard --no-open.

   6. Open the URL in Firefox or Chromium.

    7.Observe browser connection failure and gateway log errors.

Expected behavior

The browser successfully establishes a WebSocket connection to the gateway and loads the Control UI, as was functional on v2026.4.11 with the same provider configuration.

Actual behavior

    Browser reports "连接失败" (connection failure).

    curl test on 127.0.0.1:18789 returns curl: (56) Recv failure: 连接被对方重设.

    Gateway logs show unauthorized … reason=token_mismatch → closed before connect … code=4008 reason=connect failed.

    Even after device pairing auto-approved and webchat connected, the chat agent times out or delivers no reply.

OpenClaw version

v2026.4.23 (also reproduced on v2026.4.24 and v2026.4.26)

Operating system

OS: Ubuntu Kylin 20.04

Install method

npm global install

Model

Provider: Custom provider zai/glm-4.7-flash from Zhipu AI

Provider / routing chain

Gateway → zai/glm-4.7-flash → https://open.bigmodel.cn/api/paas/v4

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

The most likely fix is to investigate and resolve the token mismatch issue causing the WebSocket connection failure between the Web Control UI and the gateway.

Guidance

  • Verify the token generation and validation process in the custom model provider (zai/glm-4.7-flash) to ensure it matches the expected format and content.
  • Check the gateway logs for any additional error messages or clues that might indicate the root cause of the token mismatch.
  • Compare the configuration and setup of the custom model provider between the working version (v2026.4.11) and the non-working versions (v2026.4.23, v2026.4.24, v2026.4.26) to identify any potential changes or regressions.
  • Test the WebSocket connection using a tool like curl or a WebSocket client to isolate the issue and gather more information about the connection failure.

Example

No code snippet is provided as the issue does not contain sufficient information to create a relevant example.

Notes

The issue seems to be related to a regression introduced in version v2026.4.23, and the custom model provider might be a contributing factor. However, without more information about the provider's configuration and setup, it's challenging to provide a more specific solution.

Recommendation

Apply a workaround by investigating and resolving the token mismatch issue, as it's likely the primary cause of the WebSocket connection failure. This approach allows for a more targeted fix rather than upgrading to a potentially unaffected version.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The browser successfully establishes a WebSocket connection to the gateway and loads the Control UI, as was functional on v2026.4.11 with the same provider configuration.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Bug: Gateway WebSocket handshake fails with token_mismatch on Ubuntu Kylin 20.04 [1 comments, 2 participants]