openclaw - 💡(How to fix) Fix Dashboard: 'pairing required' on fresh install — token not passed through WebSocket connect [1 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#56201Fetched 2026-04-08 01:43:39
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
closed ×1locked ×1

Error Message

Multiple connection attempts all fail identically — cause: pairing-required, reason: not-paired. The requestId stays constant across retries suggesting the UI reuses the same request.

Code Example

warn gateway/ws {"cause":"pairing-required","handshake":"failed",..."reason":"not-paired"} closed before connect
RAW_BUFFERClick to expand / collapse

Environment

  • OpenClaw 2026.3.24 (cff6dc9), clean install via npm
  • macOS, Chrome 147
  • gateway.mode: local, gateway.bind: loopback

Steps to Reproduce

  1. Fresh install: npm install -g openclaw@latest
  2. openclaw gateway restart
  3. openclaw dashboard
  4. Browser opens http://127.0.0.1:18789/#token=<valid-token>

Expected

Dashboard connects and shows the control UI.

Actual

Dashboard shows 'pairing required'. Gateway logs show repeated WebSocket handshake failures:

warn gateway/ws {"cause":"pairing-required","handshake":"failed",..."reason":"not-paired"} closed before connect

The #token= from the URL fragment is not being sent in the WebSocket connect frame. The gateway receives a deviceId but no token, so it rejects as unpaired.

The /health endpoint works fine with the same token via Authorization: Bearer.

Logs

Multiple connection attempts all fail identically — cause: pairing-required, reason: not-paired. The requestId stays constant across retries suggesting the UI reuses the same request.

extent analysis

Fix Plan

The issue is caused by the missing token in the WebSocket connect frame. To fix this, we need to modify the client-side code to include the token in the WebSocket connection.

Code Changes

We need to modify the WebSocket connection establishment code to include the token from the URL fragment. Here's an example:

// Get the token from the URL fragment
const urlParams = new URLSearchParams(window.location.hash.slice(1));
const token = urlParams.get('token');

// Establish the WebSocket connection with the token
const ws = new WebSocket(`ws://127.0.0.1:18789/?token=${token}`);

Alternatively, you can use the Authorization header to pass the token:

// Get the token from the URL fragment
const urlParams = new URLSearchParams(window.location.hash.slice(1));
const token = urlParams.get('token');

// Establish the WebSocket connection with the token in the Authorization header
const ws = new WebSocket(`ws://127.0.0.1:18789/`);
ws.headers = {
  'Authorization': `Bearer ${token}`
};

Verification

To verify the fix, restart the gateway and dashboard, and check the gateway logs for successful WebSocket connections. The dashboard should now connect and show the control UI without requiring pairing.

Extra Tips

  • Make sure to handle token expiration and renewal properly to avoid connection issues.
  • Consider using a more secure method to pass the token, such as using a secure cookie or a token exchange mechanism.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING