waha icon indicating copy to clipboard operation
waha copied to clipboard

[BUG][WEBJS] - Send Status error

Open gabrielaltea opened this issue 1 year ago • 2 comments

Describe the bug

WEBJS Bug: I can't update the 'Status' of an account, I've tried using 'url' and also 'data:base64' from my PHP script (I can use all the other API messages functions without problems) and I can't from Swagger either. Be it with your own image as with the example that Swagger has.

Version

2024-11-11

Response from API

"{ "statusCode": 500, "timestamp": "2024-12-03T08:41:05.539Z", "exception": { "stack": "TargetCloseError: Protocol error (Runtime.callFunctionOn): Target closed\n at CallbackRegistry.clear (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/CallbackRegistry.js:73:36)\n at CdpCDPSession._onClosed (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/CDPSession.js:101:25)\n at #onClose (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Connection.js:167:21)\n at Connection.dispose (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Connection.js:173:22)\n at CdpBrowser.disconnect (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Browser.js:230:26)\n at CdpBrowser.close (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Browser.js:226:20)\n at async WebjsClient.destroy (/app/node_modules/whatsapp-web.js/src/Client.js:787:9)", "message": "Protocol error (Runtime.callFunctionOn): Target closed", "name": "TargetCloseError", "cause": { "stack": "ProtocolError\n at <instance_members_initializer> (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/CallbackRegistry.js:94:14)\n at new Callback (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/CallbackRegistry.js:98:16)\n at CallbackRegistry.create (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/CallbackRegistry.js:23:26)\n at Connection._rawSend (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Connection.js:90:26)\n at CdpCDPSession.send (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/CDPSession.js:66:33)\n at #evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/ExecutionContext.js:360:50)\n at ExecutionContext.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/ExecutionContext.js:275:36)\n at IsolatedWorld.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/IsolatedWorld.js:100:30)\n at CdpFrame.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Frame.js:341:43)\n at CdpFrame. (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/util/decorators.js:104:27)\n at CdpPage.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Page.js:807:43)\n at WebjsClient.sendMessage (/app/node_modules/whatsapp-web.js/src/Client.js:956:44)\n at WhatsappSessionWebJSPlus.sendImageStatus (/app/dist/plus/engines/webjs/session.webjs.plus.js:64:30)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)", "message": "", "name": "ProtocolError" } }, "request": { "path": "/api/xxxxxxxxxx/status/image", "method": "POST", "body": { "file": { "mimetype": "image/jpeg", "filename": "image.jpg", "url": "https://github.com/devlikeapro/waha/raw/core/examples/dev.likeapro.jpg" }, "contacts": null, "caption": "string" }, "query": {} }, "version": { "version": "2024.11.11", "engine": "WEBJS", "tier": "PLUS", "browser": "/usr/bin/chromium" } }"

Steps

To Reproduce Steps to reproduce the behavior:

Use the Swagger to send Status image

Expected behavior

Update Status

patron:PLUS

gabrielaltea avatar Dec 03 '24 09:12 gabrielaltea

Hi! Could you try to switch to chrome based image?

devlikeapro/waha-plus:chrome

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

patron:PRO

devlikepro avatar Dec 06 '24 03:12 devlikepro

Yes, the same result. VERSION 2024-12-1 Chrome

Curl

curl -X 'POST'
'https://was.xxxxxxxxx.com:3000/api/xxxxxxxx/status/image'
-H 'accept: /'
-H 'X-Api-Key: ultrasecret'
-H 'Content-Type: application/json'
-d '{ "file": { "mimetype": "image/jpeg", "filename": "filename.jpg", "url": "https://github.com/devlikeapro/waha/raw/core/examples/waha.jpg" }, "contacts": null, "caption": "string" }'

Error: Internal Server Error

Response body Download { "statusCode": 500, "timestamp": "2024-12-06T11:57:14.952Z", "exception": { "stack": "TargetCloseError: Protocol error (Runtime.callFunctionOn): Target closed\n at CallbackRegistry.clear (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/CallbackRegistry.js:73:36)\n at CdpCDPSession._onClosed (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/CDPSession.js:101:25)\n at #onClose (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Connection.js:167:21)\n at Connection.dispose (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Connection.js:173:22)\n at CdpBrowser.disconnect (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Browser.js:230:26)\n at CdpBrowser.close (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Browser.js:226:20)\n at async WebjsClient.destroy (/app/node_modules/whatsapp-web.js/src/Client.js:787:9)", "message": "Protocol error (Runtime.callFunctionOn): Target closed", "name": "TargetCloseError", "cause": { "stack": "ProtocolError\n at <instance_members_initializer> (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/CallbackRegistry.js:94:14)\n at new Callback (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/CallbackRegistry.js:98:16)\n at CallbackRegistry.create (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/CallbackRegistry.js:23:26)\n at Connection._rawSend (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Connection.js:90:26)\n at CdpCDPSession.send (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/CDPSession.js:66:33)\n at #evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/ExecutionContext.js:360:50)\n at ExecutionContext.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/ExecutionContext.js:275:36)\n at IsolatedWorld.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/IsolatedWorld.js:100:30)\n at CdpFrame.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Frame.js:341:43)\n at CdpFrame. (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/util/decorators.js:104:27)\n at CdpPage.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Page.js:807:43)\n at WebjsClient.sendMessage (/app/node_modules/whatsapp-web.js/src/Client.js:956:44)\n at WhatsappSessionWebJSPlus.sendImageStatus (/app/dist/plus/engines/webjs/session.webjs.plus.js:64:30)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)", "message": "", "name": "ProtocolError" } }, "request": { "path": "/api/xxxxx-xxxxx/status/image", "method": "POST", "body": { "file": { "mimetype": "image/jpeg", "filename": "filename.jpg", "url": "https://github.com/devlikeapro/waha/raw/core/examples/waha.jpg" }, "contacts": null, "caption": "string" }, "query": {} }, "version": { "version": "2024.12.1", "engine": "WEBJS", "tier": "PLUS", "browser": "/usr/bin/google-chrome-stable" } }

patron:PLUS

gabrielaltea avatar Dec 06 '24 12:12 gabrielaltea