Skip to content

[BUG] Pairing code is generated successfully but WhatsApp immediately responds with Error 429 #2008

Description

@jorgePulppo

Describe the bug

Pairing code is generated successfully but WhatsApp immediately responds with Error 429
"rate-overlimit" before the user can even enter the code in their phone. The pairing code appears
on screen, but the connection is terminated within 1 second with a rate limit error.

To Reproduce

Steps to reproduce the behavior:

  1. Request pairing code using requestPairingCode(phoneNumber) with E.164 formatted phone number
    (e.g., "5491111111111")
  2. Pairing code is generated and returned successfully (e.g., "TA65-DJMT")
  3. creds.update event fires with registered: true and pairingCode set
  4. Immediately after (~300ms), receive unhandled frame:
    {"tag":"iq","attrs":{"from":"@s.whatsapp.net","type":"error","id":"50098.62089-1"},"content":[{"tag":"error","attrs":{"code":"429","text":"rate-overlimit"}}]}
  5. Connection fails before user can input the pairing code in WhatsApp app

Expected behavior

After pairing code is generated, the connection should remain open waiting for the user to:

  1. Open WhatsApp on their phone
  2. Go to "Linked Devices"
  3. Select "Link with phone number"
  4. Enter the pairing code shown on screen
  5. Complete the authentication successfully

Environment (please complete the following information):

  • Baileys version: 6.7.20 (@whiskeysockets/baileys)
  • Server: Yes, Node.js production server
  • Multiple clients on same IP: Yes, multi-tenant architecture with ~200+ concurrent WhatsApp
    connections per server
  • Proxy: No

connectOptions:
{
version: [2, 3000, 1027934701],
browser: ["Windows", "Chrome", "114.0.5735.198"], // From issue #1382
printQRInTerminal: false,
auth: mongoAuthState,
defaultQueryTimeoutMs: undefined, // From issue #390
keepAliveIntervalMs: 30e3,
qrTimeout: undefined,
markOnlineOnConnect: false,
syncFullHistory: false,
getMessage: async (key) => { /* ... */ }
}

Additional context

Changes applied based on existing issues:

What works:

  • Phone number validation and E.164 formatting
  • Pairing code generation (requestPairingCode() returns successfully)
  • Code is displayed to user
  • creds.update event with pairingCode and registered: true

What fails:

  • WhatsApp server responds with Error 429 "rate-overlimit" immediately after code generation
  • Connection closes before user can input code
  • Subsequent retry attempts also fail with 429 (rate limit persists for ~15-40 minutes)

Logs:
{"level":30,"msg":"[user] Requesting pairing code for 5491111111111"}
{"level":20,"msg":"[user] Event emitted: creds.update"}
{"level":30,"msg":"[user] creds.update received, keys: noiseKey, pairingEphemeralKeyPair,
signedIdentityKey, signedPreKey, registrationId, advSecretKey, processedHistoryMessages,
nextPreKeyId, firstUnuploadedPreKeyId, accountSyncCounter, accountSettings, registered,
pairingCode, lastPropHash, routingInfo, me"}
{"level":30,"msg":"[user] Pairing code obtained: TA65-DJMT"}
{"level":30,"msg":"Successful pairing detected"}
{"level":20,"unhandled":true,"msgId":"50098.62089-1","fromMe":false,"frame":{"tag":"iq","attrs": {"from":"@s.whatsapp.net","type":"error","id":"50098.62089-1"},"content":[{"tag":"error","attrs":{"code":"429","text":"rate-overlimit"}}]},"msg":"communication recv"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions