Closed roysG closed 11 months ago
I am having the same issue... very often. can you help? Thanks!
Hi, Same problem here After few days/hours got an error:
node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:218
return Promise.reject(new Error(`Protocol error (${method}): Session closed. Most likely the ${this._targetType} has been closed.`));
^
Error: Protocol error (Runtime.callFunctionOn): Session closed. Most likely the page has been closed.
at CDPSession.send (/root/statuses-tracker/node_modules/puppeteer/lib/cjs/puppeteer/common/Connection.js:218:35)
at ExecutionContext._evaluateInternal (/root/statuses-tracker/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:204:50)
at ExecutionContext.evaluate (/root/statuses-tracker/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:110:27)
at DOMWorld.evaluate (/root/statuses-tracker/node_modules/puppeteer/lib/cjs/puppeteer/common/DOMWorld.js:97:24)
at runNextTicks (node:internal/process/task_queues:61:5)
at listOnTimeout (node:internal/timers:528:9)
at processTimers (node:internal/timers:502:7)
I also tried to add the flag --disable-dev-shm-usage
And tried to extend the RAM of my server,
But nothing helps
They are searching for the problem, see this: https://github.com/pedroslopez/whatsapp-web.js/issues/1567
Is there an existing issue for this?
Describe the bug
The session is gone/stack after unexpected times when the browser suddenly close. I also using in pm2.
I also added the code:
console.log("(SIGINT) Shutting down..."); await client.destroy(); process.exit(0);
As mentioned in one of the posts here. But still the problem happens.
most of the time, this is the error i get:
reason unhandledRejection:Error: Protocol error (Runtime.callFunctionOn): Session closed. Most likely the page has been closed.
I also tried to add these options in puppeter: puppeteer: { handleSIGINT: false, handleSIGTERM: false, .....
Expected behavior
The sessions suppose to be exists after crash or suddenly close
Steps to Reproduce the Bug or Issue
Relevant Code
No response
Browser Type
Google Chrome
WhatsApp Account Type
WhatsApp Business
Does your WhatsApp account have multidevice enabled?
Yes, I am using Multi Device
Environment
No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04.3 LTS Release: 18.04 Codename: bionic
Additional context
No response