devlikeapro / waha

WAHA - WhatsApp HTTP API (REST API) that you can configure in a click! Two engines: chromium-based WEBJS and pure-websocket NOWEB
https://waha.devlike.pro/
Apache License 2.0
987 stars 301 forks source link

[BUG][NOWEB] - Error 500 when sending status to many contacts #390

Open oteGroupMoishy opened 4 months ago

oteGroupMoishy commented 4 months ago

Version

{
  "version": "2024.6.6",
  "engine": "NOWEB",
  "tier": "PLUS",
  "browser": "/usr/bin/chromium"
}

Expected behavior

When using endpoints to send status "/api/{session}/status/{type}", and sending to all contacts of the number, the response returned looks like this:

{
  "statusCode": 500,
  "timestamp": "2024-06-18T10:25:41.692Z",
  "exception": {
    "stack": "Error: write EPIPE\n at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16)",
    "message": "write EPIPE",
    "errno": -32,
    "code": "EPIPE",
    "syscall": "write",
    "name": "Error"
  },
  "request": {
    "path": "/api/session_s894m/status/image",
    "method": "POST",
    "body": {
      "contacts": [<<full list>>],
      "file": {
        "mimetype": "image/jpeg",
        "filename": "filename.jpeg",
        "data": "/9j/4AAQSkZJRgABAQAAAQABAAD/4gIoSUNDX1BST0ZJTEUAAQEAAAIYAAAAAAQwAABtbnRyUkdCIFhZWiAAAAAAAAAAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAAHRyWFlaAAABZAAAABRnWFlaAAABeAAAABRiWFlaAAABjAAAABRyVFJDAAABoAAAAChnVFJDAAABoAAAAChiVFJDAAABoAAAACh3dHB0AAAByAAAABRjcHJ0AAAB3AAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAFgAAAAcAHMAUgBHAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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h8hTRAShOkAJHoK63QP7jdbjdXW3btNcmOtNhptTgAKUDska8hs1zbLncLRORNs05+DMQOkOtHun/KodiPkaZbo3QTt/wAvyXI2UsX68vSoySFewSlLbaiOxUEgb/GobqpPdG6BTqoqyYFh9xy28x48aO6IQWDIklJCG0b5581EcACig//Z"
      }
    }
  }
}

Engine I use the NOWEB engine.

devlikepro commented 4 months ago

Hi! The fix on the way, it'll handle 80K contacts in seconds

patron:PRO

devlikepro commented 4 months ago

Hi! Try 2024.6.7, we've added some optimizations here

sending to all contacts of the number

How many contacts are we talking about here btw?

Please make sure it's real contacts, because even /contacts response adds many groups with @g.us and anonymous users .@lid

patron:PRO

oteGroupMoishy commented 4 months ago

Thank you very much, I will try it

This is about 60K contacts

Please make sure it's real contacts, because even /contacts response adds many groups with @g.us and anonymous users .@lid

At first I did think that this was what was causing him problems, and I also filtered the numbers that are not connected in WhatsApp

oteGroupMoishy commented 4 months ago

Hi I tried sending, and it still returns an error

image

devlikepro commented 4 months ago

Well, now it's the different error :D Could you share the payload with me in discord direct messages? devlikeapro. Looks like some issues there

patron:PRO

devlikepro commented 4 days ago

Hi! JFYI - starting 2024.11.1 version you can send status (aka stories) via WEBJS engine as well, it doesn't have the 3K contacts issues :crossed_fingers: https://waha.devlike.pro/docs/how-to/status/#features

It doesn't require contacts, it'll send status to all contacts for now

POST /api/{session}/status/image
{
  "file": {
    "mimetype": "image/jpeg",
    "url": "https://github.com/devlikeapro/waha/raw/core/examples/dev.likeapro.jpg"
  },
  "caption": "string"
}

We're working on proper solution for NOWEB as well, no ETA yet tho :(

patron:PRO