heroku / heroku-buildpack-google-chrome

[DEPRECATED] Classic buildpack that installs Google Chrome.
296 stars 365 forks source link

Chrome failed to start #106

Closed floor114 closed 3 years ago

floor114 commented 3 years ago

I've started getting this error after today's deployment to Heroku. Nothing has changed from the configurations side.

Selenium::WebDriver::Error::UnknownError (unknown error: Chrome failed to start: exited abnormally.)
  (chrome not reachable)
  (The process started from chrome location /app/.apt/usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

I thought chromedriver v88.0.4324.96 might be the reason, but setting CHROMEDRIVER_VERSION=87.0.4280.88 didn't help.

Here is my previously working ruby code

options = Selenium::WebDriver::Chrome::Options.new
options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
options.add_argument('--disable-gpu')
options.add_argument('--remote-debugging-port=9222')
driver = Selenium::WebDriver.for :chrome, options: options
voith commented 3 years ago

Our builds too started failing a few hours ago. We are getting the following error:

E       selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally.
E         (unknown error: DevToolsActivePort file doesn't exist)
E         (The process started from chrome location /app/.apt/usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

I tried --remote-debugging-port=9222, --disable-dev-shm-usage. But none of that fixes the build.

voith commented 3 years ago

I started the heroku CI in debug mode. I noticed that chrome binary is failing to instantiate. Here's the error I get:

~ $ google-chrome
/app/.apt/usr/bin/google-chrome: line 2: [: =: unary operator expected
/app/.apt/usr/bin/google-chrome: line 4: [: =: unary operator expected
/app/.apt/opt/google/chrome/chrome: error while loading shared libraries: libxshmfence.so.1: cannot open shared object file: No such file or directory

This definitely seems like a buildpack related issue to me.

cimm commented 3 years ago

We are seeing the same issue on Heroku CI. For the record, this looks like a duplicate of #105.

voith commented 3 years ago

@cimm Thanks for the link. I fixed our CI by following https://github.com/heroku/heroku-buildpack-google-chrome/issues/105#issuecomment-789724688.

floor114 commented 3 years ago

I assume it should be fixed here https://github.com/heroku/heroku-buildpack-google-chrome/pull/104

floor114 commented 3 years ago

Closing an issue due to resolution in https://github.com/heroku/heroku-buildpack-google-chrome/issues/105#issuecomment-789724688.

  1. Run heroku buildpacks:add --index 1 https://github.com/heroku/heroku-buildpack-apt if you need it outside CI. Modify your app.json file in case you need it in CI.
"environments": {
  "test": {
    ...
    "buildpacks": [
      {
        ... 
        "url": ""
      }
    ]
  }
}
  1. Create Aptfile in the root folder with libxshmfence-dev inside.