WhiskeySockets / Baileys

Lightweight full-featured typescript/javascript WhatsApp Web API
https://baileys.whiskeysockets.io/
MIT License
3.64k stars 1.23k forks source link

[BUG] error 428 Connection Closed when sending message to group #914

Open luispimenta opened 2 months ago

luispimenta commented 2 months ago

I have a strange case reported here by two users, and the same behavior happens.

A list of around 40 groups, just a few and always the same when trying to send the message via Baileys, is not sent returning the error 428 Connection Closed

["err":{"type":"Error","message":"Connection Closed","stack":"Error: Connection Closed\n at sendRawMessage (/var/app/current/node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:54:19)\n at sendNode (/var/app/current/node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:73:16)\n at query (/var/app/current/node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:137:15)\n at groupQuery (/var/app/current/node_modules/@whiskeysockets/baileys/lib/Socket/groups.js:12:55)\n at Object.groupMetadata (/var/app/current/node_modules/@whiskeysockets/baileys/lib/Socket/groups.js:22:30)\n at jidExists (/var/app/current/dist/wa.js:251:41)\n at send (/var/app/current/dist/controllers/message.js:37:49)\n at Layer.handle [as handle_request] (/var/app/current/node_modules/express/lib/router/layer.js:95:5)\n at next (/var/app/current/node_modules/express/lib/router/route.js:144:13)\n at validate (/var/app/current/dist/middlewares/session-validator.js:7:5)","data":null,"isBoom":true,"isServer":false,"output":{"statusCode":428,"payload":{"statusCode":428,"error":"Precondition Required","message":"Connection Closed"},"headers":{}}},"msg":"An error occured during message send Error: Connection Closed"}](rr: { "type": "Error", "message": "Connection Closed", "stack": Error: Connection Closed at sendRawMessage (/app/node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:54:19) at sendNode (/app/node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:73:16) at /app/node_modules/@whiskeysockets/baileys/lib/Socket/messages-send.js:441:19 at async Object.transaction (/app/node_modules/@whiskeysockets/baileys/lib/Utils/auth-utils.js:136:26) at async relayMessage (/app/node_modules/@whiskeysockets/baileys/lib/Socket/messages-send.js:279:9) at async Object.sendMessage (/app/node_modules/@whiskeysockets/baileys/lib/Socket/messages-send.js:652:17) at async send (/app/dist/controllers/message.js:40:24) "data": null, "isBoom": true, "isServer": false, "output": { "statusCode": 428, "payload": { "statusCode": 428, "error": "Precondition Required", "message": "Connection Closed" }, "headers": {} } })

The interesting fact is that all the functions relating to the group occur correctly, such as changing the group name, description, image, but only the message and exactly always in the same 4 groups that it does not go to. However, manually it works, because after the error sends it via Baileys, the user confirms the same 4 groups that gave an error, and copies the message and pastes it manually and everything goes well.

I don't think it's related to the number of groups because this also happened to another user with less than 10 groups, but always the same 2 where this error occurs and does not send the message.

Has anyone ever experienced this? I have the latest version of Baileys 6.7.5

manojsitapara commented 1 month ago

facing same issue

joweste commented 1 month ago

Me too