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]: Selenium fails to find chrome binary after 4.20.1 #13918

Closed
shouichi opened this issue May 8, 2024 · 9 comments
Closed

[🐛 Bug]: Selenium fails to find chrome binary after 4.20.1 #13918

shouichi opened this issue May 8, 2024 · 9 comments

Comments

@shouichi
Copy link

shouichi commented May 8, 2024

What happened?

Selenium fails to find chrome binary after 4.20.1. Reverting to 4.19.0 solves the problem.

The key difference here seems to be the presence of :browser_path. 4.19.0 always calls SeleniumManager and :browser_path is present. 4.20.1 does not always call SeleniumManager and :browser_path can be absent 1. FYI: Rails sets Selenimu::WebDriver::Service.driver_path 2.

I tried modifying driver_finder.rb line 53 3 to if path && false to force invoke SeleniumManager, it worked correctly in 4.20.1.

See also #13386.

Thank you.

How can we reproduce the issue?

- No system-level installation of chrome or chromium.
- Create a fresh new rails app (the rails version is 7.1)
- Run a system test

Relevant log output

2024-05-08 15:37:02 INFO Selenium [:logger_info] Details on how to use and modify Selenium logger:
  https://selenium.dev/documentation/webdriver/troubleshooting/logging

2024-05-08 15:37:02 WARN Selenium [DEPRECATION] DriverFinder.path(options, service_class) is deprecated. Use DriverFinder.new(options, service).driver_path instead.
2024-05-08 15:37:02 INFO Selenium [:logger_info] Details on how to use and modify Selenium logger:
  https://selenium.dev/documentation/webdriver/troubleshooting/logging

2024-05-08 15:37:02 WARN Selenium [DEPRECATION] DriverFinder.path(options, service_class) is deprecated. Use DriverFinder.new(options, service).driver_path instead.
2024-05-08 15:37:02 DEBUG Selenium [:selenium_manager] Selenium Manager binary found at /home/shouichi/.asdf/installs/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/selenium-webdriver-4.20.1/bin/linux/selenium-manager 
2024-05-08 15:37:02 DEBUG Selenium [:selenium_manager] Executing Process ["/home/shouichi/.asdf/installs/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/selenium-webdriver-4.20.1/bin/linux/selenium-manager", "--browser", "chrome", "--language-binding", "ruby", "--output", "json", "--debug"] 
2024-05-08 15:37:02 DEBUG Selenium [:selenium_manager] Selenium Manager binary found at /home/shouichi/.asdf/installs/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/selenium-webdriver-4.20.1/bin/linux/selenium-manager 
2024-05-08 15:37:02 DEBUG Selenium [:selenium_manager] Executing Process ["/home/shouichi/.asdf/installs/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/selenium-webdriver-4.20.1/bin/linux/selenium-manager", "--browser", "chrome", "--language-binding", "ruby", "--output", "json", "--debug"] 
2024-05-08 15:37:02 DEBUG Selenium [:selenium_manager] chromedriver not found in PATH 
2024-05-08 15:37:02 DEBUG Selenium [:selenium_manager] chromedriver not found in PATH 
2024-05-08 15:37:02 DEBUG Selenium [:selenium_manager] chrome not found in PATH 
2024-05-08 15:37:02 DEBUG Selenium [:selenium_manager] chrome not found in the system 
2024-05-08 15:37:02 DEBUG Selenium [:selenium_manager] chrome not found in PATH 
2024-05-08 15:37:02 DEBUG Selenium [:selenium_manager] chrome not found in the system 
2024-05-08 15:37:02 DEBUG Selenium [:selenium_manager] Required browser: chrome 124.0.6367.155 
2024-05-08 15:37:02 DEBUG Selenium [:selenium_manager] Required browser: chrome 124.0.6367.155 
2024-05-08 15:37:02 DEBUG Selenium [:selenium_manager] chrome 124.0.6367.155 already exists 
2024-05-08 15:37:02 DEBUG Selenium [:selenium_manager] chrome 124.0.6367.155 already exists 
2024-05-08 15:37:02 DEBUG Selenium [:selenium_manager] chrome 124.0.6367.155 is available at /home/shouichi/.cache/selenium/chrome/linux64/124.0.6367.155/chrome 
2024-05-08 15:37:02 DEBUG Selenium [:selenium_manager] chrome 124.0.6367.155 is available at /home/shouichi/.cache/selenium/chrome/linux64/124.0.6367.155/chrome 
2024-05-08 15:37:02 DEBUG Selenium [:selenium_manager] Required driver: chromedriver 124.0.6367.155 
2024-05-08 15:37:02 DEBUG Selenium [:selenium_manager] Required driver: chromedriver 124.0.6367.155 
2024-05-08 15:37:02 DEBUG Selenium [:selenium_manager] chromedriver 124.0.6367.155 already in the cache 
2024-05-08 15:37:02 DEBUG Selenium [:selenium_manager] chromedriver 124.0.6367.155 already in the cache 
2024-05-08 15:37:02 DEBUG Selenium [:selenium_manager] Driver path: /home/shouichi/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver 
2024-05-08 15:37:02 DEBUG Selenium [:selenium_manager] Driver path: /home/shouichi/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver 
2024-05-08 15:37:02 DEBUG Selenium [:selenium_manager] Browser path: /home/shouichi/.cache/selenium/chrome/linux64/124.0.6367.155/chrome 
2024-05-08 15:37:02 DEBUG Selenium [:selenium_manager] Browser path: /home/shouichi/.cache/selenium/chrome/linux64/124.0.6367.155/chrome 
2024-05-08 15:37:02 DEBUG Selenium Skipping Selenium Manager; path to chromedriver specified in service class: /home/shouichi/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver
2024-05-08 15:37:02 DEBUG Selenium Skipping Selenium Manager; path to chromedriver specified in service class: /home/shouichi/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver
2024-05-08 15:37:02 DEBUG Selenium [:driver_service] Executing Process ["/home/shouichi/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver", "--port=9515"] 
2024-05-08 15:37:02 DEBUG Selenium [:driver_service] Executing Process ["/home/shouichi/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver", "--port=9515"] 
2024-05-08 15:37:02 DEBUG Selenium [:process] Starting process: ["/home/shouichi/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver", "--port=9515"] with {[:out, :err]=>#<IO:<STDERR>>, :pgroup=>true} 
2024-05-08 15:37:02 DEBUG Selenium [:process] Starting process: ["/home/shouichi/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver", "--port=9515"] with {[:out, :err]=>#<IO:<STDERR>>, :pgroup=>true} 
2024-05-08 15:37:02 DEBUG Selenium [:process]   -> pid: 3928385 
2024-05-08 15:37:02 DEBUG Selenium [:process]   -> pid: 3928385 
2024-05-08 15:37:02 DEBUG Selenium [:driver_service] polling for socket on ["127.0.0.1", 9515] 
2024-05-08 15:37:02 DEBUG Selenium [:driver_service] polling for socket on ["127.0.0.1", 9515] 
Starting ChromeDriver 124.0.6367.155 (df4f029328b2d50a2a4c02c8952b75245983a0ed-refs/branch-heads/6367@{#1097}) on port 9515
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
Starting ChromeDriver 124.0.6367.155 (df4f029328b2d50a2a4c02c8952b75245983a0ed-refs/branch-heads/6367@{#1097}) on port 9515
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
ChromeDriver was started successfully.
2024-05-08 15:37:02 DEBUG Selenium [:command] -> POST session 
2024-05-08 15:37:02 DEBUG Selenium [:command] -> POST session 
2024-05-08 15:37:02 DEBUG Selenium [:command]    >>> http://127.0.0.1:9515/session | {"capabilities":{"alwaysMatch":{"browserName":"chrome","goog:chromeOptions":{}}}} 
2024-05-08 15:37:02 DEBUG Selenium [:command]    >>> http://127.0.0.1:9515/session | {"capabilities":{"alwaysMatch":{"browserName":"chrome","goog:chromeOptions":{}}}} 
2024-05-08 15:37:02 DEBUG Selenium [:header]      > {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=UTF-8", "User-Agent"=>"selenium/4.20.1 (ruby linux)", "Content-Length"=>"81"} 
2024-05-08 15:37:02 DEBUG Selenium [:header]      > {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=UTF-8", "User-Agent"=>"selenium/4.20.1 (ruby linux)", "Content-Length"=>"81"} 
2024-05-08 15:37:02 DEBUG Selenium [:header]    <<<  {"content-length"=>["689"], "content-type"=>["application/json; charset=utf-8"], "cache-control"=>["no-cache"]} 
2024-05-08 15:37:02 DEBUG Selenium [:header]    <<<  {"content-length"=>["689"], "content-type"=>["application/json; charset=utf-8"], "cache-control"=>["no-cache"]} 
2024-05-08 15:37:02 DEBUG Selenium [:command] <- {"value":{"error":"unknown error","message":"unknown error: cannot find Chrome binary","stacktrace":"#0 0x619cd240cdf3 \u003Cunknown>\n#1 0x619cd20fb4e7 \u003Cunknown>\n#2 0x619cd212d5b3 \u003Cunknown>\n#3 0x619cd212b9c0 \u003Cunknown>\n#4 0x619cd21747f0 \u003Cunknown>\n#5 0x619cd21681f3 \u003Cunknown>\n#6 0x619cd213928a \u003Cunknown>\n#7 0x619cd2139c5e \u003Cunknown>\n#8 0x619cd23d111b \u003Cunknown>\n#9 0x619cd23d506b \u003Cunknown>\n#10 0x619cd23bd231 \u003Cunknown>\n#11 0x619cd23d5bd2 \u003Cunknown>\n#12 0x619cd23a20ef \u003Cunknown>\n#13 0x619cd23fbf48 \u003Cunknown>\n#14 0x619cd23fc120 \u003Cunknown>\n#15 0x619cd240bf44 \u003Cunknown>\n#16 0x730027497b5a \u003Cunknown>\n"}} 
2024-05-08 15:37:02 DEBUG Selenium [:command] <- {"value":{"error":"unknown error","message":"unknown error: cannot find Chrome binary","stacktrace":"#0 0x619cd240cdf3 \u003Cunknown>\n#1 0x619cd20fb4e7 \u003Cunknown>\n#2 0x619cd212d5b3 \u003Cunknown>\n#3 0x619cd212b9c0 \u003Cunknown>\n#4 0x619cd21747f0 \u003Cunknown>\n#5 0x619cd21681f3 \u003Cunknown>\n#6 0x619cd213928a \u003Cunknown>\n#7 0x619cd2139c5e \u003Cunknown>\n#8 0x619cd23d111b \u003Cunknown>\n#9 0x619cd23d506b \u003Cunknown>\n#10 0x619cd23bd231 \u003Cunknown>\n#11 0x619cd23d5bd2 \u003Cunknown>\n#12 0x619cd23a20ef \u003Cunknown>\n#13 0x619cd23fbf48 \u003Cunknown>\n#14 0x619cd23fc120 \u003Cunknown>\n#15 0x619cd240bf44 \u003Cunknown>\n#16 0x730027497b5a \u003Cunknown>\n"}} 
2024-05-08 15:37:02 DEBUG Selenium Skipping Selenium Manager; path to chromedriver specified in service class: /home/shouichi/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver
2024-05-08 15:37:02 DEBUG Selenium Skipping Selenium Manager; path to chromedriver specified in service class: /home/shouichi/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver
2024-05-08 15:37:02 DEBUG Selenium [:driver_service] Executing Process ["/home/shouichi/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver", "--port=9516"] 
2024-05-08 15:37:02 DEBUG Selenium [:driver_service] Executing Process ["/home/shouichi/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver", "--port=9516"] 
2024-05-08 15:37:02 DEBUG Selenium [:process] Starting process: ["/home/shouichi/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver", "--port=9516"] with {[:out, :err]=>#<IO:<STDERR>>, :pgroup=>true} 
2024-05-08 15:37:02 DEBUG Selenium [:process] Starting process: ["/home/shouichi/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver", "--port=9516"] with {[:out, :err]=>#<IO:<STDERR>>, :pgroup=>true} 
2024-05-08 15:37:02 DEBUG Selenium [:process]   -> pid: 3928391 
2024-05-08 15:37:02 DEBUG Selenium [:process]   -> pid: 3928391 
2024-05-08 15:37:02 DEBUG Selenium [:driver_service] polling for socket on ["127.0.0.1", 9516] 
2024-05-08 15:37:02 DEBUG Selenium [:driver_service] polling for socket on ["127.0.0.1", 9516] 
Starting ChromeDriver 124.0.6367.155 (df4f029328b2d50a2a4c02c8952b75245983a0ed-refs/branch-heads/6367@{#1097}) on port 9516
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
Starting ChromeDriver 124.0.6367.155 (df4f029328b2d50a2a4c02c8952b75245983a0ed-refs/branch-heads/6367@{#1097}) on port 9516
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
ChromeDriver was started successfully.
2024-05-08 15:37:03 DEBUG Selenium [:command] -> POST session 
2024-05-08 15:37:03 DEBUG Selenium [:command] -> POST session 
2024-05-08 15:37:03 DEBUG Selenium [:command]    >>> http://127.0.0.1:9516/session | {"capabilities":{"alwaysMatch":{"browserName":"chrome","goog:chromeOptions":{}}}} 
2024-05-08 15:37:03 DEBUG Selenium [:command]    >>> http://127.0.0.1:9516/session | {"capabilities":{"alwaysMatch":{"browserName":"chrome","goog:chromeOptions":{}}}} 
2024-05-08 15:37:03 DEBUG Selenium [:header]      > {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=UTF-8", "User-Agent"=>"selenium/4.20.1 (ruby linux)", "Content-Length"=>"81"} 
2024-05-08 15:37:03 DEBUG Selenium [:header]      > {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=UTF-8", "User-Agent"=>"selenium/4.20.1 (ruby linux)", "Content-Length"=>"81"} 
2024-05-08 15:37:03 DEBUG Selenium [:header]    <<<  {"content-length"=>["689"], "content-type"=>["application/json; charset=utf-8"], "cache-control"=>["no-cache"]} 
2024-05-08 15:37:03 DEBUG Selenium [:header]    <<<  {"content-length"=>["689"], "content-type"=>["application/json; charset=utf-8"], "cache-control"=>["no-cache"]} 
2024-05-08 15:37:03 DEBUG Selenium [:command] <- {"value":{"error":"unknown error","message":"unknown error: cannot find Chrome binary","stacktrace":"#0 0x59b8fc0cddf3 \u003Cunknown>\n#1 0x59b8fbdbc4e7 \u003Cunknown>\n#2 0x59b8fbdee5b3 \u003Cunknown>\n#3 0x59b8fbdec9c0 \u003Cunknown>\n#4 0x59b8fbe357f0 \u003Cunknown>\n#5 0x59b8fbe291f3 \u003Cunknown>\n#6 0x59b8fbdfa28a \u003Cunknown>\n#7 0x59b8fbdfac5e \u003Cunknown>\n#8 0x59b8fc09211b \u003Cunknown>\n#9 0x59b8fc09606b \u003Cunknown>\n#10 0x59b8fc07e231 \u003Cunknown>\n#11 0x59b8fc096bd2 \u003Cunknown>\n#12 0x59b8fc0630ef \u003Cunknown>\n#13 0x59b8fc0bcf48 \u003Cunknown>\n#14 0x59b8fc0bd120 \u003Cunknown>\n#15 0x59b8fc0ccf44 \u003Cunknown>\n#16 0x71b9b2297b5a \u003Cunknown>\n"}} 
2024-05-08 15:37:03 DEBUG Selenium [:command] <- {"value":{"error":"unknown error","message":"unknown error: cannot find Chrome binary","stacktrace":"#0 0x59b8fc0cddf3 \u003Cunknown>\n#1 0x59b8fbdbc4e7 \u003Cunknown>\n#2 0x59b8fbdee5b3 \u003Cunknown>\n#3 0x59b8fbdec9c0 \u003Cunknown>\n#4 0x59b8fbe357f0 \u003Cunknown>\n#5 0x59b8fbe291f3 \u003Cunknown>\n#6 0x59b8fbdfa28a \u003Cunknown>\n#7 0x59b8fbdfac5e \u003Cunknown>\n#8 0x59b8fc09211b \u003Cunknown>\n#9 0x59b8fc09606b \u003Cunknown>\n#10 0x59b8fc07e231 \u003Cunknown>\n#11 0x59b8fc096bd2 \u003Cunknown>\n#12 0x59b8fc0630ef \u003Cunknown>\n#13 0x59b8fc0bcf48 \u003Cunknown>\n#14 0x59b8fc0bd120 \u003Cunknown>\n#15 0x59b8fc0ccf44 \u003Cunknown>\n#16 0x71b9b2297b5a \u003Cunknown>\n"}} 
2024-05-08 15:37:03 DEBUG Selenium Skipping Selenium Manager; path to chromedriver specified in service class: /home/shouichi/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver
2024-05-08 15:37:03 DEBUG Selenium Skipping Selenium Manager; path to chromedriver specified in service class: /home/shouichi/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver
2024-05-08 15:37:03 DEBUG Selenium [:driver_service] Executing Process ["/home/shouichi/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver", "--port=9517"] 
2024-05-08 15:37:03 DEBUG Selenium [:driver_service] Executing Process ["/home/shouichi/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver", "--port=9517"] 
2024-05-08 15:37:03 DEBUG Selenium [:process] Starting process: ["/home/shouichi/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver", "--port=9517"] with {[:out, :err]=>#<IO:<STDERR>>, :pgroup=>true} 
2024-05-08 15:37:03 DEBUG Selenium [:process] Starting process: ["/home/shouichi/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver", "--port=9517"] with {[:out, :err]=>#<IO:<STDERR>>, :pgroup=>true} 
2024-05-08 15:37:03 DEBUG Selenium [:process]   -> pid: 3928397 
2024-05-08 15:37:03 DEBUG Selenium [:process]   -> pid: 3928397 
2024-05-08 15:37:03 DEBUG Selenium [:driver_service] polling for socket on ["127.0.0.1", 9517] 
2024-05-08 15:37:03 DEBUG Selenium [:driver_service] polling for socket on ["127.0.0.1", 9517] 
Starting ChromeDriver 124.0.6367.155 (df4f029328b2d50a2a4c02c8952b75245983a0ed-refs/branch-heads/6367@{#1097}) on port 9517
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
Starting ChromeDriver 124.0.6367.155 (df4f029328b2d50a2a4c02c8952b75245983a0ed-refs/branch-heads/6367@{#1097}) on port 9517
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
ChromeDriver was started successfully.
2024-05-08 15:37:03 DEBUG Selenium [:command] -> POST session 
2024-05-08 15:37:03 DEBUG Selenium [:command] -> POST session 
2024-05-08 15:37:03 DEBUG Selenium [:command]    >>> http://127.0.0.1:9517/session | {"capabilities":{"alwaysMatch":{"browserName":"chrome","goog:chromeOptions":{}}}} 
2024-05-08 15:37:03 DEBUG Selenium [:command]    >>> http://127.0.0.1:9517/session | {"capabilities":{"alwaysMatch":{"browserName":"chrome","goog:chromeOptions":{}}}} 
2024-05-08 15:37:03 DEBUG Selenium [:header]      > {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=UTF-8", "User-Agent"=>"selenium/4.20.1 (ruby linux)", "Content-Length"=>"81"} 
2024-05-08 15:37:03 DEBUG Selenium [:header]      > {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=UTF-8", "User-Agent"=>"selenium/4.20.1 (ruby linux)", "Content-Length"=>"81"} 
2024-05-08 15:37:03 DEBUG Selenium [:header]    <<<  {"content-length"=>["689"], "content-type"=>["application/json; charset=utf-8"], "cache-control"=>["no-cache"]} 
2024-05-08 15:37:03 DEBUG Selenium [:header]    <<<  {"content-length"=>["689"], "content-type"=>["application/json; charset=utf-8"], "cache-control"=>["no-cache"]} 
2024-05-08 15:37:03 DEBUG Selenium [:command] <- {"value":{"error":"unknown error","message":"unknown error: cannot find Chrome binary","stacktrace":"#0 0x600dcc3c1df3 \u003Cunknown>\n#1 0x600dcc0b04e7 \u003Cunknown>\n#2 0x600dcc0e25b3 \u003Cunknown>\n#3 0x600dcc0e09c0 \u003Cunknown>\n#4 0x600dcc1297f0 \u003Cunknown>\n#5 0x600dcc11d1f3 \u003Cunknown>\n#6 0x600dcc0ee28a \u003Cunknown>\n#7 0x600dcc0eec5e \u003Cunknown>\n#8 0x600dcc38611b \u003Cunknown>\n#9 0x600dcc38a06b \u003Cunknown>\n#10 0x600dcc372231 \u003Cunknown>\n#11 0x600dcc38abd2 \u003Cunknown>\n#12 0x600dcc3570ef \u003Cunknown>\n#13 0x600dcc3b0f48 \u003Cunknown>\n#14 0x600dcc3b1120 \u003Cunknown>\n#15 0x600dcc3c0f44 \u003Cunknown>\n#16 0x7c84e3097b5a \u003Cunknown>\n"}} 
2024-05-08 15:37:03 DEBUG Selenium [:command] <- {"value":{"error":"unknown error","message":"unknown error: cannot find Chrome binary","stacktrace":"#0 0x600dcc3c1df3 \u003Cunknown>\n#1 0x600dcc0b04e7 \u003Cunknown>\n#2 0x600dcc0e25b3 \u003Cunknown>\n#3 0x600dcc0e09c0 \u003Cunknown>\n#4 0x600dcc1297f0 \u003Cunknown>\n#5 0x600dcc11d1f3 \u003Cunknown>\n#6 0x600dcc0ee28a \u003Cunknown>\n#7 0x600dcc0eec5e \u003Cunknown>\n#8 0x600dcc38611b \u003Cunknown>\n#9 0x600dcc38a06b \u003Cunknown>\n#10 0x600dcc372231 \u003Cunknown>\n#11 0x600dcc38abd2 \u003Cunknown>\n#12 0x600dcc3570ef \u003Cunknown>\n#13 0x600dcc3b0f48 \u003Cunknown>\n#14 0x600dcc3b1120 \u003Cunknown>\n#15 0x600dcc3c0f44 \u003Cunknown>\n#16 0x7c84e3097b5a \u003Cunknown>\n"}} 
2024-05-08 15:37:03 DEBUG Selenium Skipping Selenium Manager; path to chromedriver specified in service class: /home/shouichi/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver
2024-05-08 15:37:03 DEBUG Selenium Skipping Selenium Manager; path to chromedriver specified in service class: /home/shouichi/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver
2024-05-08 15:37:03 DEBUG Selenium [:driver_service] Executing Process ["/home/shouichi/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver", "--port=9518"] 
2024-05-08 15:37:03 DEBUG Selenium [:driver_service] Executing Process ["/home/shouichi/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver", "--port=9518"] 
2024-05-08 15:37:03 DEBUG Selenium [:process] Starting process: ["/home/shouichi/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver", "--port=9518"] with {[:out, :err]=>#<IO:<STDERR>>, :pgroup=>true} 
2024-05-08 15:37:03 DEBUG Selenium [:process] Starting process: ["/home/shouichi/.cache/selenium/chromedriver/linux64/124.0.6367.155/chromedriver", "--port=9518"] with {[:out, :err]=>#<IO:<STDERR>>, :pgroup=>true} 
2024-05-08 15:37:03 DEBUG Selenium [:process]   -> pid: 3928404 
2024-05-08 15:37:03 DEBUG Selenium [:process]   -> pid: 3928404 
2024-05-08 15:37:03 DEBUG Selenium [:driver_service] polling for socket on ["127.0.0.1", 9518] 
2024-05-08 15:37:03 DEBUG Selenium [:driver_service] polling for socket on ["127.0.0.1", 9518] 
Starting ChromeDriver 124.0.6367.155 (df4f029328b2d50a2a4c02c8952b75245983a0ed-refs/branch-heads/6367@{#1097}) on port 9518
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
Starting ChromeDriver 124.0.6367.155 (df4f029328b2d50a2a4c02c8952b75245983a0ed-refs/branch-heads/6367@{#1097}) on port 9518
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
ChromeDriver was started successfully.
2024-05-08 15:37:03 DEBUG Selenium [:command] -> POST session 
2024-05-08 15:37:03 DEBUG Selenium [:command] -> POST session 
2024-05-08 15:37:03 DEBUG Selenium [:command]    >>> http://127.0.0.1:9518/session | {"capabilities":{"alwaysMatch":{"browserName":"chrome","goog:chromeOptions":{}}}} 
2024-05-08 15:37:03 DEBUG Selenium [:command]    >>> http://127.0.0.1:9518/session | {"capabilities":{"alwaysMatch":{"browserName":"chrome","goog:chromeOptions":{}}}} 
2024-05-08 15:37:03 DEBUG Selenium [:header]      > {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=UTF-8", "User-Agent"=>"selenium/4.20.1 (ruby linux)", "Content-Length"=>"81"} 
2024-05-08 15:37:03 DEBUG Selenium [:header]      > {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=UTF-8", "User-Agent"=>"selenium/4.20.1 (ruby linux)", "Content-Length"=>"81"} 
2024-05-08 15:37:03 DEBUG Selenium [:header]    <<<  {"content-length"=>["689"], "content-type"=>["application/json; charset=utf-8"], "cache-control"=>["no-cache"]} 
2024-05-08 15:37:03 DEBUG Selenium [:header]    <<<  {"content-length"=>["689"], "content-type"=>["application/json; charset=utf-8"], "cache-control"=>["no-cache"]} 
2024-05-08 15:37:03 DEBUG Selenium [:command] <- {"value":{"error":"unknown error","message":"unknown error: cannot find Chrome binary","stacktrace":"#0 0x5f20c5b90df3 \u003Cunknown>\n#1 0x5f20c587f4e7 \u003Cunknown>\n#2 0x5f20c58b15b3 \u003Cunknown>\n#3 0x5f20c58af9c0 \u003Cunknown>\n#4 0x5f20c58f87f0 \u003Cunknown>\n#5 0x5f20c58ec1f3 \u003Cunknown>\n#6 0x5f20c58bd28a \u003Cunknown>\n#7 0x5f20c58bdc5e \u003Cunknown>\n#8 0x5f20c5b5511b \u003Cunknown>\n#9 0x5f20c5b5906b \u003Cunknown>\n#10 0x5f20c5b41231 \u003Cunknown>\n#11 0x5f20c5b59bd2 \u003Cunknown>\n#12 0x5f20c5b260ef \u003Cunknown>\n#13 0x5f20c5b7ff48 \u003Cunknown>\n#14 0x5f20c5b80120 \u003Cunknown>\n#15 0x5f20c5b8ff44 \u003Cunknown>\n#16 0x72237bc97b5a \u003Cunknown>\n"}} 
2024-05-08 15:37:03 DEBUG Selenium [:command] <- {"value":{"error":"unknown error","message":"unknown error: cannot find Chrome binary","stacktrace":"#0 0x5f20c5b90df3 \u003Cunknown>\n#1 0x5f20c587f4e7 \u003Cunknown>\n#2 0x5f20c58b15b3 \u003Cunknown>\n#3 0x5f20c58af9c0 \u003Cunknown>\n#4 0x5f20c58f87f0 \u003Cunknown>\n#5 0x5f20c58ec1f3 \u003Cunknown>\n#6 0x5f20c58bd28a \u003Cunknown>\n#7 0x5f20c58bdc5e \u003Cunknown>\n#8 0x5f20c5b5511b \u003Cunknown>\n#9 0x5f20c5b5906b \u003Cunknown>\n#10 0x5f20c5b41231 \u003Cunknown>\n#11 0x5f20c5b59bd2 \u003Cunknown>\n#12 0x5f20c5b260ef \u003Cunknown>\n#13 0x5f20c5b7ff48 \u003Cunknown>\n#14 0x5f20c5b80120 \u003Cunknown>\n#15 0x5f20c5b8ff44 \u003Cunknown>\n#16 0x72237bc97b5a \u003Cunknown>\n"}} 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928404 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928404 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process] Polling 20 seconds for exit of 3928404 
2024-05-08 15:37:03 DEBUG Selenium [:process] Polling 20 seconds for exit of 3928404 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928404 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928404 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928404 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928404 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process]   -> exit code is 0 
2024-05-08 15:37:03 DEBUG Selenium [:process]   -> exit code is 0 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928404 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928404 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process]   -> exit code is 0 
2024-05-08 15:37:03 DEBUG Selenium [:process]   -> exit code is 0 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928404 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928404 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process]   -> exit code is 0 
2024-05-08 15:37:03 DEBUG Selenium [:process]   -> exit code is 0 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928397 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928397 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process] Polling 20 seconds for exit of 3928397 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928397 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process] Polling 20 seconds for exit of 3928397 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928397 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928397 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928397 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process]   -> exit code is 0 
2024-05-08 15:37:03 DEBUG Selenium [:process]   -> exit code is 0 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928397 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928397 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process]   -> exit code is 0 
2024-05-08 15:37:03 DEBUG Selenium [:process]   -> exit code is 0 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928397 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928397 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process]   -> exit code is 0 
2024-05-08 15:37:03 DEBUG Selenium [:process]   -> exit code is 0 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928391 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928391 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process] Polling 20 seconds for exit of 3928391 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928391 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process] Polling 20 seconds for exit of 3928391 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928391 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928391 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928391 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process]   -> exit code is 0 
2024-05-08 15:37:03 DEBUG Selenium [:process]   -> exit code is 0 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928391 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928391 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process]   -> exit code is 0 
2024-05-08 15:37:03 DEBUG Selenium [:process]   -> exit code is 0 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928391 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928391 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process]   -> exit code is 0 
2024-05-08 15:37:03 DEBUG Selenium [:process]   -> exit code is 0 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928385 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928385 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process] Polling 20 seconds for exit of 3928385 
2024-05-08 15:37:03 DEBUG Selenium [:process] Polling 20 seconds for exit of 3928385 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928385 is exited: 
2024-05-08 15:37:03 DEBUG Selenium [:process] Checking if 3928385 is exited: 
2024-05-08 15:37:04 DEBUG Selenium [:process] Checking if 3928385 is exited: 
2024-05-08 15:37:04 DEBUG Selenium [:process] Checking if 3928385 is exited: 
2024-05-08 15:37:04 DEBUG Selenium [:process]   -> exit code is 0 
2024-05-08 15:37:04 DEBUG Selenium [:process]   -> exit code is 0 
2024-05-08 15:37:04 DEBUG Selenium [:process] Checking if 3928385 is exited: 
2024-05-08 15:37:04 DEBUG Selenium [:process] Checking if 3928385 is exited: 
2024-05-08 15:37:04 DEBUG Selenium [:process]   -> exit code is 0 
2024-05-08 15:37:04 DEBUG Selenium [:process]   -> exit code is 0 
2024-05-08 15:37:04 DEBUG Selenium [:process] Checking if 3928385 is exited: 
2024-05-08 15:37:04 DEBUG Selenium [:process] Checking if 3928385 is exited: 
2024-05-08 15:37:04 DEBUG Selenium [:process]   -> exit code is 0 
2024-05-08 15:37:04 DEBUG Selenium [:process]   -> exit code is 0

Operating System

ubuntu

Selenium version

ruby 4.20.1

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

chrome 124.0.6367.155

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

chromedriver 124.0.6367.155

Are you using Selenium Grid?

No response

Footnotes

  1. https://github.com/SeleniumHQ/selenium/blob/0345a23bebf54aead25bb0f11c9c5c9d63112adc/rb/lib/selenium/webdriver/common/driver_finder.rb#L48-L64

  2. https://github.com/rails/rails/blob/dcfabdbe4e7e53fc757d0ebf89c77349899a35bb/actionpack/lib/action_dispatch/system_testing/browser.rb#L77

  3. https://github.com/SeleniumHQ/selenium/blob/0345a23bebf54aead25bb0f11c9c5c9d63112adc/rb/lib/selenium/webdriver/common/driver_finder.rb#L53

Copy link

github-actions bot commented May 8, 2024

@shouichi, 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!

@diemol
Copy link
Member

diemol commented May 8, 2024

@titusfortner do you know if this is correct?

@diemol diemol added C-rb and removed needs-triaging labels May 8, 2024
@searls
Copy link

searls commented May 14, 2024

I am running into the same thing. Unless I pin to 4.19.0 I get Selenium::WebDriver::Error::UnknownError: unknown error: cannot find Chrome binary cc/ @p0deje

@p0deje
Copy link
Member

p0deje commented May 15, 2024

Ideally, Rails would not attempt to preload drivers/browsers via a direct API call of Selenium. Reading through the code, this is done to avoid race conditions when running tests in parallel. I think that Selenium should handle this internally so that concurrent attempts to preload the driver/browser would ensure there are no race conditions and wait for the first process to finish downloading, then yield to other binary calls. With this implementation in place, the related part of Rails code can be removed:

https://github.com/rails/rails/blob/dcfabdbe4e7e53fc757d0ebf89c77349899a35bb/actionpack/lib/action_dispatch/system_testing/browser.rb#L40-L49

It's a fairly simple change that I can do both in Selenium and Rails, but I am not sure if that suits the Rails users. @searls Do you happen to know if it would be fine for Rails to pin Selenium to say >= 4.20.2 in the next Rails version?

@searls
Copy link

searls commented May 16, 2024

It's a fairly simple change that I can do both in Selenium and Rails, but I am not sure if that suits the Rails users. @searls Do you happen to know if it would be fine for Rails to pin Selenium to say >= 4.20.2 in the next Rails version?

I'm not on Rails core so it's not for me to say, but I would wager that simply releasing a fix in Selenium to allow anyone who runs into this to receive the fix via bundle update to a patch release would be plenty to resolve it, regardless

p0deje added a commit that referenced this issue May 16, 2024
It's a hacky way to solve #13918. The follow-up is to ensure Rails don't preload the drivers/browsers (assuming Selenium-Manager doesn't have race conditions) and make DriverFinder a private API.
@p0deje
Copy link
Member

p0deje commented May 16, 2024

@searls @shouichi Can you see if 4.21.1 solve the problem for you?

@shouichi
Copy link
Author

@p0deje 4.21.1 solved the problem. Thank you!

@diemol
Copy link
Member

diemol commented May 17, 2024

Great!

@diemol diemol closed this as completed May 17, 2024
@searls
Copy link

searls commented May 17, 2024

Confirm: fixed me too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants