Errors / Gateway Connect Failed

Fix: Gateway Connect Failed

Error: "gateway connect failed"

What It Means

The CLI or client tried to connect to the gateway, but the gateway said "no." Unlike ECONNREFUSED (where nothing is listening), this means the gateway IS running but is rejecting the connection — usually due to authentication or configuration issues.

Common Causes

  • Gateway auth token doesn't match what the client is sending
  • Gateway is still starting up
  • Wrong bind address (localhost vs IP)
  • TLS/SSL mismatch when using HTTPS

Ask Your Agent to Fix This

Copy this prompt and send it to your OpenClaw agent:

Check the gateway status and authentication config. Make sure the gateway is running, then verify that the auth token in my config is correct. If there's a mismatch, fix it and restart the gateway.

How to Fix It

1. Start the Gateway

openclaw gateway start

2. Check Gateway Status

openclaw gateway status

3. Check Authentication Token

Make sure your gateway.auth.token matches your config:

{ "gateway": { "auth": { "token": "your-token-here" } } }

4. Run Diagnostics

openclaw doctor

How to Prevent This

  • Set auth token once and reuse it consistently
  • Run openclaw security audit after config changes
  • Use openclaw gateway start instead of running manually

Related Errors

Related Guides

Still having trouble?

Ask on Discord