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

Failed to launch chrome #807

Closed
prasanna1211 opened this issue Sep 17, 2017 · 43 comments
Closed

Failed to launch chrome #807

prasanna1211 opened this issue Sep 17, 2017 · 43 comments

Comments

@prasanna1211
Copy link

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 0.10.1
  • Platform / OS version: Ubutntu 16.04 running on AWS EC2
  • URLs (if applicable):

What steps will reproduce the problem?
Try the demo code to launch puppeteer in ubuntu 16.04 EC2 amazon AWS.

Code used:

const browser = await puppeteer.launch({
    headless: true,
    args: ['--no-sandbox', '--disable-setuid-sandbox'],
  });

What is the expected result?

It is able to start in my local. When I deployed in my EC2 I am getting this error. Couldn't find a past issue related to this.

What happens instead?
It throws error

(node:15966) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): Error: Error occured Error: Failed to launch chrome!
/home/ubuntu/ranker-backend/node_modules/puppeteer/.local-chromium/linux-496140/chrome-linux/chrome: error while loading shared libraries: libpangocairo-1.0.so.0: cannot open shared object file: No such file or directory
@JoelEinbinder
Copy link
Collaborator

It looks like you are missing some Debian dependencies: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

@prasanna1211
Copy link
Author

Thanks @JoelEinbinder It worked.

@ClaudiuIO
Copy link

I am having the same issue. All the debian dependencies are installed. Any advice to make chromium run?

@Garbee
Copy link
Contributor

Garbee commented Sep 27, 2017

@ClaudiuIO can you please share your exact error message? And the OS version? If you do indeed have the same error, then you missed installing a dependency most likely.

@ClaudiuIO
Copy link

ClaudiuIO commented Sep 27, 2017

@Garbee looks like it was an issue with my OS (I had tested it on an old test vm with Ubuntu 14.04)
I had installed all the dependencies. I tried installing on a newer debian machine and it worked there.

For the record, the error message was:
Error during browsing process: Error: Failed to launch chrome! /home/user/webs/scrape-test/node_modules/puppeteer/.local-chromium/linux-499413/chrome-linux/chrome: 1: /home/user/webs/oa-genius-scraper/node_modules/puppeteer/.local-chromium/linux-499413/chrome-linux/chrome: �ELF����: not found /home/user/webs/scrape-testr/node_modules/puppeteer/.local-chromium/linux-499413/chrome-linux/chrome: 1: /home/user/webs/scrape-test/node_modules/puppeteer/.local-chromium/linux-499413/chrome-linux/chrome: Syntax error: end of file unexpected

@Garbee
Copy link
Contributor

Garbee commented Sep 27, 2017

ELF not found looks like that is an ARM build. Which puppeteer currently does not support (ref issue #550).

@ClaudiuIO
Copy link

Huh that's weird it was definetly a x86 machine that I got the error on.

@Garbee
Copy link
Contributor

Garbee commented Sep 27, 2017

Interesting. If you can file an issue with the machine's details and that error it would help a lot. Focusing discussion on figuring out why that's happening on an x86 build.

@chemitaxis
Copy link

Hi, with EBS it’s not working... what I need to do? I have tried to install all the dependencies but the same error... thanks

@BernhardBehrendt
Copy link

BernhardBehrendt commented Feb 15, 2018

Arrived here in that (now closed) after I made troubleshooting why puppeteer won't start.
I've already read the troubleshooting document (relating debian/ubuntu) and now cant get pupeteer running on my rpi3.

I've tried to execute the puppeteer launch script from above

const browser = await puppeteer.launch({
    headless: true,
    args: ['--no-sandbox', '--disable-setuid-sandbox'],
});

and got this result:

(node:21758) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): 
Error: Failed to launch chrome!
/home/pi/fetchbotlokal/node_modules/puppeteer/.local-chromium/linux-526987/chrome-
linux/chrome: 3: /home/pi/fetchbotlokal/node_modules/puppeteer/.local-chromium/linux-
526987/chrome-linux/chrome: Syntax error: ")" unexpected


TROUBLESHOOTING: 
https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

(node:21758) [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.

@Garbee
Copy link
Contributor

Garbee commented Feb 15, 2018

Raspberry Pi' are ARM based, which as explained above is not supported as arm builds of Chromium are not provided for development testing purposes by the Chromium Team.

@raja50
Copy link

raja50 commented Feb 18, 2018

const browser = await puppeteer.launch({
headless: true,
args: ['--no-sandbox', '--disable-setuid-sandbox'],
});
works for me in aws elastic beanstalk environment . I installed the dependencies by refering the https://medium.com/mockingbot/run-puppeteer-chrome-headless-on-ec2-amazon-linux-ami-6c9c6a17bee6

@condescendent
Copy link

I got the following error when I tried to run it on my amazon linux

bash-4.2$ vi chrome
bash-4.2$ ./chrome -v
./chrome: error while loading shared libraries: libXcursor.so.1: cannot open shared object file: No such file or directory
bash-4.2$ pwd
/usr/share/nginx/magentopuppeteer/node_modules/puppeteer/.local-chromium/linux-515411/chrome-linux
bash-4.2$ cat /etc/*-release
NAME="Amazon Linux AMI"
VERSION="2017.09"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2017.09"
PRETTY_NAME="Amazon Linux AMI 2017.09"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2017.09:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"
Amazon Linux AMI release 2017.09
bash-4.2$

@condescendent
Copy link

bash-4.2$ ldd chrome | grep not
libXcursor.so.1 => not found
libXdamage.so.1 => not found
libXfixes.so.3 => not found
libcups.so.2 => not found
libXss.so.1 => not found
libXrandr.so.2 => not found
libgconf-2.so.4 => not found
libpangocairo-1.0.so.0 => not found
libpango-1.0.so.0 => not found
libcairo.so.2 => not found
libatk-1.0.so.0 => not found
libatk-bridge-2.0.so.0 => not found
libgtk-3.so.0 => not found
libgdk-3.so.0 => not found
libgdk_pixbuf-2.0.so.0 => not found
bash-4.2$

@Garbee
Copy link
Contributor

Garbee commented Feb 26, 2018

./chrome: error while loading shared libraries: libXcursor.so.1: cannot open shared object file: No such file or directory

Check the required dependencies. As mentioned previously. This is your installation missing a required 3rd party library package, not a problem with Puppeteer.

@nshore
Copy link

nshore commented Apr 19, 2018

I was trying to run my mocha scripts which call puppeteer inside a docker container. The troubleshooting documentation in Github answered some issues regarding this (mainly around the dependencies that are needed) but I couldn't get it run as the pptruser they setup within side the container. I have had the EACCESS issue or the sandbox issue depending how I have resolved permission issues e.g. who is the owner of the node_module etc. The only way I have been able to resolve this is with the above suggestion of the following arguments:

args: ['--no-sandbox', '--disable-setuid-sandbox'],

What are the associated risks with doing this and is there any loss in testing quality when running outside of a sandbox environment?

@aslushnikov
Copy link
Contributor

What are the associated risks with doing this and is there any loss in testing quality when running outside of a sandbox environment?

@nshore there's no loss in testing quality. However, browser is becoming more vulnerable to the attacks, so you should be careful when running untrusted code in this mode.

@verlok
Copy link

verlok commented Apr 24, 2018

Hi there,
I'm on Windows 10 (work machine...) and I just installed puppeteer on a new, empty npm project.

npm install puppeteer

Then created this simple script:

const puppeteer = require("puppeteer");

(async () => {
	const browser = await puppeteer.launch();
	const page = await browser.newPage();
	await page.goto("https://www.armani.com");
	await page.screenshot({ path: "armani.png" });

	await browser.close();
})();

And Chromium launches, but it does nothing. It's just there in the "new tab" page, waiting. When I close it, I get this nasty error:

ERROR: The process "4836" not found.
(node:5012) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome!
[4836:14316:0424/162745.667:ERROR:install_util.cc(589)] Unable to create registry key HKLM\SOFTWARE\Policies\Chromium for reading result=2
[9824:2488:0424/162750.207:ERROR:gles2_cmd_decoder_passthrough_doers.cc(4126)] NOT IMPLEMENTED


TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

    at onClose (C:\Code\puppeteerMeasurePerf\node_modules\puppeteer\lib\Launcher.js:255:14)
    at ChildProcess.helper.addEventListener (C:\Code\puppeteerMeasurePerf\node_modules\puppeteer\lib\Launcher.js:245:60)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
(node:5012) 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:5012) [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.

So I tried with the real Chrome on my machine, changing the launch() artuments with the following:

	const browser = await puppeteer.launch({
		headless: true,
		executablePath:
			"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"
	});

And Chrome launches, but it does nothing. It's just there in the "new tab" page, waiting. When I close it, I get:

ERROR: The process "15136" not found.
(node:7988) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome!
[15136:13572:0424/162924.897:ERROR:in_progress_cache_impl.cc(189)] Cache is not initialized, cannot RetrieveEntry.
[15136:13572:0424/162924.897:ERROR:in_progress_cache_impl.cc(189)] Cache is not initialized, cannot RetrieveEntry.
[15136:13572:0424/162924.897:ERROR:in_progress_cache_impl.cc(189)] Cache is not initialized, cannot RetrieveEntry.
[15136:13572:0424/162924.897:ERROR:in_progress_cache_impl.cc(189)] Cache is not initialized, cannot RetrieveEntry.
[15136:13572:0424/162924.897:ERROR:in_progress_cache_impl.cc(189)] Cache is not initialized, cannot RetrieveEntry.
[15136:13572:0424/162924.897:ERROR:in_progress_cache_impl.cc(189)] Cache is not initialized, cannot RetrieveEntry.
[15136:13572:0424/162924.897:ERROR:in_progress_cache_impl.cc(189)] Cache is not initialized, cannot RetrieveEntry.
[15136:13572:0424/162924.897:ERROR:in_progress_cache_impl.cc(189)] Cache is not initialized, cannot RetrieveEntry.
[15136:13572:0424/162924.897:ERROR:in_progress_cache_impl.cc(189)] Cache is not initialized, cannot RetrieveEntry.
[15136:13572:0424/162924.897:ERROR:in_progress_cache_impl.cc(189)] Cache is not initialized, cannot RetrieveEntry.
[15136:13572:0424/162924.897:ERROR:in_progress_cache_impl.cc(189)] Cache is not initialized, cannot RetrieveEntry.
[15136:13572:0424/162924.897:ERROR:in_progress_cache_impl.cc(189)] Cache is not initialized, cannot RetrieveEntry.
[15136:13572:0424/162924.897:ERROR:in_progress_cache_impl.cc(189)] Cache is not initialized, cannot RetrieveEntry.
[15136:13572:0424/162924.897:ERROR:in_progress_cache_impl.cc(189)] Cache is not initialized, cannot RetrieveEntry.
[15136:13572:0424/162924.897:ERROR:in_progress_cache_impl.cc(189)] Cache is not initialized, cannot RetrieveEntry.
[15136:752:0424/162924.913:ERROR:in_progress_cache_impl.cc(93)] Could not read download entries from file because there was a read failure.


TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

    at onClose (C:\Code\puppeteerMeasurePerf\node_modules\puppeteer\lib\Launcher.js:255:14)
    at ChildProcess.helper.addEventListener (C:\Code\puppeteerMeasurePerf\node_modules\puppeteer\lib\Launcher.js:245:60)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
(node:7988) 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:7988) [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.

Can somebody help me out understanding what's happening?

@rishikraj
Copy link

On Windows-10 it is throwing this error, help me to get rid of this.

(node:14976) 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:14976) [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. C:\Users\Rishikant Rajpoot\Desktop\Intern\puppeteer>node erpauto.js (node:11228) UnhandledPromiseRejectionWarning: Error: Failed to launch chrome! spawn C:\Users\Rishikant Rajpoot\node_modules\puppeteer.local-chromium\win64-555668\chrome-win32\chrome.exe ENOENT TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

@krishpal
Copy link

I am trying to run puppeteer from PCF.

I get the below error:

(node:31) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Failed to launch chrome!
[ERR] /home/vcap/app/node_modules/puppeteer/.local-chromium/linux-594312/chrome-linux/chrome: error while loading shared libraries: libX11-xcb.so.1: cannot open shared object file: No such file or directory

Please advise.

Thanks in advance

@DdannyB
Copy link

DdannyB commented Nov 7, 2018

Im using puppeteer nugetpackage 1.9.0. I also had the same issue that browser couldn't launch in my linux container. I added this line in my dockerfile and it fixed the problem for me:

apt-get install -y wget unzip fontconfig locales gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget

reference:
https://hub.docker.com/r/browserless/chrome/

@aldoalprak
Copy link

@sagardere
Copy link

I also get the same issue But it solves in my case.

const browser = await puppeteer.launch({
    headless: true,
   executablePath:'/home/sagar/workplace/scraping-demo/node_modules/puppeteer/.local-chromium/linux-599821/chrome-linux/chrome',
    args: ['--no-sandbox', '--disable-setuid-sandbox'],
  });

When you are using headless: true options then also use the option executablePath give the accurate path of your chrome file in node_modules folder, like above. In my case i am putting whole path of my system, where my chrome file.

@ShrawanLakhe
Copy link

works perfectly in centos 7

To install chrome

wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm

sudo yum localinstall google-chrome-stable_current_x86_64.rpm

@shryta234
Copy link

@Garbee ,Getting the below road blocker ,can you or anyone please help?

Specifications

npm = 6.12.1
node = v13.1.0
OS = Ubuntu 14.04.3 LTS
I am unable to launch Chromium using puppeteer
on Ubuntu 14.04 when trying to run a Index.js file .

Error

kkadapa@homn:/vc-devgh-checkouts/screenshots$ node index.js
Error: Failed to launch chrome!
/vc-devgh-checkouts/screenshots/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome: error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory

TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

at onClose (/vc-devgh-checkouts/screenshots/node_modules/puppeteer/lib/Launcher.js:348:14)
at Interface.<anonymous> (/vc-devgh-checkouts/screenshots/node_modules/puppeteer/lib/Launcher.js:337:50)
at Interface.emit (events.js:215:7)
at Interface.close (readline.js:403:8)
at Socket.onend (readline.js:180:10)
at Socket.emit (events.js:215:7)
at endReadableNT (_stream_readable.js:1199:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)

(node:17842) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'newPage' of undefined
at /vc-devgh-checkouts/screenshots/index.js:79:29
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:17842) 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:17842) [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.
kkadapa@homn:/vc-devgh-checkouts/screenshots$

@aswinarshad
Copy link

Arrived here in that (now closed) after I made troubleshooting why puppeteer won't start.
I've already read the troubleshooting document (relating debian/ubuntu) and now cant get pupeteer running on my rpi3.

I've tried to execute the puppeteer launch script from above

const browser = await puppeteer.launch({
    headless: true,
    args: ['--no-sandbox', '--disable-setuid-sandbox'],
});

and got this result:

(node:21758) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): 
Error: Failed to launch chrome!
/home/pi/fetchbotlokal/node_modules/puppeteer/.local-chromium/linux-526987/chrome-
linux/chrome: 3: /home/pi/fetchbotlokal/node_modules/puppeteer/.local-chromium/linux-
526987/chrome-linux/chrome: Syntax error: ")" unexpected


TROUBLESHOOTING: 
https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

(node:21758) [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.

This error happened to me also.
Try using your chromium-browser, rather than Puppeteer's chrome which might not work on the PI's ARM architecture.
const browser = await puppeteer.launch({ executablePath: 'chromium-browser' });
(I had to do this on a PI 4)

@HERBOD7
Copy link

HERBOD7 commented Apr 17, 2020

if you get Failed to launch the browser process
it possible that you didn't install chromium
sudo apt-get install chromium-browser
and then setting up

@HZooly
Copy link

HZooly commented May 13, 2020

@HERBOD7 solved my problem, thank you!

@rohitnairtech
Copy link

if you get Failed to launch the browser process
it possible that you didn't install chromium
sudo apt-get install chromium-browser
and then setting up

Solved my issue too. Thanks!

@rishisoni1996
Copy link

if you get Failed to launch the browser process
it possible that you didn't install chromium
sudo apt-get install chromium-browser
and then setting up

Solved my issue too. Thanks!

I have run command sudo apt-get install chromium-browser
Setting up link is missing

Now I get: Failed to launch the browser process!\n[0630/113319.336643:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.\n\n\nTROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md\n

@sirKiraUzumaki
Copy link

UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process!
/home/container/node_modules/puppeteer/.local-chromium/linux-800071/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
at onClose (/home/container/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:193:20)
at Interface. (/home/container/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:183:68)
at Interface.emit (events.js:327:22)
at Interface.close (readline.js:416:8)
at Socket.onend (readline.js:194:10)
at Socket.emit (events.js:327:22)
at endReadableNT (_stream_readable.js:1220:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
(node:24) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:24) [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.

I am getting this error, Please help guys

@albertly
Copy link

The same here when deploying to Heroku.
With options:
"engines": {
"node": ">=14.12.0",
"npm": ">=6.14.8"
},
"reactSnap": {
"puppeteerArgs": [
"--no-sandbox",
"--disable-setuid-sandbox"
]
}

No luck :(

Error: Failed to launch chrome!
/tmp/build_e06d59ba_/node_modules/puppeteer/.local-chromium/linux-686378/chrome-linux/chrome: error while loading shared libraries: libX11-xcb.so.1: cannot open shared object file: No such file or directory

@dartvaneri
Copy link

UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process!
/home/container/node_modules/puppeteer/.local-chromium/linux-800071/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
at onClose (/home/container/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:193:20)
at Interface. (/home/container/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:183:68)
at Interface.emit (events.js:327:22)
at Interface.close (readline.js:416:8)
at Socket.onend (readline.js:194:10)
at Socket.emit (events.js:327:22)
at endReadableNT (_stream_readable.js:1220:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
(node:24) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:24) [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.

I am getting this error, Please help guys

I got same error. For me fix was in this comment: #3443 (comment)

You will require the following Dependencies

sudo apt-get install gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget

@shijiezhou1
Copy link

shijiezhou1 commented Mar 1, 2021

I got the same problem on bitbucket and this fixed my problem.

Bitbucket:

image: node:14
pipelines:
  default:
    - step:
        name: INSTALL AND BUILD
        caches:
          - node
        script:
          - apt-get update
          - apt install -y gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
          - npm run install
          - npm run build

Just put this part below for your pipeline and it turns out to works.

apt install -y gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget

@v15h9
Copy link

v15h9 commented Aug 16, 2021

For those who reach here for Heroku install of puppeteer, please ensure you add the build pack: https://elements.heroku.com/buildpacks/jontewks/puppeteer-heroku-buildpack to resolve this issue.

@lasarian27
Copy link

This worked for me:

  1. sudo apt install libxkbcommon-x11-0
  2. sudo apt-get install -y libgbm-dev

@ballooncross
Copy link

if you get Failed to launch the browser process
it possible that you didn't install chromium
sudo apt-get install chromium-browser
and then setting up

Solved my issue too. Thanks!

I have run command sudo apt-get install chromium-browser Setting up link is missing

Now I get: Failed to launch the browser process!\n[0630/113319.336643:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.\n\n\nTROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md\n

did you able to solve the issue?

@LuisEstebanArango
Copy link

It looks like you are missing some Debian dependencies: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

It's true. I had the same issue in Debian OS. I installed chrome and it's worked for me:
sudo apt install libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libgbm1 libasound2 libpangocairo-1.0-0 libxss1 libgtk-3-0
https://gist.github.com/tavinus/7effd4b3dac87cb4366e3767679a192f

@pierrealexaline
Copy link

Launch puppeteer+chromium-headless on RPI: Yes we can ! (tested on RPI4):
Simply do:

sudo apt install chromium-browser chromium-codecs-ffmpeg

and then add:

const browser = await puppeteer.launch({
          headless: true,
          executablePath: '/usr/bin/chromium-browser',
          args: ['--no-sandbox', '--disable-setuid-sandbox']
  });

Many thanks to:

chsamii.medium.com

@rakeshsahni
Copy link

I searched extensively, but these steps worked for me:

npm install puppeteer

sudo apt install libgtk-3-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2
# libatk1.0-0 libgtk2.0-0

Here are three font packs that solved the issue. From top to bottom, an Indian font pack, an international font pack, and a font pack for China, Japan, and Korea:

sudo apt-get install fonts-indic
sudo apt-get install fonts-noto
sudo apt-get install fonts-noto-cjk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests