Baileys icon indicating copy to clipboard operation
Baileys copied to clipboard

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

Open jorgePulppo opened this issue 2 months ago • 2 comments

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:

  • Set defaultQueryTimeoutMs: undefined (Issue #390 - pairing code timeout in cloud)
  • Set browser: ["Windows", "Chrome", "114.0.5735.198"] (Issue #1382 - Error 428 fix)
  • Added check for !sock.authState.creds.registered before calling requestPairingCode() per official documentation

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"}

jorgePulppo avatar Nov 01 '25 21:11 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"}

Try with

import { Browsers } from "baileys";

const { version } = await fetchLatestWaWebVersion();

  const socket = makeWASocket({
    logger: pino({ level: "silent" }),
    browser: Browsers.windows("chroe"),
    auth: state,
    version
  })

This is my config try with thse settinga add you config if you any others

Riders004 avatar Nov 02 '25 15:11 Riders004

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"}

Try with

import { Browsers } from "baileys";

const { version } = await fetchLatestWaWebVersion();

  const socket = makeWASocket({
    logger: pino({ level: "silent" }),
    browser: Browsers.windows("Chrome"),
    auth: state,
    version
  })

This is my config try with thse settinga add you config if you any others

Riders004 avatar Nov 02 '25 15:11 Riders004

I solved migrating to 6.7.21. Now waiting for 7.0.0 (not rc)

lauriolasw avatar Nov 15 '25 07:11 lauriolasw