Skip to content

Bug: WhatsApp QR code generated without active WebSocket to WhatsApp servers - login always times out #24947

Description

@lancer-code

Bug Description

After the WhatsApp plugin successfully loads (see #24931), the QR code login flow fails silently. The gateway generates and displays a QR code, but no outbound WebSocket connection to WhatsApp servers is established. Scanning the QR from your phone times out because there is no live connection on the server side to receive the authentication response.

Steps to Reproduce

  1. Fresh install of OpenClaw (v2026.2.23, built from source)
  2. Enable WhatsApp channel and start gateway
  3. Open dashboard → Click "Link Device"
  4. QR code is displayed
  5. Scan QR with phone (WhatsApp → Linked Devices → Link a Device)
  6. Phone shows "Linking..." then times out after ~30 seconds
  7. Gateway logs show no scan event, no connection event, no error — just Cleared WhatsApp Web credentials after ~60s

Evidence

Monitored all outbound TCP connections from the gateway process while triggering the QR login flow:

01:48:47 LOG: device.pair.list  (user clicked Link Device)
01:48:55 LOG: QR received        (QR code displayed in dashboard)
01:48:55 CONN: (empty)           (ZERO outbound connections to WhatsApp)
... 90 seconds of monitoring ...
                                  (still zero outbound connections)
01:50:25 LOG: Cleared WhatsApp Web credentials  (QR expired)

Checked with ss -tnp state established '( dport = :443 or dport = :5222 )' — the gateway has zero outbound connections to WhatsApp servers at any point during the QR flow. Only the local dashboard WebSocket (127.0.0.1:18789) is present.

Expected Behavior

When the QR is generated, the Baileys library should maintain a persistent WebSocket connection to web.whatsapp.com:443. This connection receives the device-linking credentials after the phone scans the QR. Without it, the QR is a dead image.

Network Verification

The server CAN reach WhatsApp servers — this is not a network/firewall issue:

$ curl -sI https://web.whatsapp.com | head -1
HTTP/2 200

$ openssl s_client -connect web.whatsapp.com:443
CONNECTED(00000003)

$ ufw status
Status: inactive

$ nft list chain ip filter OUTPUT
chain OUTPUT { type filter hook output priority filter; policy accept; }

Environment

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions