-
Notifications
You must be signed in to change notification settings - Fork 9k
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
Comments
It looks like you are missing some Debian dependencies: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md |
Thanks @JoelEinbinder It worked. |
I am having the same issue. All the debian dependencies are installed. Any advice to make chromium run? |
@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. |
@Garbee looks like it was an issue with my OS (I had tested it on an old test vm with Ubuntu 14.04) For the record, the error message was: |
|
Huh that's weird it was definetly a x86 machine that I got the error on. |
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. |
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 |
Arrived here in that (now closed) after I made troubleshooting why puppeteer won't start. I've tried to execute the puppeteer launch script from above
and got this result:
|
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. |
const browser = await puppeteer.launch({ |
I got the following error when I tried to run it on my amazon linux bash-4.2$ vi chrome |
bash-4.2$ ldd chrome | grep not |
Check the required dependencies. As mentioned previously. This is your installation missing a required 3rd party library package, not a problem with Puppeteer. |
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? |
@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. |
Hi there,
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:
So I tried with the real Chrome on my machine, changing the 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:
Can somebody help me out understanding what's happening? |
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 |
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! Please advise. Thanks in advance |
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: |
I also get the same issue But it solves in my case.
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. |
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 |
@Garbee ,Getting the below road blocker ,can you or anyone please help? Specificationsnpm = 6.12.1 Errorkkadapa@homn:/vc-devgh-checkouts/screenshots$ node index.js TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
(node:17842) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'newPage' of undefined |
This error happened to me also. |
if you get Failed to launch the browser process |
@HERBOD7 solved my problem, thank you! |
Solved my issue too. Thanks! |
I have run command 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 |
UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process! I am getting this error, Please help guys |
The same here when deploying to Heroku. No luck :( Error: Failed to launch chrome! |
I got same error. For me fix was in this comment: #3443 (comment)
|
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 |
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. |
This worked for me:
|
did you able to solve the issue? |
It's true. I had the same issue in Debian OS. I installed chrome and it's worked for me: |
Launch puppeteer+chromium-headless on RPI: Yes we can ! (tested on RPI4):
and then add:
Many thanks to: |
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 |
Steps to reproduce
Tell us about your environment:
What steps will reproduce the problem?
Try the demo code to launch puppeteer in ubuntu 16.04 EC2 amazon AWS.
Code used:
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
The text was updated successfully, but these errors were encountered: