Describe the bug
I’m using Baileys (ESM) on Node.js to connect as a WhatsApp Web companion.
QR pairing succeeds, credentials are saved, connection opens briefly, and then WhatsApp immediately disconnects the device with 401 Unauthorized and conflict: device_removed.
This happens consistently across multiple phone numbers and after fresh auth, browser fingerprint changes, timezone fixes, and single-instance enforcement.
To Reproduce
Steps to reproduce the behavior:
- Install @whiskeysockets/baileys (latest) and Node.js 18+.
- Create a minimal ESM-based Baileys client using makeWASocket() and useMultiFileAuthState().
- Start the process and scan the QR code from WhatsApp mobile (Linked Devices).
- Observe that pairing completes successfully and credentials are saved.
- The connection opens and syncs (pre-keys uploaded, app state synced).
- Within a few seconds, the server closes the connection with:
- status code 401
- stream:error
- conflict: device_removed
- Restarting the socket with the same credentials repeats the behavior.
Expected behavior
After successful QR pairing and initial sync, the WhatsApp Web companion
connection should remain active and usable, allowing messages to be sent
and received without the device being immediately removed.
Environment (please complete the following information):
- Runtime: Node.js 18+
- Library: @whiskeysockets/baileys (latest, ESM)
- OS: Linux (Raspberry Pi)
- Connection type: Direct internet connection (no proxy, no VPN)
- Deployment: Single process, single instance (lock file enforced)
- Time configuration: System timezone set correctly with NTP enabled
- Auth state: Fresh auth folder used for each test
- Browser fingerprint tested:
- ["Linux", "Chrome", "120.x"]
- ["Windows", "Chrome", "114.x"]
- Multiple phone numbers tested with identical results
- No parallel WhatsApp Web sessions running
Additional context
Playwright/Chromium-based WhatsApp Web login remains stable on the same
device and network, suggesting the issue may be specific to Baileys'
companion protocol handling or recent server-side enforcement.
Using WhatsApp Web protocol version: [2, 3000, 1027934701]
Scan QR → pairing configured successfully
connection closed: 515
Error: Stream Errored (restart required)
connected to WA
opened connection to WA
connection closed: 401
data: {
tag: 'stream:error',
attrs: { code: '401' },
content: [
{ tag: 'conflict', attrs: { type: 'device_removed' } }
]
}
Error: Stream Errored (conflict)
Describe the bug
I’m using Baileys (ESM) on Node.js to connect as a WhatsApp Web companion.
QR pairing succeeds, credentials are saved, connection opens briefly, and then WhatsApp immediately disconnects the device with 401 Unauthorized and conflict: device_removed.
This happens consistently across multiple phone numbers and after fresh auth, browser fingerprint changes, timezone fixes, and single-instance enforcement.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
After successful QR pairing and initial sync, the WhatsApp Web companion
connection should remain active and usable, allowing messages to be sent
and received without the device being immediately removed.
Environment (please complete the following information):
Additional context
Playwright/Chromium-based WhatsApp Web login remains stable on the same
device and network, suggesting the issue may be specific to Baileys'
companion protocol handling or recent server-side enforcement.
Using WhatsApp Web protocol version: [2, 3000, 1027934701]
Scan QR → pairing configured successfully
connection closed: 515
Error: Stream Errored (restart required)
connected to WA
opened connection to WA
connection closed: 401
data: {
tag: 'stream:error',
attrs: { code: '401' },
content: [
{ tag: 'conflict', attrs: { type: 'device_removed' } }
]
}
Error: Stream Errored (conflict)