titusfortner / webdrivers

Keep your Selenium WebDrivers updated automatically
MIT License
593 stars 111 forks source link

RuntimeError: Failed to make system call #162

Closed Johnsalzarulo closed 4 years ago

Johnsalzarulo commented 4 years ago

Summary

I've been stuck for hours trying to get my test suite to run on my local machine. I keep getting runtime errors. Details below.

Debug Info

Please provide the following information for bug reports:

Expected Behavior

I would expect my tests to run without RuntimeError

Actual Behavior

RuntimeError:         RuntimeError: Failed to make system call: ["/Users/johnsalzarulo/.webdrivers/chromedriver", "--version"]
            test/support/authentication_helper.rb:4:in `log_in_user'
            test/controllers/library/content_imports/content_imports_controller_test.rb:20:in `block in <class:ContentImportsControllerTest>'

2019-12-04 12:09:09 DEBUG Webdrivers Checking current version
2019-12-04 12:09:09 DEBUG Webdrivers /Users/johnsalzarulo/.webdrivers/chromedriver is already downloaded
2019-12-04 12:09:09 DEBUG Webdrivers making System call: ["/Users/johnsalzarulo/.webdrivers/chromedriver", "--version"]
2019-12-04 12:09:09 DEBUG Webdrivers Checking current version
2019-12-04 12:09:09 DEBUG Webdrivers /Users/johnsalzarulo/.webdrivers/chromedriver is already downloaded
2019-12-04 12:09:09 DEBUG Webdrivers making System call: ["/Users/johnsalzarulo/.webdrivers/chromedriver", "--version"]

What I've Tried

  1. I've found this wiki link and I've hit my head against the wall trying to update my test_helper.rb config accordingly.

For example:

driver_urls = Webdrivers::Common.subclasses.map do |driver|
  Addressable::URI.parse(driver.base_url).host
end

WebMock.disable_net_connect!(allow_localhost: true, allow: driver_urls)
  1. I've also gone round and round trying to even hardcode the driver_urls:
WebMock.disable_net_connect!(
  allow: [
    'localhost',
    '127.0.0.1',
    /selenium/,
    'chromedriver.storage.googleapis.com',
    'api.stripe.com',
    'https://chromedriver.storage.googleapis.com/LATEST_RELEASE',
    'chromedriver.storage.googleapis.com',
    'github.com',
    'selenium-release.storage.googleapis.com'
    ]
  )
  1. I tried reboots

  2. I tried uninstalling and reisntalling Chrome

  3. I've tried reinstalling my chromedriver with brew cask reinstall chromedriver

  4. I've even tried disabling Webmock and I can't seem to get my tests to run. Just constant runtime erros.

  5. I tried updating my MacOS DNS servers, just in case there was something with networking that was funky.

  6. I've tried it on multiple internet connections, just to ensure I had no firewall or proxy shenanigans.

Does anyone have any thoughts of what else I can try? Thanks so much

Johnsalzarulo commented 4 years ago

Couple updates:

A. Confirmed I have chromedriver installed

Screen Shot 2019-12-04 at 12 36 02 PM

B. Manually hunted down where it's installed in my OS

Screen Shot 2019-12-04 at 12 34 32 PM

C. Added this to my paths

Screen Shot 2019-12-04 at 12 37 06 PM

Getting same results 😢

Screen Shot 2019-12-04 at 12 38 08 PM
kapoorlakshya commented 4 years ago

Hey @Johnsalzarulo, that error typically means that the gem was unable to execute the driver binary for some reason. It is unrelated to Webmock, DNS, or Chrome.

Can you undo step 5 (brew install) and step C (add to path), and then try to manually extract the version from the downloaded file? Maybe even delete the existing chromedriver file and redownload it using the gem before executing this:

Users/johnsalzarulo/.webdrivers/chromedriver --version

It should return version 78 dot something to match your Chrome version. If you're unable to execute it manually, whatever error you see in the terminal is what's causing the RuntimeError.

Johnsalzarulo commented 4 years ago

@kapoorlakshya

Thank you so much for your support. Seriously people like you are what make the world a good place.

I gave it a shot based on your suggestions with no luck.

For some reason in trying to make things work, I tossed gem "chromedriver-helper" into my gemfile and this got things up and running. I see it's depreciated but at the moment — I'm productive again when I remove it things crash again.

I'm closing the issue now, hopefully these breadcrumbs help others.

As well — at some point, I should probably dig deeper into my system to solve the root problem.

Thanks again so much. 👍

genzade commented 3 years ago

FWIW and for anyone landing here i solved this by running

$ rm -rf ~/.webdrivers                           # remove the webdrivers directory
$ RAILS_ENV=test bin/rails webdrivers:chromedriver:update