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
913 stars 277 forks source link

[BUG][WEBJS] - api/sendImage to Channel issue #507

Open sukhcha-in opened 4 weeks ago

sukhcha-in commented 4 weeks ago

Some of the requests fail when hitting api/sendImage to send image to a whatsapp channel.

Version

{
  "version": "2024.8.3",
  "engine": "WEBJS",
  "tier": "PLUS",
  "browser": "/usr/bin/chromium"
}

Logs

[06:29:16.423] INFO (30): request errored {"reqId":1482,"req":{"id":1482,"method":"POST","url":"/api/sendImage","query":{},"params":{"0":"api/sendImage"}},"res":{"statusCode":500},"responseTime":571}
    err: {
      "type": "Error",
      "message": "Evaluation failed: b",
      "stack":
          Error: Evaluation failed: b
              at ExecutionContext._ExecutionContext_evaluate (/app/node_modules/whatsapp-web.js/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:229:15)
              at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
              at async ExecutionContext.evaluate (/app/node_modules/whatsapp-web.js/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:107:16)
              at async WebjsClient.sendMessage (/app/node_modules/whatsapp-web.js/src/Client.js:952:25)
    }

patron:PLUS

devlikepro commented 4 weeks ago

Hi! Could you try to "/logout" from a session and scan it again? Just had the similar issue wit that and logout/login helped

If it doesn't help - could your provide engine field from GET /api/sessions/{name} response :pray: It has the WA web version we need to check

patron:PRO

devlikepro commented 4 weeks ago

Another thing to try it to switch to chrome-based docker image

devlikeapro/waha-plus:chrome

https://waha.devlike.pro/docs/how-to/engines/#docker-images

basiclly stop and remove old container and run a new one

docker stop waha
docker rm waha
docker run .... devlikeapro/waha-plus:chrome

Kindly use docker run ... with your own parameters https://waha.devlike.pro/docs/how-to/install/

patron:PRO

sukhcha-in commented 3 weeks ago

@devlikepro I've switched to chrome engine and did a logout and login. Will wait and see if the issue still presists. /api/sessions/{name}:

"engine": {
    "engine": "WEBJS",
    "WWebVersion": "2.3000.1015732531",
    "state": "CONNECTED"
  }

/api/version:

{
  "version": "2024.8.3",
  "engine": "WEBJS",
  "tier": "PLUS",
  "browser": "/usr/bin/google-chrome-stable"
}

patron:PLUS

sukhcha-in commented 3 weeks ago

@devlikepro The issue still presists and now I've switched to NOWEB engine. I only need to send messages to my Whatsapp channel. I think NOWEB should be fine in this case.

patron:PLUS

sukhcha-in commented 3 weeks ago

@devlikepro NOWEB is working fine but this issue must be fixed for WEBJS users as well.

patron:PLUS

devlikepro commented 3 weeks ago

@sukhcha-in thank you for the update! Could you give the payload example for your case? May be it's the image itself causes the issue You can send it to waha@devlike.pro if it's smthg private

patron:PRO