Baileys icon indicating copy to clipboard operation
Baileys copied to clipboard

[BUG] Stream errored out

Open asabadyr opened this issue 1 year ago • 3 comments

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:

  1. Created a new connection
  2. Let it run for 3-4 weeks without bringing down or stopping
  3. 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

asabadyr avatar Dec 06 '23 11:12 asabadyr

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. (/home/nishu/Desktop/AGARSON CRM/node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:501:13)\n at WebSocketClient.emit (node:events:514:28)\n at /home/nishu/Desktop/AGARSON CRM/node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:236:35\n at Object.decodeFrame (/home/nishu/Desktop/AGARSON CRM/node_modules/@whiskeysockets/baileys/lib/Utils/noise-handler.js:136:17)\n at WebSocketClient.onMessageRecieved (/home/nishu/Desktop/AGARSON CRM/node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:212:15)\n at WebSocketClient.emit (node:events:514:28)\n at WebSocket. (/home/nishu/Desktop/AGARSON CRM/node_modules/@whiskeysockets/baileys/lib/Socket/Client/web-socket-client.js:46:100)\n at WebSocket.emit (node:events:514:28)\n at Receiver.receiverOnMessage (/home/nishu/Desktop/AGARSON CRM/node_modules/ws/lib/websocket.js:1203:20)\n at Receiver.emit (node:events:514:28)","msg":"connection errored"}

ceoagarson avatar Dec 22 '23 16:12 ceoagarson

@asabadyr I got the same error. For some reason that worked for me: 553

jgsn13 avatar Jan 26 '24 20:01 jgsn13

{"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. (/home/runner/Baileys/node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:502:13)\n at WebSocketClient.emit (node:events:514:28)\n at /home/runner/Baileys/node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:236:35\n at Object.decodeFrame (/home/runner/Baileys/node_modules/@whiskeysockets/baileys/lib/Utils/noise-handler.js:136:17)\n at WebSocketClient.onMessageRecieved (/home/runner/Baileys/node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:212:15)\n at WebSocketClient.emit (node:events:514:28)\n at WebSocket. (/home/runner/Baileys/node_modules/@whiskeysockets/baileys/lib/Socket/Client/web-socket-client.js:46:100)\n at WebSocket.emit (node:events:514:28)\n at Receiver.receiverOnMessage (/home/runner/Baileys/node_modules/ws/lib/websocket.js:1209:20)\n at Receiver.emit (node:events:514:28)","msg":"connection errored"}

It happens when I scan the qr. I tried looking for solutions but nothing works

PeaceX100 avatar Mar 11 '24 09:03 PeaceX100