-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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: no chrome binary and Arg list too long #13632
Comments
@ahmet-ozer-pro, thank you for creating this issue. We will troubleshoot it as soon as we can. Info for maintainersTriage this issue by using labels.
If information is missing, add a helpful comment and then
If the issue is a question, add the
If the issue is valid but there is no time to troubleshoot it, consider adding the
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable
After troubleshooting the issue, please add the Thank you! |
Are you using a different Selenium Manager version? What happens if you move to 4.18.1? |
Hi @diemol,
*** LOCAL GEMS *** selenium-webdriver (4.18.1) E, [2024-02-28T08:59:40.439921 #12500] ERROR -- : FAILED ==> Unable to obtain chromedriver using Selenium Manager; Unsuccessful command executed: ["C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/selenium-webdrive Failing Scenarios: 17 scenarios (13 failed, 4 passed) |
We need more information about this issue in order to troubleshoot. Please turn on logging and re-run your code. Information on how to adjust logs for your language can be found in our |
The log record in json format of one of the error scenarios is as follows:
|
@titusfortner do you know why the @ahmet-ozer-pro what locale/language do you have set in your host? |
@diemol my locale/language setup is as below ~ % locale |
Thanks, @ahmet-ozer-pro. I'll let @titusfortner and @p0deje have a look, they are our Ruby experts. |
Thank you, I look forward to your return. |
|
1- Code that initializes the driver class Driver def self.get_driver Selenium::WebDriver.logger.level = :debug case BaseConfig.browser when 'chrome' options = Selenium::WebDriver::Chrome::Options.new add_default_values(options) Capybara.register_driver :selenium do |app| Capybara::Selenium::Driver.new(app, browser: :chrome, options: options) end when 'firefox' options = Selenium::WebDriver::Firefox::Options.new add_default_values(options) Capybara.register_driver :selenium do |app| Capybara::Selenium::Driver.new(app, browser: :firefox, options: options) end when 'remote-chrome' options = Selenium::WebDriver::Chrome::Options.new add_default_values(options) Capybara.register_driver :selenium do |app| Capybara::Selenium::Driver.new(app, browser: :chrome, url: BaseConfig.remote_url, options: options) end when 'remote-firefox' options = Selenium::WebDriver::Firefox::Options.new add_default_values(options) Capybara.register_driver :selenium do |app| Capybara::Selenium::Driver.new(app, browser: :remote, url: BaseConfig.remote_url, options: options) end end end def self.add_default_values(options) options.add_argument('--disable-popup-blocking') options.add_argument('--ignore-certificate-errors') options.add_argument('--disable-notifications') add_headless_options(options) if BaseConfig.headless == 'true' end def self.add_headless_options(options) Loggers.log_info('Execution is running headless mode!') options.add_argument('--no-sandbox') options.add_argument('--headless') options.add_argument('--window-size=1280,720') options.add_argument('--disable-dev-shm-usage') options.add_argument('--disable-gpu') options.add_argument('--test-type=browse') options.add_argument("--user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36"); #options.add_argument('--binary=C:\Program Files\Google\Chrome\Application\chrome.exe') end end 2- Output logs are as follows D, [2024-03-05T00:39:15.677302 #9980] DEBUG -- : Stopping fixture: Before hook (hooks.rb:1) Scenario: GRJ-462 Çıkış İşlemi onaylama-fotoğraf yükleme # features/tests/E2E/E2E-3-Suruculu_KampusDisi_TopluOnayTalepSureci.feature:52 Failing Scenarios: 13 scenarios (9 failed, 4 passed) |
@ahmet-ozer-pro Something sets up an extremely long path to Chrome binary. In your example, you have the following commented out: options.add_argument('--binary=C:\Program Files\Google\Chrome\Application\chrome.exe') Can you try uncommenting it and changing to? options.add_argument('--binary="C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"') |
@p0deje I did what you said, but nothing changed. I keep getting the same error. This project works on both MacOS and Windows operating systems. We do not receive such an error on macOS. Sorry, I accidentally shared the Mac's locale/language setup. The correct Windows machine locale/language setup is as follows:
Output: \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\chrome.exe", "--language-binding", "ruby", "--output", "json", "--debug"] Failing Scenarios: 13 scenarios (9 failed, 4 passed) |
@ahmet-ozer-pro Do you still see the same problem if you just run the following Ruby code? Selenium::WebDriver.for(:chrome).quit |
@p0deje Nothing changed, I get the same error. It can run a few scenarios that I don't understand, but then it gives this error. Could there be a bug in selenium_manager.rb? Were you able to reproduce this error in your locale? I get this error when I run the command "cucumber --tags '@deneme-1'" on the command line. I do not receive such an error when I run a single test suite or scenario with the play button. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
There is a code escaping a path to Chrome:
However, it should not generate such a long string unless it's given already a huge sting with escaped characters. It also only is enabled when you pass a I don't think it's related to a locale and I cannot reproduce this on my Windows machine.
That's confusing, are you using the same code for starting a browser? I assume it's failing all the time. Can you please extract the browser starting code into a separate Ruby script that reproduces the failure all the time for you? I would then attempt to run the same script on my Windows machine. @titusfortner Do you think we should just change |
How can our code possibly generate that? It almost looks like it is mutating and retrying? |
@ahmet-ozer-pro, thank you for creating this issue. We will troubleshoot it as soon as we can. Info for maintainersTriage this issue by using labels.
If information is missing, add a helpful comment and then
If the issue is a question, add the
If the issue is valid but there is no time to troubleshoot it, consider adding the
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable
After troubleshooting the issue, please add the Thank you! |
@ahmet-ozer-pro I've just pushed a66db94 which might fix the problem, but I would like to ask you to test it before doing a release. Tomorrow, a new nightly version of the selenium-webdriver gem containing my change will be published to https://github.com/SeleniumHQ/selenium/pkgs/rubygems/selenium-webdriver. Can you try switching to it in your Gemfile (see https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-rubygems-registry#authenticating-to-github-packages) and check if it helps with the problem? If not, please upload loads to gist.github.com and share once again. |
I am also experiencing this issue with an upgrade to |
@p0deje I tried installing the indicated nightly build and it did not resolve my issue. |
@housepage Can you please share the logs per https://www.selenium.dev/documentation/webdriver/troubleshooting/logging/? |
Here are the logs per your request:
Same exact error happens on 4.15.0 the whole way up to the nightly you had a proposed fix in. The one thing I noticed is that my Chrome does start with errors:
but those errors are known issues and Chrome starts as normal so I wonder if Chromedriver is incorrectly interpreting those startup messages as a failure to boot? |
I was able to get rid of the NSS error and this was still occurring. I was able to repro the failure directly against ChromeDriver using the information provided by the verbose logging. I was able to successfully launch Chrome by removing |
I was able to get things to come up successfully. My chromedriver version was behind my googlechrome's patch patch version.
I got everything to work successfully by manually downloading chromedriver 122.0.6261.128 to match my chrome and replacing my local binary directly in /usr/bin. Shouldn't selenium-manager be pulling that in more up to date version in? Why am I using the out of date chromedriver? |
Ah so this looks like perhaps why I had |
@ahmet-ozer-pro I think I have some info for you and things you could look at to see if your problem is the same as mine. |
@p0deje I made the changes to the selenium_manager.rb file on my computer just like you did. It seems to be working fine now. If there's any issue, I'll let you know. Thanks a lot for your help and effort. |
Closing as this should be already fixed. |
This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs. |
What happened?
What happened:
I encountered an error while running my test suites with the command 'cucumber --tags '@smoke_1'. After executing a few success scenarios, the following error occurred:
Error:
E, [2024-02-27T09:32:17.275400 #5876] ERROR -- : unknown error: no chrome binary at C:\Program Files\Google\Chrome\Application\chrome.exe "--language-binding", "ruby", "--output", "json"]; Arg list too long - C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/selenium-webdriver-4.17.0/bin/windows/selenium-manager.exe; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location
How can we reproduce the issue?
Relevant log output
Operating System
Windows 11
Selenium version
Ruby selenium-webdriver-4.17.0
What are the browser(s) and version(s) where you see this issue?
Chrome 121.0.6167.161
What are the browser driver(s) and version(s) where you see this issue?
ChromeDriver 121.0.6167.85
Are you using Selenium Grid?
n/a
The text was updated successfully, but these errors were encountered: