Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG][WEBJS] - Send Status error #678

Open
gabrielaltea opened this issue Dec 3, 2024 · 2 comments
Open

[BUG][WEBJS] - Send Status error #678

gabrielaltea opened this issue Dec 3, 2024 · 2 comments
Labels
bug Something isn't working engine:WEBJS patron:PLUS

Comments

@gabrielaltea
Copy link

gabrielaltea commented Dec 3, 2024

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 gabrielaltea added the bug Something isn't working label Dec 3, 2024
@devlikepro
Copy link
Contributor

devlikepro commented Dec 6, 2024

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

@gabrielaltea
Copy link
Author

gabrielaltea commented Dec 6, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working engine:WEBJS patron:PLUS
Projects
None yet
Development

No branches or pull requests

2 participants