WhiskeySockets / Baileys

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

[BUG] Frequent 401 errors - Stream Errored (conflict) #1052

Open leoffx opened 2 months ago

leoffx commented 2 months ago

Describe the bug

I'm getting these errors {"statusCode":401,"error":"Unauthorized","message":"Stream Errored (conflict)"} very constantly nowadays, and I've heard multiple people are also suffering from it.

I'm not using the same auth session twice, and some user reported that this started happening on version 2.3000. It's sometimes happening after sending a message.

Since this error also happens because of auth state, I tried implementing an auth state that did nothing, and I still have this frequently happening. Some numbers seem to have this happening more often than others.

To Reproduce Steps to reproduce the behavior:

  1. Initialize new sessions
  2. Start sending messages on each one of them
  3. The error will sometimes happens for some sessions after sending a few messages (17-20)

Expected behavior This error should not happen.

Environment (please complete the following information):

tbelanda commented 2 months ago

I have got 401 error also. last week was okay

xiaohuwei commented 2 months ago

same problem

saulowilson commented 1 month ago

I'm getting same error. Any toughts or solution?

GustavoBlaze commented 1 month ago

First time trying to use this library and I couldn't even connect, unfortunately :/

bobslavtriev commented 1 month ago

Problem in your code, use it correctly as stated in the documentation.

leoffx commented 1 month ago

@bobslavtriev I'm using the code provided in the example file. Can you show a better example?

saulowilson commented 1 month ago

This bug seems to be related to sending media (images) in base64. Looking at my logs, the instances always crashed whenever I tried to send a payload containing an image. It's probably due to the size of these images converted to base64. I disabled media sending, and so far, none of my instances have crashed.

leoffx commented 1 month ago

@saulowilson for me it's happening even with no images, so your solution doesn't always work