Closed myhardez closed 3 years ago
Short answer is yes, you can run on Ubuntu 20.04 with no GUI. I run it with no problems at all. And make sure you had already installed the dependencies mentioned on this link. Take a look at Debian section.
From your log, it seems you run with root user, have you tried using non-root user?
thank you sir
this is puppeteer/chromium related. to solve it, you need to read about how to enable chromium sandbox on your OS, or run it without sandbox using root.
thank you sir
How to solve this?
solution: puppeteer: {headless: true}
let client = new Client({
session: session,
//qrTimeoutMs: 120000,
//authTimeoutMs: 120000,
//restartOnAuthFail: true,
//takeoverOnConflict: true
//takeoverTimeoutMs: 5000
puppeteer: {headless: true, args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-extensions']}
});
Simple boilerplate for only terminal instance: ameybhavsar24/ww-bot/index.js
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
const client = new Client({
restartOnAuthFail: true,
puppeteer: {
headless: true,
args: [
'--no-sandbox',
'--disable-setuid-sandbox',
],
},
session: sessionCfg
});
I try again, but have error please help me
Insira essa linha em seu args
:
'--disable-extensions'
Além disso, você precisa instalar o chromium em seu servidor:
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt-get install -f
Depois de ter instalado o chromium, você precisa habilita-lo:
node node_modules/puppeteer/install.js
Hi guys, can you show your dockerfile with whatsapp-web.js. I have troubles with running application on Ubuntu. Its well work on windows but on Ubuntu doesn't work properly. I saw 2 errors with running whatsapp-web.js on linux: 1) Error: Failed to launch the browser process! /node_modules/puppeteer/.local-chromium/linux-982053/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
2) ERR_CONNECTION... web.whatsapp.com (application don't send QR in a few minutes and than send error)
solution:
puppeteer: {headless: true}
let client = new Client({ session: session, //qrTimeoutMs: 120000, //authTimeoutMs: 120000, //restartOnAuthFail: true, //takeoverOnConflict: true //takeoverTimeoutMs: 5000 puppeteer: {headless: true, args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-extensions']} });
This solution work for me on Debian Linux 10... if still not work, try install dependencies based on https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#chrome-headless-doesnt-launch-on-unix
@i9team Yours is the only solution that works here for me, thanks!
Well, really a combination of all options work 😜
puppeteer: {
headless: true,
ignoreHTTPSErrors: true,
args: [
"--no-sandbox",
"--disable-setuid-sandbox",
"--disable-extensions",
],
},
Hello, The error no longer appears but now the result does not appear. It just goes black and I don't know what's happening.
Hi sir
I will ask sir , i try run this on UBUNTU 20.04 no GUI but have error Can I run this on UBUNTU 20.04 no GUI ?
error log
root@wa-server:/whatsapp-api# npm run start
(node:15485) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process! [0109/091009.834081:ERROR:zygote_host_impl_linux.cc(90)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
(node:15485) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:15485) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. root@wa-server:/whatsapp-api# node --version v10.19.0 root@wa-server:/whatsapp-api#