[WEBJS] - session fails - Error: Attempted to use detached Frame
Describe the bug
A clear and concise description of what the bug is. Feel free to remove sections that you don't feel to make the text shorter!
{
"version": "2025.9.4",
"engine": "WEBJS",
"tier": "TIER"
}
Steps
To Reproduce Steps to reproduce the behavior:
- Start a new session
- it will stuck to the status to sarting
- After refershing the session it will change to scan_qr_code
- After scaning I have to refresh it to see working status
- Finally, after sending few message it will change the status to failed
utomate.prod.okoarescue.com/webhook/waha-qr-webhooks"}
waha-prod | [06:11:00.236] DEBUG (WhatsappSession/42): session:default - Should not restart the client, ignoring restart request {"reqId":741,"session":"default"}
waha-prod | [06:11:00.236] DEBUG (WhatsappSession/42): session:default - Browser is ready to be closed: true {"reqId":741,"session":"default"}
waha-prod | [06:11:00.242] DEBUG (WhatsappSession/42): session:default - Successfully waited for browser to be ready for closing {"reqId":741,"session":"default"}
waha-prod | [06:11:00.242] DEBUG (WhatsappSession/42): session:default - Successfully destroyed whatsapp client {"reqId":741,"session":"default"}
waha-prod | [06:11:00.242] DEBUG (WhatsappSession/42): session:default - Successfully destroyed auth strategy {"reqId":741,"session":"default"}
waha-prod | [06:11:00.245] DEBUG (WhatsappSession/42): session:default - Successfully destroyed whatsapp client {"reqId":741,"session":"default"}
waha-prod | [06:11:00.250] DEBUG (WhatsappSession/42): session:default - Successfully destroyed auth strategy {"reqId":741,"session":"default"}
waha-prod | [06:11:00.555] INFO (WebhookSender/42): session:default - POST request was sent with status code: 200 {"reqId":741,"session":"default","id":"01K5G9HWGBX1RQHBS5VWWCQA1T","event.id":"evt_01k5g9hwg91ncc7nbaq9e9pqzq","url":"https://automate.prod.okoarescue.com/webhook/waha-qr-webhooks"}
waha-prod | [06:11:00.555] DEBUG (WebhookSender/42): session:default - Response {"reqId":741,"session":"default","id":"01K5G9HWGBX1RQHBS5VWWCQA1T","event.id":"evt_01k5g9hwg91ncc7nbaq9e9pqzq","url":"https://automate.prod.okoarescue.com/webhook/waha-qr-webhooks","body":{"message":"Workflow was started"}}
waha-prod | [06:11:00.586] INFO (WebhookSender/42): session:default - POST request was sent with status code: 200 {"reqId":741,"session":"default","id":"01K5G9HWFSET55VAYTVMY765A6","event.id":"evt_01k5g9hwfs1nrw9ged43s3zymy","url":"https://automate.prod.okoarescue.com/webhook/waha-qr-webhooks"}
waha-prod | [06:11:00.586] DEBUG (WebhookSender/42): session:default - Response {"reqId":741,"session":"default","id":"01K5G9HWFSET55VAYTVMY765A6","event.id":"evt_01k5g9hwfs1nrw9ged43s3zymy","url":"https://automate.prod.okoarescue.com/webhook/waha-qr-webhooks","body":{"message":"Workflow was started"}}
waha-prod | [06:11:00.333] ERROR (Bootstrap/42): Unhandled Rejection at:
waha-prod | [06:11:00.333] ERROR (Bootstrap/42): Error: Attempted to use detached Frame '0B9D4DFEAFC871CD30EFC355AF79BBAC'.
waha-prod | at CdpFrame.<anonymous> (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/util/decorators.js:107:23)
waha-prod | at CdpPage.waitForFunction (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Page.js:1443:37)
waha-prod | at WPage.waitForFunction (/app/dist/core/engines/webjs/WPage.js:43:36)
waha-prod | at WebjsClientCore.inject (/app/node_modules/whatsapp-web.js/src/Client.js:96:28)
waha-prod | at /app/node_modules/whatsapp-web.js/src/Client.js:339:24
waha-prod | [06:11:00.645] INFO (WebhookSender/42): session:default - POST request was sent with status code: 200 {"reqId":741,"session":"default","id":"01K5G9HWG9CAQ7748YE0W3XBBJ","event.id":"evt_01k5g9hwg91ncc7nbaq9e9pqzq","url":"https://httpbin.org/post"}
waha-prod | [06:11:00.645] DEBUG (WebhookSender/42): session:default - Response {"reqId":741,"session":"default","id":"01K5G9HWG9CAQ7748YE0W3XBBJ","event.id":"evt_01k5g9hwg91ncc7nbaq9e9pqzq","url":"https://httpbin.org/post","body":{"args":{},"data":"{\"id\":\"evt_01k5g9hwg91ncc7nbaq9e9pqzq\",\"timestamp\":1758262260233,\"event\":\"session.status\",\"session\":\"default\",\"metadata\":{},\"me\":{\"id\":\"[email protected]\",\"pushName\":\"Okoa Rescue\"},\"payload\":{\"name\":\"default\",\"status\":\"FAILED\",\"statuses\":[{\"status\":\"WORKING\",\"timestamp\":1758262097611},{\"status\":\"FAILED\",\"timestamp\":1758262260217},{\"status\":\"FAILED\",\"timestamp\":1758262260231}]},\"engine\":\"WEBJS\",\"environment\":{\"version\":\"2025.9.4\",\"engine\":\"WEBJS\",\"tier\":\"CORE\",\"browser\":\"/usr/bin/chromium\"}}","files":{},"form":{},"headers":{"Accept":"application/json, text/plain, */*","Accept-Encoding":"gzip, compress, deflate, br","Content-Length":"495","Content-Type":"application/json","Host":"httpbin.org","User-Agent":"WAHA/2025.9.4","X-Amzn-Trace-Id":"Root=1-68ccf3f4-572e30572d32f6b47ec3ba56","X-Webhook-Request-Id":"01K5G9HWG9CAQ7748YE0W3XBBJ","X-Webhook-Timestamp":"1758262260233"},"json":{"engine":"WEBJS","environment":{"browser":"/usr/bin/chromium","engine":"WEBJS","tier":"CORE","version":"2025.9.4"},"event":"session.status","id":"evt_01k5g9hwg91ncc7nbaq9e9pqzq","me":{"id":"[email protected]","pushName":"Okoa Rescue"},"metadata":{},"payload":{"name":"default","status":"FAILED","statuses":[{"status":"WORKING","timestamp":1758262097611},{"status":"FAILED","timestamp":1758262260217},{"status":"FAILED","timestamp":1758262260231}]},"session":"default","timestamp":1758262260233},"origin":"145.223.116.147","url":"https://httpbin.org/post"}}
waha-prod | [06:11:00.954] INFO (WebhookSender/42): session:default - POST request was sent with status code: 200 {"reqId":741,"session":"default","id":"01K5G9HWFS46X8ZKS6X3PGXB89","event.id":"evt_01k5g9hwfs1nrw9ged43s3zymy","url":"https://httpbin.org/post"}
waha-prod | [06:11:00.954] DEBUG (WebhookSender/42): session:default - Response {"reqId":741,"session":"default","id":"01K5G9HWFS46X8ZKS6X3PGXB89","event.id":"evt_01k5g9hwfs1nrw9ged43s3zymy","url":"https://httpbin.org/post","body":{"args":{},"data":"{\"id\":\"evt_01k5g9hwfs1nrw9ged43s3zymy\",\"timestamp\":1758262260217,\"event\":\"session.status\",\"session\":\"default\",\"metadata\":{},\"me\":{\"id\":\"[email protected]\",\"pushName\":\"Okoa Rescue\"},\"payload\":{\"name\":\"default\",\"status\":\"FAILED\",\"statuses\":[{\"status\":\"STARTING\",\"timestamp\":1758262092512},{\"status\":\"WORKING\",\"timestamp\":1758262097611},{\"status\":\"FAILED\",\"timestamp\":1758262260217}]},\"engine\":\"WEBJS\",\"environment\":{\"version\":\"2025.9.4\",\"engine\":\"WEBJS\",\"tier\":\"CORE\",\"browser\":\"/usr/bin/chromium\"}}","files":{},"form":{},"headers":{"Accept":"application/json, text/plain, */*","Accept-Encoding":"gzip, compress, deflate, br","Content-Length":"497","Content-Type":"application/json","Host":"httpbin.org","User-Agent":"WAHA/2025.9.4","X-Amzn-Trace-Id":"Root=1-68ccf3f4-0567c24d624f8cc674db19dc","X-Webhook-Request-Id":"01K5G9HWFS46X8ZKS6X3PGXB89","X-Webhook-Timestamp":"1758262260217"},"json":{"engine":"WEBJS","environment":{"browser":"/usr/bin/chromium","engine":"WEBJS","tier":"CORE","version":"2025.9.4"},"event":"session.status","id":"evt_01k5g9hwfs1nrw9ged43s3zymy","me":{"id":"[email protected]","pushName":"Okoa Rescue"},"metadata":{},"payload":{"name":"default","status":"FAILED","statuses":[{"status":"STARTING","timestamp":1758262092512},{"status":"WORKING","timestamp":1758262097611},{"status":"FAILED","timestamp":1758262260217}]},"session":"default","timestamp":1758262260217},"origin":"145.223.116.147","url":"https://httpbin.org/post"}}
waha-prod | [06:11:20.249] INFO (42): request errored {"reqId":1251,"req":{"id":1251,"method":"POST","url":"/api/sendText","query":{},"params":{"path":["api","sendText"]}},"res":{"statusCode":422},"responseTime":10013}
waha-prod | err: {
waha-prod | "type": "UnprocessableEntityException",
waha-prod | "message": "Unprocessable Entity Exception",
waha-prod | "stack":
waha-prod | UnprocessableEntityException: Unprocessable Entity Exception
waha-prod | at SessionManagerCore.waitUntilStatus (/app/dist/core/abc/manager.abc.js:114:19)
waha-prod | at async ChattingController.sendText (/app/dist/api/chatting.controller.js:30:26)
waha-prod | "response": {
waha-prod | "error": "Session status is not as expected. Try again later or restart the session",
waha-prod | "session": "default",
waha-prod | "status": "FAILED",
waha-prod | "expected": [
waha-prod | "WORKING"
waha-prod | ]
waha-prod | },
waha-prod | "status": 422,
waha-prod | "options": {},
waha-prod | "name": "UnprocessableEntityException"
waha-prod | }
waha-prod | [06:11:25.345] INFO (42): request errored {"reqId":1252,"req":{"id":1252,"method":"POST","url":"/api/sendText","query":{},"params":{"path":["api","sendText"]}},"res":{"statusCode":422},"responseTime":10009}
waha-prod | err: {
waha-prod | "type": "UnprocessableEntityException",
waha-prod | "message": "Unprocessable Entity Exception",
waha-prod | "stack":
waha-prod | UnprocessableEntityException: Unprocessable Entity Exception
waha-prod | at SessionManagerCore.waitUntilStatus (/app/dist/core/abc/manager.abc.js:114:19)
waha-prod | at async ChattingController.sendText (/app/dist/api/chatting.controller.js:30:26)
waha-prod | "response": {
waha-prod | "error": "Session status is not as expected. Try again later or restart the session",
waha-prod | "session": "default",
waha-prod | "status": "FAILED",
waha-prod | "expected": [
waha-prod | "WORKING"
waha-prod | ]
waha-prod | },
waha-prod | "status": 422,
waha-prod | "options": {},
waha-prod | "name": "UnprocessableEntityException"
waha-prod | }
waha-prod | [06:14:20.349] INFO (42): request completed {"reqId":1429,"req":{"id":1429,"method":"GET","url":"/api/version","query":{},"params":{"path":["api","version"]}},"res":{"statusCode":304},"responseTime":1}
waha-prod | [06:14:20.355] INFO (42): request completed {"reqId":1430,"req":{"id":1430,"method":"GET","url":"/api/sessions?all=true","query":{"all":"true"},"params":{"path":["api","sessions"]}},"res":{"statusCode":200},"responseTime":1}
waha-prod | [06:14:20.357] INFO (42): request completed {"reqId":1431,"req":{"id":1431,"method":"GET","url":"/api/server/status","query":{},"params":{"path":["api","server","status"]}},"res":{"statusCode":200},"responseTime":1}
waha-prod | [06:14:20.546] INFO (42): request completed {"reqId":1437,"req":{"id":1437,"method":"GET","url":"/ws?session=*&events=session.status&x-api-key=mhaileOkoa%402025","query":{"session":"*","events":"session.status","x-api-key":"mhaileOkoa@2025"},"params":{"path":["ws"]}},"res":{"statusCode":404},"responseTime":1}
Screenshots
version: "3.8"
services:
waha:
image: devlikeapro/waha:latest
container_name: waha-prod
restart: unless-stopped
shm_size: "2gb" # more shared memory to prevent Chrome crashes
ports:
- "7000:3000"
environment:
WHATSAPP_API_HOSTNAME: 0.0.0.0
WHATSAPP_API_PORT: 3000
WAHA_LOG_LEVEL: debug
volumes:
- ./sessions:/sessions # bind mount for persistent sessions
Same here
Using docker compose to run waha
Same here +1
Same here
+1
am also having the same issue
Hi Everyone - Is your whatsapp and your virtual machine (where you host WAHA) in the same country? Because waha can face issues if it is not.
I have Waha on my local server, and it's failing the same way. Same IP, router, etc.
Hi Everyone - Is your whatsapp and your virtual machine (where you host WAHA) in the same country? Because waha can face issues if it is not.
Good Point, but it makes atm no difference for us since the issue is local and on the server, also we are using server outside our country but local residential proxys so it shouldt matter atm..
Hi!
shm_size: "2gb"
Try to remove this, it should be 2CPU and 4GB memory available minimun
Could you try to add
WAHA_RUN_XVFB=false
and start all over again?
and
WAHA_WEBJS_PUPPETER_ARGS=--single-process
and both
Portuguese
Mesmo aqui
Hi Everyone - Is your whatsapp and your virtual machine (where you host WAHA) in the same country? Because waha can face issues if it is not.
yeah they are in a different country using a proxy actually solved it
Portuguese
Olá a todos - Seu WhatsApp e sua máquina virtual (onde você hospeda o WAHA) estão no mesmo país? Porque waha pode enfrentar problemas se não for.
sim, eles estão em um país diferente usando um proxy, na verdade resolveu o problema