Selenium says chrome is unreachable, works fine locally

I’m trying to run some specs using Selenium/Capybara along with Chrome and chromedriver; however, CircleCI fails the build with the following error:

Selenium::WebDriver::Error::WebDriverError:
            chrome not reachable
              (Session info: headless chrome=73.0.3683.86)
              (Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Linux 4.4.0-141-generic x86_64)

Mind you, it works perfectly locally when I run it directly or via the circleci CLI. Here’s the portion of my config.yml where I install Chrome and chromedriver:

- run:
          name: Install dependencies
          command: |
            apt-get update 
            curl -sS https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
            apt-get update && apt-get install google-chrome-stable=73.0.3683.86-1
            wget https://chromedriver.storage.googleapis.com/73.0.3683.68/chromedriver_linux64.zip && unzip chromedriver_linux64.zip -d /usr/local/bin && rm chromedriver_linux64.zip

There are no errors during the install, and everything seems to end up in the right place. I’ve tired bumping versions of the browser and the driver to no avail. I used http://chromedriver.chromium.org/downloads/version-selection to arrive on the versions I ended up using, but they seem incompatible.

Any help is much appreciated, thanks!

It turns out it was a permissions issue on the chromedriver, running chmod +x /usr/local/bin/chromedriver resolved everything. Hope this helps someone not waste 6+ hours debugging like I just did :).

1 Like

Thanks that’s useful to know. I had the same error using after switching to circleci/ruby:2.6.2-node-browsers. I used the google-chrome/chromedriver in the image, without upgrading them, but my issue turned out to be my use of the --disable-dev-shm-usage argument in Selenium::WebDriver::Chrome::Options - removing this fixed the error though not sure why yet.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.