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
Using under Docker, using Arm images, on M1 Mac causes error #213
Comments
We are having this issue on M1 Macs, too |
This looks like a valid use case that we could consider supporting in the future, but I, unfortunately, don't have a M1 mac to investigate/troubleshoot or fix this. If the chromedriver downloads site starts providing arm binaries, then this could be easy to support. I know the electron project releases various arm binaries, but their versioning does not match the Chrome versioning, which is what If anyone has any ideas or is interested in submitting a PR for this, I'd be happy to collaborate and/or review PR(s). |
Not sure if this is related, but I have the new mac-mini with the M1 processor. I used RVM to install Ruby 2.6. When I ran 'webdrivers' to install chromedriver, I got the x86 version and the install failed with: For some reason, when I used RVM to install 2.7, the 'webdrivers' gem installed the correct chromedriver. I traced the problem to the value of RUBY_PLATFORM. For my Ruby 2.6 install the value is '-darwin20' and for Ruby 2.7 the value is 'arm64-darwin20' This caused 'Webdrivers::System.apple_m1_architecture?' to return false for 2.6 and true for 2.7 (see line 152 in '/webdrivers/blob/master/lib/webdrivers/system.rb). I googled and read that RUBY_PLATFORM is set by 'rbconfig.rb.' I don't know much about rbconfig.rb. It seems that RVM failed to configure it correctly for 2.6. When I looked for 'rbconfig.rb' file on my system, I saw this: I need to run Ruby version 2.6, so my solution was to hack 'Webdrivers::System.apple_m1_architecture?' in '/Users/tgodwin/.rvm/gems/ruby-2.6.6/gems/webdrivers-4.6.0/lib/webdrivers/system.rb' to return true. This way I can still use webdrivers to keep my chromedriver up to date: % gem list webdrivers % uname -prm Hope this helps. p.s. I am not running Docker. This is all about native MacOS with the M1 processor. |
@agodwin Don't think your issue is related to the main one, but we can address it anyway. Just to be sure, could you also confirm if installing Ruby 2.6 with |
@kapoorlakshya As much as I want to help, I am not going to take the time to retest with rbenv. Best of luck |
If someone is passing by here with the same issue, I can confirm that the Ruby version, for me was in case. I use rbenv, and the project I was working on used ruby 2.5. Running the test, using Updating to Ruby 2.7, makes the error go away. |
Sounds like the solution is to upgrade to 2.7 |
Hello! I'm still running into this issue, I'm using |
This only relates to native macOS without docker. The issue still persists for linux arm64 images which is the reason the issue was opened in the first place. |
I'll reopen while we check it out. I've been working on how to get all of this functionality directly into Selenium. Ideally we won't need a separate project to manage drivers in the near future. |
Does anybody have any individual winning combination (chrome version + electron version) using the electron releases? Maybe at least as a semi-workable solution |
|
@titusfortner Any updates on this? |
I'm much more interested in getting things working with Selenium going forward. Can you update to Selenium 4.11, remove this gem and we can figure out what it needs to do that it isn't? |
I tried it with Chromdriver is installed successfully at location But it's not able to connnect to the driver
What I am doing wrong here? |
Which driver needs to be downloaded to work on your OS? I kind of think this needs to be an issue raised with Google if they don't offer one. Does Edge have one? |
I am trying to use google chrome browser with the Chromedriver. I'll check if it's working with Edge or not. And let you know |
Right, does google provide a driver that works for Linux/Arm? Do you have something working manually that you want provided automatically, or are you just looking for something that works? |
I attempted the installation of the chromedriver on Debian using the following link: https://packages.debian.org/buster/chromium-driver. The installation was successful, and the chromedriver is now located at the path /usr/bin/chromedriver. It is functioning properly. However, I encountered an issue while configuring it with selenium-webdriver version 4.11.0. The problem stems from a version discrepancy between the Chrome browser and the chromedriver. This difference is noticeable in the selenium-manager.json file. On the other hand, I achieved success with selenium-webdriver version 4.6.1. By specifying the driver path as Selenium::WebDriver::Chrome::Service.driver_path = '/usr/bin/chromedriver', I was able to solve issues and attain proper functionality |
Yeah, there's some concern about how to manage drivers that aren't provided by the browser vendor directly The alternative manually updating the known-good driver version as necessary and putting them in a location on PATH as you are doing. You can set the browser not to automatically update versions, or use Chrome for Testing binaries which won't auto update. |
I had written a article on how to solve this problem, anyone interested please give a read. https://www.elitmus.com/blog/technology/demystifying-rails-7-system-tests-configuring-ci-pipeline/ cc: @titusfortner |
Summary
Docker Desktop for Mac on M1, by default, where possible pulls Linux images to match the M1 architecture. When such an image uses the webdrivers gem, it downloads and attempts to use a Linux chromedriver built for x86 CPUs. This causes an error when the gem tries to launch the driver. Note that the repository of chromedrivers from which webdrivers pull the driver only has linux-x86 compiled drivers, so it's not clear if this can be solved.
Debug Info
Please provide the following information for bug reports:
Expected Behavior
webdrivers should use a chromedriver built for Linux on an arm CPU.
Actual Behavior
An error is thrown and execution is aborted:
The text was updated successfully, but these errors were encountered: