Baileys
Baileys copied to clipboard
[BUG] Stream errored out
Describe the bug From time to time we receive an error (logged below). Right after this error a device gets disconnected. User is not not doing anything for this disconnect to happen. Moreover the user even has not opened WhatsApp application on the phone for 3 weeks, there was no communication during that time. Only contact updates very rarely. Our service is running 300 hundred users with their connected devices. And almost each day we get 2-3 disconnects with similar behavior.
hostname":"whatsapp-node-7964ff4fcf-stbr9", "level":30, "msg":"connection errored", "pid":1, "trace":"Error: Stream Errored (conflict) at WebSocketClient.<anonymous> (/usr/src/app/backend/node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:501:13) at WebSocketClient.emit (node:events:526:28) at WebSocketClient.emit (node:domain:475:12) at /usr/src/app/backend/node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:236:35 at Object.decodeFrame (/usr/src/app/backend/node_modules/@whiskeysockets/baileys/lib/Utils/noise-handler.js:136:17) at WebSocketClient.onMessageRecieved (/usr/src/app/backend/node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:212:15) at WebSocketClient.emit (node:events:526:28) at WebSocketClient.emit (node:domain:475:12) at WebSocket.<anonymous> (/usr/src/app/backend/node_modules/@whiskeysockets/baileys/lib/Socket/Client/web-socket-client.js:46:100) at WebSocket.emit (node:events:526:28)"}
To Reproduce Steps to reproduce the behavior:
- Created a new connection
- Let it run for 3-4 weeks without bringing down or stopping
- Get a random disconnect not motivated by the end user
Expected behavior It should just run fine
Environment (please complete the following information):
- Is this on a server? Yes. Docker container in Kubernetes orchestration.
- What do your
connectOptions
look like?makeWASocket({ version, logger, printQRInTerminal: false, auth: this.authState.getCreds(), markOnlineOnConnect: false, keepAliveIntervalMs: 30000, connectTimeoutMs: 20000, browser: Browsers.macOS('Desktop'), syncFullHistory: true,
}) - Do you have multiple clients on the same IP? Yes. 200-300
- Are you using a proxy? No
Additional context
same issue for me
[1] {"level":30,"time":"2023-12-22T16:25:42.903Z","pid":31739,"hostname":"nishu-Vostro-15-3568","class":"baileys","trace":"Error: Stream Errored (restart required)\n at WebSocketClient.
@asabadyr I got the same error. For some reason that worked for me: 553
{"level":30,"time":"2024-03-11T09:21:30.700Z","pid":3405,"hostname":"70e32069b6f6","class":"baileys","me":{"id":"918422830108:[email protected]"},"platform":"android","msg":"pairing configured successfully, expect to restart the connection..."}
{"level":50,"time":"2024-03-11T09:21:30.981Z","pid":3405,"hostname":"70e32069b6f6","class":"baileys","node":{"tag":"stream:error","attrs":{"code":"515"}},"msg":"stream errored out"}
{"level":30,"time":"2024-03-11T09:21:30.982Z","pid":3405,"hostname":"70e32069b6f6","class":"baileys","trace":"Error: Stream Errored (restart required)\n at WebSocketClient.
It happens when I scan the qr. I tried looking for solutions but nothing works