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 start and/or connect to Chrome. Please make sure Chrome is running #521

Closed
abriginets opened this issue Jun 15, 2018 · 4 comments

Comments

@abriginets
Copy link

Hello. I'm trying to run Prerender on my VPS but unsuccessfully. I did everything like README says but stiil can't launch it. I tried to run node server.js, but console throws an error:

2018-06-15T15:42:50.714Z Starting Prerender
2018-06-15T15:42:50.716Z Starting Chrome
2018-06-15T15:42:50.717Z unable to find Chrome install. Please specify with chromeLocation
2018-06-15T15:42:50.718Z Prerender server accepting requests on port 3000
2018-06-15T15:42:50.718Z undefined
2018-06-15T15:42:50.719Z Failed to start and/or connect to Chrome. Please make sure Chrome is running
2018-06-15T15:42:50.719Z Stopping Chrome

Then I've changed my config to:

var server = prerender({
    chromeLocation: './lib/browsers/'
});

But still I'm having an issue with this:

2018-06-15T15:45:39.971Z Starting Prerender
2018-06-15T15:45:39.973Z Starting Chrome
2018-06-15T15:45:39.978Z Prerender server accepting requests on port 3000
2018-06-15T15:45:39.979Z { Error: spawn EACCES
    at ChildProcess.spawn (internal/child_process.js:330:11)
    at exports.spawn (child_process.js:500:9)
    at Promise (/var/www/developer/flaut/dev/prerender/lib/browsers/chrome.js:24:22)
    at new Promise (<anonymous>)
    at Object.chrome.spawn (/var/www/developer/flaut/dev/prerender/lib/browsers/chrome.js:15:9)
    at Object.server.spawnBrowser (/var/www/developer/flaut/dev/prerender/lib/server.js:93:22)
    at Promise (/var/www/developer/flaut/dev/prerender/lib/server.js:69:8)
    at new Promise (<anonymous>)
    at Object.server.startPrerender (/var/www/developer/flaut/dev/prerender/lib/server.js:68:9)
    at Object.server.start (/var/www/developer/flaut/dev/prerender/lib/server.js:48:7) errno: 'EACCES', code: 'EACCES', syscall: 'spawn' }
2018-06-15T15:45:39.983Z Failed to start and/or connect to Chrome. Please make sure Chrome is running
2018-06-15T15:45:39.983Z Stopping Chrome

Any ideas on how could I fix that? Many thanks.

@daniel-keller
Copy link

I had a similar issue. After more digging into the documentation I found that chrome isn't included in with prerender (https://github.com/prerender/prerender#chromelocation). The chromeLocation that you are using in your configuration only contains a javascript interface for chrome. You will need to install Chrome separately and then Update your chromeLocation to point to the installation.

@abriginets
Copy link
Author

Hello, @daniel-keller! Thank you for your help. How should I install Headless Chrome? It's an Ubuntu package or npm package? Much thanks in advance.

@daniel-keller
Copy link

On ubuntu I did it through apt-get https://askubuntu.com/a/510186. After installing I changed the chromeLocation to "/usr/bin/google-chrome-stable". I did run into an issue where prerender would launch chrome and then immediately die. The only solution I've found for this #450 but I think that this solution opens up some security holes so I'm still looking for a better solution.

@thoop
Copy link
Contributor

thoop commented Jun 25, 2018

Sorry for the delay here. @daniel-keller thanks for the help!

https://www.ubuntuupdates.org/ppa/google_chrome?dist=stable is a good way to install Chrome on Ubuntu. We've used that package without any issues connecting or immediately dying so please let us know if you run into anything like that!

@JamesJGoodwin feel free to reopen or create a new issue if you run into any problems after you get Chrome downloaded and we'll try to make that more clear in the documentation.

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

3 participants