whatsapp-web.js
whatsapp-web.js copied to clipboard
WAstate, chromium crash aw snap
Is there an existing issue for this?
- [X] I have searched the existing issues
Describe the bug
when wastate repeat opening, pairing, connected it cause high cpu resource and then some pc/server which low resource will crash aw snap on chromium.
Expected behavior
1-2hours inactivity of chat sometimes wastate opening,pairing,connected especially on midnight 1am -4am
Steps to Reproduce the Bug or Issue
dont know how to reopening state it just happenned automatic.
Relevant Code
No response
Browser Type
Chromium
WhatsApp Account Type
Standard
Does your WhatsApp account have multidevice enabled?
Yes, I am using Multi Device
Environment
windows android wwebjs 1.16.6 wawebversion 2.2216.8 nodejs v13.14.0
Additional context
No response
happened to me ,need to log out and login again out of memory message appeared too
happened to me ,need to log out and login again out of memory message appeared too
yeah some of my client always random happened, some 24hours - 2/3days, some random 4-12hours. some with low spec pc, some with server pc 16-32gb ram occur too.
I have a server with 128gb of ram and i9 processor, and even there it happens :) I had to make a handler that checks the status of the tab, and if it does not respond, restart the connection.
I have a server with 128gb of ram and i9 processor, and even there it happens :) I had to make a handler that checks the status of the tab, and if it does not respond, restart the connection.
Can you show me your solution, pls? I'm facing the same problem
I have a server with 128gb of ram and i9 processor, and even there it happens :) I had to make a handler that checks the status of the tab, and if it does not respond, restart the connection.
sharing your solution would help alot
Happens to me too. (I make also telegram bot to quick control the whatsapp bot)
i found the fix for this //delete the service worker fix the issue @pedroslopez @PurpShell
const { Client, Location, List, Buttons, LocalAuth } = require('./index');
var fs = require('fs');
const authStrategy = new LocalAuth();
var worker = `${authStrategy.dataPath}/session/Default/Service Worker`;
//delete the service worker fix the issue
if (fs.existsSync(worker)) {
fs.rmSync(worker, { recursive: true });
}
const client = new Client({ authStrategy, puppeteer: { headless: true, args: ['--no-sandbox'] }, restartOnAuthFail: true, takeoverOnConflict: true, takeoverTimeoutMs: 10 });
I have a server with 128gb of ram and i9 processor, and even there it happens :) I had to make a handler that checks the status of the tab, and if it does not respond, restart the connection.
I'd also be curious to see your solution to this.
i found the fix for this //delete the service worker fix the issue @pedroslopez @PurpShell
const { Client, Location, List, Buttons, LocalAuth } = require('./index'); var fs = require('fs'); const authStrategy = new LocalAuth(); var worker = `${authStrategy.dataPath}/session/Default/Service Worker`; //delete the service worker fix the issue if (fs.existsSync(worker)) { fs.rmSync(worker, { recursive: true }); } const client = new Client({ authStrategy, puppeteer: { headless: true, args: ['--no-sandbox'] }, restartOnAuthFail: true, takeoverOnConflict: true, takeoverTimeoutMs: 10 });
Thing is we already do this behind the curtains
We stop the workers gracefully instead of deleting them but ok
i found the fix for this //delete the service worker fix the issue @pedroslopez @PurpShell
const { Client, Location, List, Buttons, LocalAuth } = require('./index'); var fs = require('fs'); const authStrategy = new LocalAuth(); var worker = `${authStrategy.dataPath}/session/Default/Service Worker`; //delete the service worker fix the issue if (fs.existsSync(worker)) { fs.rmSync(worker, { recursive: true }); } const client = new Client({ authStrategy, puppeteer: { headless: true, args: ['--no-sandbox'] }, restartOnAuthFail: true, takeoverOnConflict: true, takeoverTimeoutMs: 10 });
Thing is we already do this behind the curtains
We stop the workers gracefully instead of deleting them but ok
I am having issues of high CPU usage and will try this. Thanks!
Forgot to mention my client is dying when this happens:
Forgot to mention my client is dying when this happens:
yes this is cause by wastate reconnecting (because of connection problem to server whatsapp) it cause high cpu on chromium using more than 8gb ram and then cause snap cannot reload page.
actually i already fix this issue on june but using custom client (old client base on purpshell latest md) also i'm not using authstrategy (still local path base on purpshell client) and the last step downgrade puppeteer using v10.4.0 and voila no more crash no more snap. run smooth almost 2 month nonstop without snap/crash
Forgot to mention my client is dying when this happens:
yes this is cause by wastate reconnecting (because of connection problem to server whatsapp) it cause high cpu on chromium using more than 8gb ram and then cause snap cannot reload page.
actually i already fix this issue on june but using custom client (old client base on purpshell latest md) also i'm not using authstrategy (still local path base on purpshell client) and the last step downgrade puppeteer using v10.4.0 and voila no more crash no more snap. run smooth almost 2 month nonstop without snap/crash
Sory, but what is a purpshell client? How to connect the local chromium profile folder on it?
Forgot to mention my client is dying when this happens:
yes this is cause by wastate reconnecting (because of connection problem to server whatsapp) it cause high cpu on chromium using more than 8gb ram and then cause snap cannot reload page. actually i already fix this issue on june but using custom client (old client base on purpshell latest md) also i'm not using authstrategy (still local path base on purpshell client) and the last step downgrade puppeteer using v10.4.0 and voila no more crash no more snap. run smooth almost 2 month nonstop without snap/crash
Sory, but what is a purpshell client? How to connect the local chromium profile folder on it?
hi, this is my client.js file you can try use it (maybe you need a little custom on constant/injected file too) https://drive.google.com/file/d/1-Ym3mMs7OoGQxHHEIbUmSqpcTimWiMqF/view?usp=sharing
also on index.js file just add this (not using authstrategy) const client = new Client({ puppeteer: { headless: false , args:[ "--no-sandbox", ] }, clientId: 'wanode' });
also i'm not using authstrategy (still local path base on purpshell clien
Thank you will give it a try!
Forgot to mention my client is dying when this happens:
yes this is cause by wastate reconnecting (because of connection problem to server whatsapp) it cause high cpu on chromium using more than 8gb ram and then cause snap cannot reload page. actually i already fix this issue on june but using custom client (old client base on purpshell latest md) also i'm not using authstrategy (still local path base on purpshell client) and the last step downgrade puppeteer using v10.4.0 and voila no more crash no more snap. run smooth almost 2 month nonstop without snap/crash
Sory, but what is a purpshell client? How to connect the local chromium profile folder on it?
hi, this is my client.js file you can try use it (maybe you need a little custom on constant/injected file too) https://drive.google.com/file/d/1-Ym3mMs7OoGQxHHEIbUmSqpcTimWiMqF/view?usp=sharing
also on index.js file just add this (not using authstrategy) const client = new Client({ puppeteer: { headless: false , args:[ "--no-sandbox", ] }, clientId: 'wanode' });
We did exactly as you wrote, but it didn’t help :( What version of Chromium do you use? Could it be a browser issue?
We did exactly as you wrote, but it didn’t help :( What version of Chromium do you use? Could it be a browser issue?
i downgrade puppeteer using v10.4.0 so it was using chromium Version 93.0.4577.0
We did exactly as you wrote, but it didn’t help :( What version of Chromium do you use? Could it be a browser issue?
i downgrade puppeteer using v10.4.0 so it was using chromium Version 93.0.4577.0
Hi @voidpack. I've downgraded to v10.4.0 (using Chromium v93.0.4577.0) and used the indicated Client.js but I'm still getting the "Aw, Snap!" crash.
My WhatsApp instance is very heavy in chats and daily message volume.
Any tips are welcome!
We did exactly as you wrote, but it didn’t help :( What version of Chromium do you use? Could it be a browser issue?
i downgrade puppeteer using v10.4.0 so it was using chromium Version 93.0.4577.0
Hi @voidpack. I've downgraded to v10.4.0 (using Chromium v93.0.4577.0) and used the indicated Client.js but I'm still getting the "Aw, Snap!" crash.
My WhatsApp instance is very heavy in chats and daily message volume.
Any tips are welcome!
me too
We did exactly as you wrote, but it didn’t help :( What version of Chromium do you use? Could it be a browser issue?
i downgrade puppeteer using v10.4.0 so it was using chromium Version 93.0.4577.0
Hi @voidpack. I've downgraded to v10.4.0 (using Chromium v93.0.4577.0) and used the indicated Client.js but I'm still getting the "Aw, Snap!" crash.
My WhatsApp instance is very heavy in chats and daily message volume.
Any tips are welcome!
if you are using my client.js file, on index file new client still using authstrategy or not ? because authstrategy dont work with my client.js if not using it backup your file/respository first then try this old package.json (remove the package-lock.json first) https://drive.google.com/file/d/1vhwdIpFAXBCAO58Q_NoAoOe-zByRpVB7/view?usp=sharing (i'm suggest remove the node_modules folder too) then npm install. this is my last step using old package.json from pedro. after that a hundred client of mine never occur snap/crash again from june run nonstop 24hours.
We did exactly as you wrote, but it didn’t help :( What version of Chromium do you use? Could it be a browser issue?
i downgrade puppeteer using v10.4.0 so it was using chromium Version 93.0.4577.0
Hi @voidpack. I've downgraded to v10.4.0 (using Chromium v93.0.4577.0) and used the indicated Client.js but I'm still getting the "Aw, Snap!" crash. My WhatsApp instance is very heavy in chats and daily message volume. Any tips are welcome!
if you are using my client.js file, on index file new client still using authstrategy or not ? because authstrategy dont work with my client.js if not using it backup your file/respository first then try this old package.json (remove the package-lock.json first) https://drive.google.com/file/d/1vhwdIpFAXBCAO58Q_NoAoOe-zByRpVB7/view?usp=sharing (i'm suggest remove the node_modules folder too) then npm install. this is my last step using old package.json from pedro. after that a hundred client of mine never occur snap/crash again from june run nonstop 24hours.
Thanks for your reply.
When you say for me not to use authStrategy, do you mean removing the argument like below (where I commented the line)?
var client = new Client({ //authStrategy: new LocalAuth(), puppeteer: { headless: true, args: [ '--no-sandbox', '--disable-setuid-sandbox', '--disable-dev-shm-usage', '--disable-accelerated-2d-canvas', '--no-first-run', '--no-zygote', '--disable-gpu' ],}})
I see in your package.json you are pointing to puppeteer "^10.4.0" and not "10.4.0". This causes Chromium to go beyond v93 (goes to version 100.x). Can you confirm which version of Puppeteer and Chromium is running there?
My instance (which 6k chats) is running fine for a couple days with puppeteer 10.4.0 and Chromium 93.x, so the workaround helped indeed! But if I run a client.getChats() then chat.fetchMessages() a few times, I get the Aw Snap crash right away.
Thanks for your reply.
When you say for me not to use authStrategy, do you mean removing the argument like below (where I commented the line)?
var client = new Client({ //authStrategy: new LocalAuth(), puppeteer: { headless: true, args: [ '--no-sandbox', '--disable-setuid-sandbox', '--disable-dev-shm-usage', '--disable-accelerated-2d-canvas', '--no-first-run', '--no-zygote', '--disable-gpu' ],}})
I see in your package.json you are pointing to puppeteer "^10.4.0" and not "10.4.0". This causes Chromium to go beyond v93 (goes to version 100.x). Can you confirm which version of Puppeteer and Chromium is running there?
My instance (which 6k chats) is running fine for a couple days with puppeteer 10.4.0 and Chromium 93.x, so the workaround helped indeed! But if I run a client.getChats() then chat.fetchMessages() a few times, I get the Aw Snap crash right away.
i'm still using puppeeter v10.4.0 (using Chromium v93.0.4577.0). maybe your 6000 chat have to many message to fetch ? if not important message maybe you can try clear all chat history(just clear not delete) from WA app on the phone. maybe it can help from aw snap for fetchMessage
Thanks for your reply. When you say for me not to use authStrategy, do you mean removing the argument like below (where I commented the line)? var client = new Client({ //authStrategy: new LocalAuth(), puppeteer: { headless: true, args: [ '--no-sandbox', '--disable-setuid-sandbox', '--disable-dev-shm-usage', '--disable-accelerated-2d-canvas', '--no-first-run', '--no-zygote', '--disable-gpu' ],}}) I see in your package.json you are pointing to puppeteer "^10.4.0" and not "10.4.0". This causes Chromium to go beyond v93 (goes to version 100.x). Can you confirm which version of Puppeteer and Chromium is running there? My instance (which 6k chats) is running fine for a couple days with puppeteer 10.4.0 and Chromium 93.x, so the workaround helped indeed! But if I run a client.getChats() then chat.fetchMessages() a few times, I get the Aw Snap crash right away.
i'm still using puppeeter v10.4.0 (using Chromium v93.0.4577.0). maybe your 6000 chat have to many message to fetch ? if not important message maybe you can try clear all chat history(just clear not delete) from WA app on the phone. maybe it can help from aw snap for fetchMessage
Thanks for your reply again and all of your support. The issue was that I was running a parallel iteration which was causing like 6k fetchmessages at the same time. Now my sync of chats is running a regular loop and all is fine!
I am using puppeeter v10.4.0 (using Chromium v93.0.4577.0) as well, based on your recommendation and now my instance takes like 3 days to crash instead of a couple hours, it's much better. Thank you so much. Cheers.
Thanks for your reply. When you say for me not to use authStrategy, do you mean removing the argument like below (where I commented the line)? var client = new Client({ //authStrategy: new LocalAuth(), puppeteer: { headless: true, args: [ '--no-sandbox', '--disable-setuid-sandbox', '--disable-dev-shm-usage', '--disable-accelerated-2d-canvas', '--no-first-run', '--no-zygote', '--disable-gpu' ],}}) I see in your package.json you are pointing to puppeteer "^10.4.0" and not "10.4.0". This causes Chromium to go beyond v93 (goes to version 100.x). Can you confirm which version of Puppeteer and Chromium is running there? My instance (which 6k chats) is running fine for a couple days with puppeteer 10.4.0 and Chromium 93.x, so the workaround helped indeed! But if I run a client.getChats() then chat.fetchMessages() a few times, I get the Aw Snap crash right away.
i'm still using puppeeter v10.4.0 (using Chromium v93.0.4577.0). maybe your 6000 chat have to many message to fetch ? if not important message maybe you can try clear all chat history(just clear not delete) from WA app on the phone. maybe it can help from aw snap for fetchMessage
Thanks for your reply again and all of your support. The issue was that I was running a parallel iteration which was causing like 6k fetchmessages at the same time. Now my sync of chats is running a regular loop and all is fine!
I am using puppeeter v10.4.0 (using Chromium v93.0.4577.0) as well, based on your recommendation and now my instance takes like 3 days to crash instead of a couple hours, it's much better. Thank you so much. Cheers.
hai, that's great to hear your aw snap issue has been solve. it was nightmare for me too on late may till june when random a few hour and random clients have crash aw snap hahahahha. maybe my client not have 6k chat like your instance( i only have a few hundred chat) so i still have not found any crash aw snap again. cheers