Pairing code login fails to receive message events (401/device_removed even with realistic fingerprint)
Welcome!
- [x] Yes, I have searched for similar issues on GitHub and found none.
What did you do?
Summary
- QR code login works normally: connection opens,
messages.upsertevents fire, and webhooks arrive. - Pairing code (8 digits) connects, but soon drops with
statusCode: 401,device_removed, and no events. - Even after applying a realistic browser fingerprint (
Chrome,Chrome,10.0.22631/ Windows 11), the issue persists.
Context
- Repository:
EvolutionAPI/evolution-api - Environment: Local Docker Compose (
docker-compose.dev.yaml) - Provider: Baileys
- Base version: main branch (commit from 2025-11-11)
- Host OS: Windows 11 + WSL2 (Ubuntu 22.04)
Steps to Reproduce
- Clear
sessions/and volumes (docker-compose down -v). - Start the stack with
docker-compose -f docker-compose.dev.yaml up -d --build. - Create an instance via API:
POST /instance/create. - Request pairing code:
POST /instance/{instanceName}/requestCodewithphonefilled. - Enter the 8-digit code on WhatsApp (Android or iOS).
- Watch the
evolution-apicontainer logs.
Expected Behavior
- Instance remains with
connectionState: OPEN. messages.upsert,chats.upsert, and related events fire.- Webhooks fire according to configuration.
Actual Behavior
- Pairing code appears quickly, but the device fails to link after entering it.
- Logs show:
2025-11-11T10:41:32Z connection.update -> state: open 2025-11-11T10:41:42Z connection.update -> state: close, statusCode: 401, type: device_removed 2025-11-11T10:41:42Z error in validating connection -> Timed Out - No message events are received; webhook remains silent.
- QR code login on the same instance works fine.
Attempts So Far
- ✅ V1: ensure
browserOptionsis always set increateClient, for both QR and pairing flows. - ✅ V2: replace
os.release()with a realistic fingerprint (Windows 11, Chrome) and supportCONFIG_SESSION_PHONE_CLIENT/NAME/OS. - Redeployed with
docker compose build --no-cacheand helper scripts (deploy-v2-fix.ps1,deploy-fix.sh). - Removed old volumes, cleared Baileys cache.
- Tested on two different devices (Android 14, iOS 17).
Notes
- Before V1, pairing code logins didn’t receive events but didn’t drop with
device_removed. - After V1/V2, the code is delivered faster, but the session closes soon after authentication.
- Appears WhatsApp detects a mismatch between pairing and QR flows or rejects the forced fingerprint.
Request
- Looking for guidance on a fingerprint closer to the official behavior or additional parameters needed for pairing.
- Are there known differences in Baileys auth between QR and pairing that we should adjust?
- Is there an upstream patch/flag addressing 8-digit pairing?
Relevant Logs
[DEBUG] waInstance: browser -> Chrome,Chrome,10.0.22631
[INFO ] connection.update -> {"connection":"open"}
[WARN ] connection.update -> {"connection":"close","lastDisconnect":{"error":{"statusCode":401,"data":"Unauthorized","type":"device_removed"}}}
[ERROR] error in validating connection -> Timed Out
What did you expect?
I expected the 8-digit pairing code login to behave exactly like QR code scanning—for example, normal message event notifications and a comparable login success rate.
What did you observe instead of what you expected?
Right now, QR code login works perfectly, but using the 8-digit code yields no messages and no webhook event notifications. Even when I try to fetch messages manually, I don’t receive any new ones
Screenshots/Videos
No response
Which version of the API are you using?
2.3.6
What is your environment?
Windows
Other environment specifications
No response
If applicable, paste the log output
No response
Additional Notes
No response
+1
PT-BR: Aqui está ocorrendo o mesmo tanto com o whatsapp normal quanto o business. Se a conta ja estava sincronizada a mais de 10 dias esta rodando normal, mas se desconectar e tentar conectar novamente o mesmo erro começa a ocorrer.
EN: The same thing is happening here, both with regular WhatsApp and WhatsApp Business. If the account has been synchronized for more than 10 days, it works normally, but if you disconnect and try to connect again, the same error starts to occur.
I still can connect with an iphone but not with android. 2.3.2 and 1.8.6 the same.
+1
Getting a similar error, but with QR Code too. After connecting, the instance will work normally for about 1 and a half minute on average, then disconnect with:
{"level":50,"time":1762974155762,"pid":171274,"hostname":"LAPTOP-EONJ18PO","node":{"tag":"stream:error","attrs":{"code":"401"},"content":[{"tag":"conflict","attrs":{"type":"device_removed"}}]},"msg":"stream errored out"}
[Evolution API] v6.5.1 171274 - Wed Nov 12 2025 16:02:35 WARN [WAMonitoringService] [string] Instance "inbox-3-1762974084" - LOGOUT
I tried connecting with Evolution only (no other devices connected to that phone number) but it still disconnects. Haven't tried on business tho.
+1
+1
Projeto parece sem atencão.... existe alguma alternativa?
Eu acho que é alguma segurança nova do whatsapp.
Tem um workaround mas pro cliente final é complicado fazer isso: Faz a conexão, espera 3 segundos e depois fecha o whatsapp(fecha totalmente)
English: Its probably a security measurer on whatsapp.
Theres a workaround, if you connect the QR wait for 3 seconds then close the whatsapp, the final whatsapp check doesnt work and the instance keeps connected.
Eu acho que é alguma segurança nova do whatsapp.
Tem um workaround mas pro cliente final é complicado fazer isso: Faz a conexão, espera 3 segundos e depois fecha o whatsapp(fecha totalmente)
English: Its probably a security measurer on whatsapp.
Theres a workaround, if you connect the QR wait for 3 seconds then close the whatsapp, the final whatsapp check doesnt work and the instance keeps connected.
Sending messages doesn't work