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

[🐛 Bug]: unknown error: cannot find Chrome binary #12381

Closed
gtach2o opened this issue Jul 19, 2023 · 22 comments
Closed

[🐛 Bug]: unknown error: cannot find Chrome binary #12381

gtach2o opened this issue Jul 19, 2023 · 22 comments
Labels

Comments

@gtach2o
Copy link

gtach2o commented Jul 19, 2023

What happened?

Hi!
After driver update it can't start the browser.
Previous driver version 114.0.5735.90 works with no issue.
Chrome version - 115.0.5790.98
Chromedriver version - 115.0.5790.98
Selenium Java 4.10.0

GoogleChromeLabs/chrome-for-testing#26

How can we reproduce the issue?

Run any tests with Chrome 115.0.5790.98 and Chromedriver 115.0.5790.98

Relevant log output

Suppressed: org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: cannot find Chrome binary 
Build info: version: '4.10.0', revision: 'c14d967899'
System info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '13.4.1', java.version: '20.0.1'


### Operating System

macos

### Selenium version

4.10.0

### What are the browser(s) and version(s) where you see this issue?

Chrome 115.0.5790.98

### What are the browser driver(s) and version(s) where you see this issue?

115.0.5790.98

### Are you using Selenium Grid?

_No response_
@github-actions
Copy link

@gtach2o, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@pixeltrix
Copy link

This is almost certainly fixed by #12208 - just needs shipping :shipit:

@gtach2o
Copy link
Author

gtach2o commented Jul 19, 2023

Thank you!
In my case Chrome 115.0.5790.98 is already installed.

Also what if those endpoints are blocked in test environment?

@soulgalore
Copy link
Contributor

I also get the same. I don't think its an Selenium issue, rather an Chromedriver issue. It works fine on Linux but on Mac the Chrome binary can't be found.

@titusfortner
Copy link
Member

Hmm, it sounds like the patch versions might not match what it finds?
Selenium 4.11 probably fixes this.

In the meantime you can use chromedriver v114 and it will still work with Chrome v115
Or you can try passing the location of Chrome v115 with the binary method in Options class and see if that works.

@soulgalore
Copy link
Contributor

soulgalore commented Jul 20, 2023

Ok. I tried setting the binary location of Chrome and it works.

I manually set Chromedriver to 115, then run with default settings, then it fails on both arm/intel Macs. On Ubuntu the same thing works. I think GoogleChromeLabs/chrome-for-testing#30 is the issue.

@gtach2o
Copy link
Author

gtach2o commented Jul 20, 2023

Can confirm Chrome - 115.0.5790.98 and Chromedriver - 115.0.5790.98 work on LInux

@pmontrasio
Copy link

By the way, without the webdrivers gems this works:

WD_CHROME_PATH=/usr/bin/google-chrome bundle exec rake spec:features

With webdrivers it insists to attempt downloading the driver for Chrome 115 and it dies with a 404 error.

@titusfortner
Copy link
Member

titusfortner commented Jul 20, 2023

Yes, looks like there is an issue locating the default Chrome location — GoogleChromeLabs/chrome-for-testing#30

@pmontrasio WD_CHROME_PATH is only used by webdrivers, so it shouldn't do anything if you aren't requiring the gem.
Without webdrivers gem Selenium should be downloading chromedriver v114, which might give a warning, but will still work.

@mathiasbynens
Copy link

https://bugs.chromium.org/p/chromium/issues/detail?id=1466427

@Akkasim46
Copy link

I still see the issue with chrome version 115 on Mac.
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: cannot find Chrome binary

@titusfortner
Copy link
Member

@Akkasim46 yes, that is the Chromium bug linked above.

@Akkasim46
Copy link

Akkasim46 commented Jul 20, 2023

As a workaround in Selenium (and macOS), you can specify the Chrome binary path as follows
ChromeOptions options = new ChromeOptions();
options.setBinary("/Applications/Google Chrome.app/Contents/MacOS/Google Chrome");
Thnx @bonigarcia

@samstickland
Copy link

I also have this error with 115 on Mac. It doesn't seem to be fixed in 4.11.0.

With 4.10.0 I get this error:

          Selenium::WebDriver::Error::UnknownError:
            unknown error: cannot find Chrome binary
          # 0   chromedriver                        0x0000000104cf6924 chromedriver + 4303140
          # 1   chromedriver                        0x0000000104cef050 chromedriver + 4272208
          # 2   chromedriver                        0x0000000104923328 chromedriver + 291624
          # 3   chromedriver                        0x000000010494ba7c chromedriver + 457340
          # 4   chromedriver                        0x000000010494affc chromedriver + 454652
          # 5   chromedriver                        0x000000010498a040 chromedriver + 712768
          # 6   chromedriver                        0x000000010498980c chromedriver + 710668
          # 7   chromedriver                        0x00000001049548d4 chromedriver + 493780
          # 8   chromedriver                        0x000000010495571c chromedriver + 497436
          # 9   chromedriver                        0x0000000104cb77dc chromedriver + 4044764
          # 10  chromedriver                        0x0000000104cbbd20 chromedriver + 4062496
          # 11  chromedriver                        0x0000000104cc1f40 chromedriver + 4087616
          # 12  chromedriver                        0x0000000104cbc824 chromedriver + 4065316
          # 13  chromedriver                        0x0000000104c94d1c chromedriver + 3902748
          # 14  chromedriver                        0x0000000104cd8414 chromedriver + 4178964
          # 15  chromedriver                        0x0000000104cd856c chromedriver + 4179308
          # 16  chromedriver                        0x0000000104ce8830 chromedriver + 4245552
          # 17  libsystem_pthread.dylib             0x00000001a4793fa8 _pthread_start + 148
          # 18  libsystem_pthread.dylib             0x00000001a478eda0 thread_start + 8
          # ./spec/rails_helper.rb:117:in `block (2 levels) in <top (required)>'

And with 4.11.0 (master) I get this error:

          Selenium::WebDriver::Error::NoSuchDriverError:
            Unable to obtain chromedriver using Selenium Manager; Selenium Manager binary located, but not a file: "/Users/sam/.gem/ruby/3.2.2/bundler/gems/selenium-0c4880463b82/rb/bin/macos/selenium-manager"; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location
          # ./spec/rails_helper.rb:117:in `block (2 levels) in <top (required)>'

And it's correct, this file does not exist: /Users/sam/.gem/ruby/3.2.2/bundler/gems/selenium-0c4880463b82/rb/bin/macos/selenium-manage

The rb directory exists, but it does not contain bin directory:

ls /Users/sam/.gem/ruby/3.2.2/bundler/gems/selenium-0c4880463b82/rb
BUILD.bazel                Gemfile                    README.md                  lib                        selenium-devtools.gemspec  spec
CHANGES                    Gemfile.lock               Rakefile                   ruby_version.bzl           selenium-webdriver.gemspec

Is there some installation stage that is missing when the gem is installed directly from github?

@samstickland
Copy link

The following command will install chromedriver 114 with homebrew, which is working with chrome 115: brew install --cask https://raw.githubusercontent.com/Homebrew/homebrew-cask/3ae9f9127a7863a581b79a78a739fb8613442491/Casks/chromedriver.rb

ndepaola added a commit to chilli-axe/mpc-autofill that referenced this issue Jul 29, 2023
@diemol
Copy link
Member

diemol commented Jul 31, 2023

Selenium 4.11.0 has been released, please upgrade and this should work.

@diemol diemol closed this as completed Jul 31, 2023
ndepaola added a commit to chilli-axe/mpc-autofill that referenced this issue Aug 1, 2023
two things going on here:
* we don't need to manually specify the binary location in macos anymore
  SeleniumHQ/selenium#12381
* setting the binary location with None no longer works
@Akkasim46
Copy link

still see the issue on Mac with the new release(4.11.0)!
Im not sure if anyone else still sees it despite the change?

@titusfortner
Copy link
Member

Please raise a new issue with your code and the logs turned on. Make sure you are not using a third party manager

@Akkasim46
Copy link

But it has not difference than this. Still need to open it as if it's a new issue?

@diemol
Copy link
Member

diemol commented Aug 1, 2023

Please do that or join our chat to share your code. It takes longer to post things here and wait for answers. https://www.selenium.dev/support/

@titusfortner
Copy link
Member

The cause of this issue has been fixed. There are many things right now that can give an error like this. We can't explain what's wrong without seeing what code isn't working.

Copy link

github-actions bot commented Dec 9, 2023

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

9 participants