Skip to content

Discord gateway WebSocket does not route through OpenShell proxy and fails DNS/direct connection #3912

@sandl99

Description

@sandl99

Description

Discord REST calls appear to route through the OpenShell L7 proxy/policy path successfully, but the Discord gateway WebSocket does not become ready.

The original failure was DNS resolution inside the sandbox:
2026-05-20T15:14:57.619+00:00 [discord] gateway error: Error: getaddrinfo EAI_AGAIN gateway.discord.gg
2026-05-20T15:14:57.620+00:00 [discord] gateway error: Error: getaddrinfo EAI_AGAIN gateway.discord.gg

2026-05-20T15:14:57.618+00:00 [discord] client initialized as 1506586841027969204 (NemoAgent); awaiting gateway readiness
**2026-05-20T15:14:57.619+00:00 [discord] gateway error: Error: getaddrinfo EAI_AGAIN gateway.discord.gg
2026-05-20T15:14:57.620+00:00 [discord] gateway error: Error: getaddrinfo EAI_AGAIN gateway.discord.gg**
2026-05-20T15:14:59.455+00:00 [discord] gateway: Gateway websocket closed: 1006
2026-05-20T15:15:12.667+00:00 [discord] gateway was not ready after 15000ms; restarting gateway
2026-05-20T15:15:17.680+00:00 [discord] startup restart waiting on a stale gateway socket for 5000ms; forcing terminate before reconnect
2026-05-20T15:15:18.688+00:00 [discord] [default] channel exited: discord gateway socket did not close within 5000ms before restart

REST traffic to Discord is allowed and visible through sandbox policy logs:

[sandbox] [OCSF ] [ocsf] HTTP:GET [INFO] ALLOWED GET http://discord.com:443/api/users/@me [policy:discord engine:l7]

After configuring Discord proxy support with:

  {
    "channels": {
      "discord": {
        "proxy": "http://10.200.0.1:3128"
      }
    }
  }

  OpenClaw appeared to read the proxy setting, but rejected it:

  2026-05-20T17:02:29.159+00:00 [discord] invalid rest proxy: Error: Proxy URL must target a loopback host
  2026-05-20T17:02:30.030+00:00 [discord] invalid gateway proxy: Error: Proxy URL must target a loopback host
  2026-05-20T17:02:30.035+00:00 [discord] gateway metadata lookup failed transiently; using default gateway url (Failed to get gateway information from Discord: fetch failed | fetch failed)
  2026-05-20T17:02:31.299+00:00 [discord] gateway error: AggregateError @ internalConnectMultiple (node:net:1134:18)

So the current behavior seems to be:

  1. Discord REST requests can reach discord.com through the OpenShell policy/proxy path.
  2. Discord gateway WebSocket startup attempts to use gateway.discord.gg.
  3. Without explicit Discord proxy config, gateway fails with getaddrinfo EAI_AGAIN gateway.discord.gg.
  4. With channels.discord.proxy = "http://10.200.0.1:3128", OpenClaw rejects the proxy because it is not loopback.
  5. Gateway then falls back to direct connection and fails with AggregateError @ internalConnectMultiple.

Expected Behavior

Discord gateway WebSocket traffic should route through the intended OpenShell proxy/policy path, the same way Discord REST traffic does.

The Discord policy already includes gateway websocket routing for gateway.discord.gg / *.discord.gg, so the gateway connection should not require direct DNS/socket access from inside the sandbox.

Reproduction Steps

  1. Start a NemoClaw sandbox with Discord enabled.
  2. Configure Discord credentials.
  3. Observe startup logs.
  4. REST lookup succeeds against discord.com.
  5. Gateway readiness never completes.
  6. Observe either:
    • getaddrinfo EAI_AGAIN gateway.discord.gg, or
    • after adding channels.discord.proxy, Proxy URL must target a loopback host followed by direct connection failure.

Environment

  • NemoClaw sandbox using OpenClaw
  • OpenClaw version observed inside sandbox:
  • Ubuntu/DGX/ NemoClaw 0.0.46

Debug Output

Logs

2026-05-20T15:14:57.618+00:00 [discord] client initialized as 1506586841027969204 (NemoAgent); awaiting gateway readiness
  2026-05-20T15:14:57.619+00:00 [discord] gateway error: Error: getaddrinfo EAI_AGAIN gateway.discord.gg
  2026-05-20T15:14:57.620+00:00 [discord] gateway error: Error: getaddrinfo EAI_AGAIN gateway.discord.gg
  2026-05-20T15:14:59.455+00:00 [discord] gateway: Gateway websocket closed: 1006
  2026-05-20T15:14:59.458+00:00 [discord] gateway: Gateway reconnect scheduled in 3752ms (close, resume=false)
  2026-05-20T15:15:12.667+00:00 [discord] gateway was not ready after 15000ms; restarting gateway
  2026-05-20T15:15:17.680+00:00 [discord] startup restart waiting on a stale gateway socket for 5000ms; forcing terminate before reconnect
  2026-05-20T15:15:18.688+00:00 [discord] [default] channel exited: discord gateway socket did not close within 5000ms before restart

  [sandbox] [OCSF ] [ocsf] HTTP:GET [INFO] ALLOWED GET http://discord.com:443/api/users/@me [policy:discord engine:l7]

Checklist

  • I confirmed this bug is reproducible
  • I searched existing issues and this is not a duplicate

Metadata

Metadata

Assignees

No one assigned

    Labels

    VRDCIssues and PRs submitted by NVIDIA VRDC test team.area: messagingMessaging channels, bridges, manifests, or channel lifecycleneeds: triageAwaiting maintainer classification
    No fields configured for Enhancement.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions