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

RuntimeError: Failed to make system call #162

Closed
Johnsalzarulo opened this issue Dec 4, 2019 · 4 comments
Closed

RuntimeError: Failed to make system call #162

Johnsalzarulo opened this issue Dec 4, 2019 · 4 comments

Comments

@Johnsalzarulo
Copy link

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:

  • Webdrivers version: gem "webdrivers", "~> 4.0"
  • Ruby version: ruby 2.5.0
  • Operating system / CI Environment: MacOS 10.14.4
  • Browser and version: Chrome 78.0.3904.108

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
Copy link
Author

Johnsalzarulo commented Dec 4, 2019

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
Copy link
Collaborator

kapoorlakshya commented Dec 4, 2019

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
Copy link
Author

@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
Copy link

genzade commented Aug 26, 2021

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

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