Baileys
Baileys copied to clipboard
[BUG] connection closed due to Error: Stream Errored (ack)
The script is working fine, but suddenly it crashes producing the following error
{"level":50,"time":"2022-07-07T15:00:48.661Z","pid":xxxx,"hostname":"xxxx","class":"baileys","node":{"tag":"stream:error","attrs":{},"content":[{"tag":"ack","attrs":{"id":"xxxxxxxxxxxxx"}}]},"msg":"stream errored out"} {"level":30,"time":"2022-07-07T15:00:48.664Z","pid":xxxx,"hostname":"xxxx","class":"baileys","error":{"data":{"tag":"stream:error","attrs":{},"content":[{"tag":"ack","attrs":{"id":"xxxxxxxxxxxxx"}}]},"isBoom":true,"isServer":true,"output":{"statusCode":500,"payload":{"statusCode":500,"error":"Internal Server Error","message":"An internal server error occurred"},"headers":{}}},"trace":"Error: Stream Errored (ack)\n at WebSocket.<anonymous> (.\\src\\Socket\\socket.ts:513:7)\n at WebSocket.emit (node:events:527:28)\n at WebSocket.emit (node:domain:475:12)\n at .\baileys\\src\\Utils\\noise-handler.ts:164:5)\n at WebSocket.onMessageRecieved (.\\baileys\\src\\Socket\\socket.ts:245:9)\n at WebSocket.emit (node:events:527:28)\n at WebSocket.emit (node:domain:475:12)\n at Receiver.receiverOnMessage (.\\baileys\\node_modules\\ws\\lib\\websocket.js:1169:20)\n at Receiver.emit (node:events:527:28)","msg":"connection errored"} connection closed due to Error: Stream Errored (ack) at WebSocket.<anonymous> (.\baileys\src\Socket\socket.ts:513:7) at WebSocket.emit (node:events:527:28) at WebSocket.emit (node:domain:475:12) at .\baileys\src\Socket\socket.ts:273:23 at Object.decodeFrame (.\baileys\src\Utils\noise-handler.ts:164:5) at WebSocket.onMessageRecieved (.\baileys\src\Socket\socket.ts:245:9) at WebSocket.emit (node:events:527:28) at WebSocket.emit (node:domain:475:12) at Receiver.receiverOnMessage (.\baileys\node_modules\ws\lib\websocket.js:1169:20) at Receiver.emit (node:events:527:28) { data: { tag: 'stream:error', attrs: {}, content: [ [Object] ] }, isBoom: true, isServer: true, output: { statusCode: 500, payload: { statusCode: 500, error: 'Internal Server Error', message: 'An internal server error occurred' }, headers: {} } } , reconnecting true
I'm having the same problem
I'm having the same problem
I'm having the same problem
the same here
someone solved it ?
I also experienced this, already using the latest version
I'm having the same problem
i'm experiencing this too i hope someone do maintenance for this, kinda disappointing to see all the issues on this problem goes stale without a real solution
i'm experiencing this too i hope someone do maintenance for this, kinda disappointing to see all the issues on this problem goes stale without a real solution
+1
Up.. I'm using the latest version 4.3.0
Still relevant
This issue is stale because it has been open 6 days with no activity. Remove the stale label or comment or this will be closed in 2 days
Still relevant
Still relevant, same issue
I'm having the same problem
@luispimenta did you solved it?
I'm having the same problem
@luispimenta did you solved it?
@artmerlop no :(
Same Error Here
+1
solved added
sock.ev.on("creds.update", saveCreds);
Where will I add the line?
Where will I add the line?
This is my connection code snippet
async function connectToWhatsApp() {
const { state, saveCreds } = await useMultiFileAuthState("auth_info_baileys");
const sock = makeWASocket({
printQRInTerminal: true,
auth: state,
logger: P({ level: "silent" }),
});
sock.ev.on("creds.update", saveCreds);
sock.ev.on("connection.update", async (update) => {
const { connection, lastDisconnect } = update;
if (connection === "close") {
let shouldReconnect = lastDisconnect.error.output.statusCode !== DisconnectReason.loggedOut;
console.log("connection closed due to ", lastDisconnect.error, ", reconnecting ", shouldReconnect);
if (shouldReconnect) {
shouldReconnect = false;
await connectToWhatsApp();
}
}
});
Where will I add the line?
This is my connection code snippet
async function connectToWhatsApp() { const { state, saveCreds } = await useMultiFileAuthState("auth_info_baileys"); const sock = makeWASocket({ printQRInTerminal: true, auth: state, logger: P({ level: "silent" }), }); sock.ev.on("creds.update", saveCreds); sock.ev.on("connection.update", async (update) => { const { connection, lastDisconnect } = update; if (connection === "close") { let shouldReconnect = lastDisconnect.error.output.statusCode !== DisconnectReason.loggedOut; console.log("connection closed due to ", lastDisconnect.error, ", reconnecting ", shouldReconnect); if (shouldReconnect) { shouldReconnect = false; await connectToWhatsApp(); } } });
Which file will I put this.
Sorry, I'm a beginner.
The session doesn't end (It shows active when I check on my phone) but the chatbot stop responding
@Samcotech-ng I am not sure which file exactly in your case but it has to be in the same file where you are creating socket.
@Samcotech-ng I am not sure which file exactly in your case but it has to be in the same file where you are creating socket.
Okay Thanks
I'll try it Is my issue related to yours?
It just stop replying messages even though it's still connected It doesn't happen on all whatsapps.
@Samcotech-ng I am not sure which file exactly in your case but it has to be in the same file where you are creating socket.
Sorry, I can't find the file. I checked socket.js
This issue is stale because it has been open 6 days with no activity. Remove the stale label or comment or this will be closed in 2 days