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

Error: Protocol error (Runtime.callFunctionOn): Session closed. Most likely the page has been closed. #3440

Open
2 tasks done
eugabrielsilva opened this issue Jan 17, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@eugabrielsilva
Copy link

Is there an existing issue for this?

  • I have searched the existing issues.

Is this a problem caused by your code, or is it specifically because of the library?

  • I have double-checked my code carefully.

Describe the bug.

After the client is running and working correctly for a few minutes, this error shows up and the client fails to do anything.

0|sinka-wh | [1/17/2025, 1:28:06 PM] [ERROR] Error: Protocol error (Runtime.callFunctionOn): Session closed. Most likely the page has been closed.
0|sinka-wh |     at CDPSessionImpl.send (/home/ubuntu/whatsapp/node_modules/puppeteer-core/src/common/Connection.ts:379:9)
0|sinka-wh |     at ExecutionContext._ExecutionContext_evaluate (/home/ubuntu/whatsapp/node_modules/puppeteer-core/src/common/ExecutionContext.ts:274:44)
0|sinka-wh |     at processTicksAndRejections (node:internal/process/task_queues:95:5)
0|sinka-wh |     at async ExecutionContext.evaluate (/home/ubuntu/whatsapp/node_modules/puppeteer-core/src/common/ExecutionContext.ts:137:12)
0|sinka-wh |     at async Client.sendMessage (/home/ubuntu/whatsapp/node_modules/whatsapp-web.js/src/Client.js:950:28)
0|sinka-wh |     at async /home/ubuntu/whatsapp/src/routes/send-message.ts:35:5

Expected Behavior

Client must keep online and working.

Steps to Reproduce the Bug or Issue

const client = new Client({
  puppeteer: {
    args: ['--no-sandbox', '--disable-setuid-sandbox'],
    headless: true
  },
  authStrategy: new LocalAuth(),
  qrMaxRetries: 3,
  takeoverOnConflict: true
})

WhatsApp Account Type

WhatsApp Business

Browser Type

Chromium

Operation System Type

Ubuntu

Phone OS Type

Android

WhatsApp-Web.js Version

v1.26.1-alpha.3

WhatsApp Web Version

2.3000.1019406143

Node.js Version

20.18.1

Authentication Strategy

LocalAuth

Additional Context

Running on Amazon EC2 Ubuntu instance t3.small with 8GB SSD.

@eugabrielsilva eugabrielsilva added the bug Something isn't working label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant