#gateway closed (1008): pairing required

1 messages Β· Page 1 of 1 (latest)

agile shell
#

Issue : gateway closed (1008): pairing required
Gateway target: ws://127.0.0.1:18789
Source: cli --url
Config: /root/.openclaw/openclaw.json

Port 18789 is already in use.

  • pid 250512 root: openclaw-gateway (127.0.0.1:18789)
  • Gateway already running locally. Stop it (openclaw gateway stop) or use a different port.

What i'm trying to do : approve pairing code from telegram but it's not working due to this error.

celest saffronBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> βœ… Mark Solution

dusky pivotBOT
#

That β€œPort 18789 is already in use” output is separate from the pairing problem β€” it just means you already have an openclaw-gateway running on that port (so starting another one will fail). You can usually ignore that and just talk to the existing gateway.

The real blocker is:

gateway closed (1008): pairing required

That means the thing trying to connect (CLI / dashboard / device) isn’t approved yet.

1) First: don’t start a 2nd gateway

On the box where the gateway runs, check it’s healthy:

openclaw gateway status

If you accidentally started multiple, stop/restart cleanly:

#
openclaw gateway stop
openclaw gateway start

2) Approve the right kind of pairing (Telegram can be 2 different things)

A) You got an 8-char Telegram pairing code (DM access)

Approve it like this:

openclaw pairing list telegram
openclaw pairing approve telegram <CODE>

(That’s the β€œsomeone DM’d the bot and needs approval” flow.)

#

B) You’re pairing a node/device via Telegram (/pair workflow)

That ends up as a device requestId on the gateway:

openclaw devices list
openclaw devices approve <requestId>

3) Common gotcha: run approve commands as the same user as the gateway

Pairing state lives under ~/.openclaw/.... If your gateway is running as root but you approve as a different user (or vice-versa), it’ll look like β€œnothing happens”.

If you paste these, I can tell you exactly what to run next

  • openclaw --version
  • openclaw gateway status
  • and tell me whether you have an 8-char code (DM pairing) or a requestId (device pairing)

Docs: https://docs.openclaw.ai/channels/pairing

agile shell
#

RPC target: ws://127.0.0.1:18789
gateway closed (1008): pairing required
Gateway target: ws://127.0.0.1:18789
Source: cli --url
Config: /root/.openclaw/openclaw.json

Port 18789 is already in use.

  • pid 250512 root: openclaw-gateway (127.0.0.1:18789)
  • Gateway already running locally. Stop it (openclaw gateway stop) or use a different port.
dusky pivotBOT
#

That output is basically two separate things:

  1. β€œPort 18789 is already in use”
    Means the Gateway is already running (pid 250512). That’s fine β€” just don’t try to start a second gateway on the same port.

  2. gateway closed (1008): pairing required
    This is the real blocker: your CLI/device is not paired/approved with the gateway yet (device-pairing), so it can’t make the RPC call to approve your Telegram pairing.

What to do (run on the gateway host, as the same user the gateway runs under β€” looks like root, so probably with sudo):

openclaw --version
openclaw gateway status
openclaw devices list
openclaw devices approve <requestId>
#

Then retry your Telegram DM pairing approval:

openclaw pairing list telegram
openclaw pairing approve telegram <CODE>

Important gotcha: if you’re using --url ws://127.0.0.1:18789, the CLI does NOT auto-apply credentials from config/env β€” you must pass auth explicitly (--token or --password). So either:

  • don’t use --url when running locally, or
  • use --url and --token (don’t paste tokens into Discord)

Docs: https://docs.openclaw.ai/web/control-ui (1008 pairing required) and https://docs.openclaw.ai/channels/pairing

If you paste the output of openclaw gateway status + openclaw devices list (redact tokens), I can tell you exactly which requestId you need to approve.

agile shell
#

Request β”‚ Device β”‚ Role β”‚ IP β”‚ Age β”‚ Flags β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ d686d922-d7a4-44e4-8fff-6c75765e0f30 β”‚ e9338d5aeae2d5b391954e70ba0bdb138fe68057755a9bb847794726535878df β”‚ operator β”‚ β”‚ just now β”‚

dusky pivotBOT
#

Perfect β€” that table means you do have a pending device pairing request, and that’s exactly what’s causing the 1008): pairing required.

Approve this requestId (run as the same user as the gateway; in your case looks like root):

openclaw devices approve d686d922-d7a4-44e4-8fff-6c75765e0f30

Then retry whatever command was failing with 1008 (your cli --url ... call).

After the CLI can connect, you can do the Telegram DM approval:

openclaw pairing list telegram
openclaw pairing approve telegram <8-CHAR-CODE>