#been trying to fix this gateway problem for the past 2 hours

1 messages ยท Page 1 of 1 (latest)

violet ore
#

Topic: Gateway forces IPv6 on "loopback", but config schema rejects explicit "127.0.0.1"

Context:

OS: Ubuntu 22.04 (Contabo VPS)

Version: OpenClaw 2026.1.29 (Node v24.13.0)

Setup: Local mode via SSH Tunnel

The Issue: My gateway is unreachable because it defaults to binding to IPv6 ([::1]:19000) when set to "loopback".
i dont know what to do anymore please help i am tired

#

@rough hemlock

#

@rough hemlock

#

@rough hemlock

rough hemlockBOT
# violet ore Topic: Gateway forces IPv6 on "loopback", but config schema rejects explicit "12...

Based on my investigation, I found the solution for you! The issue is that when gateway.bind is set to "loopback", the code tries 127.0.0.1 first but may fall back to 0.0.0.0 (which can bind to both IPv4 and IPv6). Here's how to fix it:

Solution: Use bind: "custom" with customBindHost

In your ~/.clawdbot/clawdbot.json:

{
  gateway: {
    bind: "custom",
    customBindHost: "127.0.0.1"
  }
}

This explicitly forces IPv4 loopback.

rough hemlockBOT
#

Why this happens

The GatewayConfig.bind only accepts "auto" | "lan" | "loopback" | "custom" (not raw IP addresses). When you set "loopback":

  1. It tries canBindTo("127.0.0.1") first
  2. If that check fails for any reason, it falls back to 0.0.0.0
  3. 0.0.0.0 can bind to both IPv4 and IPv6, showing as [::]:19000 or [::1]:19000

Alternative: Force IPv4 at the Node.js level

If you want to keep "loopback" but force IPv4, you can also try setting a Node.js DNS preference:

NODE_OPTIONS="--dns-result-order=ipv4first" clawdbot gateway

Or add to your systemd service environment: