-
-
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]: can not launch geckodriver.exe under cygwin environment #12618
Comments
@mora-01, 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! |
@mora-01 thanks. Can you
|
Hi, here is the output after running Watir.logger.selenium = :debug
2023-08-27 09:08:46 INFO Selenium [:logger_info] Details on how to use and modify Selenium logger:
https://selenium.dev/documentation/webdriver/troubleshooting/logging
2023-08-27 09:08:46 DEBUG Selenium [:selenium_manager] Selenium Manager binary found at /home/mcheav/.gem/ruby/3.2.0/gems/selenium-webdriver-4.11.0/bin/windows/selenium-manager.exe
2023-08-27 09:08:46 DEBUG Selenium [:selenium_manager] Executing Process ["/home/mcheav/.gem/ruby/3.2.0/gems/selenium-webdriver-4.11.0/bin/windows/selenium-manager.exe", "--browser", "firefox", "--output", "json",
"--debug"]
2023-08-27 09:08:47 DEBUG Selenium [:selenium_manager] Checking geckodriver in PATH
2023-08-27 09:08:47 DEBUG Selenium [:selenium_manager] Running command: geckodriver --version
2023-08-27 09:08:47 DEBUG Selenium [:selenium_manager] Output: "geckodriver 0.33.0 (a80e5fd61076 2023-04-02 18:31 +0000)\n\nThe source code of this program is available from\ntesting/geckodriver in https://hg.mozi
lla.org/mozilla-central.\n\nThis program is subject to the terms of the Mozilla Public License 2.0.\nYou can obtain a copy of the license at https://mozilla.org/MPL/2.0/."
2023-08-27 09:08:47 DEBUG Selenium [:selenium_manager] Running command: where geckodriver
2023-08-27 09:08:47 DEBUG Selenium [:selenium_manager] Output: "D:\\cygwin64_latest\\cygwin64\\usr\\local\\bin\\geckodriver.exe"
2023-08-27 09:08:47 DEBUG Selenium [:selenium_manager] Found geckodriver 0.33.0 in PATH: D:\cygwin64_latest\cygwin64\usr\local\bin\geckodriver.exe
2023-08-27 09:08:47 DEBUG Selenium [:selenium_manager] firefox detected at C:\Program Files\Mozilla Firefox\firefox.exe
2023-08-27 09:08:47 DEBUG Selenium [:selenium_manager] Using shell command to find out firefox version
2023-08-27 09:08:47 DEBUG Selenium [:selenium_manager] Running command: wmic datafile where name='C:\\Program Files\\Mozilla Firefox\\firefox.exe' get Version /value
2023-08-27 09:08:47 DEBUG Selenium [:selenium_manager] Output: "\r\r\n\r\r\nVersion=116.0.3.8627\r\r\n\r\r\n\r\r\n\r"
2023-08-27 09:08:47 DEBUG Selenium [:selenium_manager] Detected browser: firefox 116.0.3.8627
2023-08-27 09:08:47 DEBUG Selenium [:selenium_manager] Required driver: geckodriver 0.33.0
2023-08-27 09:08:47 DEBUG Selenium [:selenium_manager] Driver path: D:\cygwin64_latest\cygwin64\usr\local\bin\geckodriver.exe
2023-08-27 09:08:47 DEBUG Selenium [:selenium_manager] Browser path: C:\Program Files\Mozilla Firefox\firefox.exe
2023-08-27 09:08:47 DEBUG Selenium [:driver_service] Executing Process ["D:\\cygwin64_latest\\cygwin64\\usr\\local\\bin\\geckodriver.exe", "--port=4444"]
2023-08-27 09:08:47 DEBUG Selenium [:process] Starting process: ["D:\\cygwin64_latest\\cygwin64\\usr\\local\\bin\\geckodriver.exe", "--port=4444"] with {[:out, :err]=>#<IO:<STDOUT>>}
/home/mcheav/.gem/ruby/3.2.0/gems/selenium-webdriver-4.11.0/lib/selenium/webdriver/common/child_process.rb:57:in `spawn': No such file or directory - D:\cygwin64_latest\cygwin64\usr\local\bin\geckodriver.exe (Errn
o::ENOENT)
from /home/mcheav/.gem/ruby/3.2.0/gems/selenium-webdriver-4.11.0/lib/selenium/webdriver/common/child_process.rb:57:in `start'
from /home/mcheav/.gem/ruby/3.2.0/gems/selenium-webdriver-4.11.0/lib/selenium/webdriver/common/service_manager.rb:104:in `start_process'
from /home/mcheav/.gem/ruby/3.2.0/gems/selenium-webdriver-4.11.0/lib/selenium/webdriver/common/service_manager.rb:57:in `block in start'
from /home/mcheav/.gem/ruby/3.2.0/gems/selenium-webdriver-4.11.0/lib/selenium/webdriver/common/socket_lock.rb:42:in `locked'
from /home/mcheav/.gem/ruby/3.2.0/gems/selenium-webdriver-4.11.0/lib/selenium/webdriver/common/service_manager.rb:55:in `start'
from <internal:kernel>:90:in `tap'
from /home/mcheav/.gem/ruby/3.2.0/gems/selenium-webdriver-4.11.0/lib/selenium/webdriver/common/service.rb:92:in `launch'
from /home/mcheav/.gem/ruby/3.2.0/gems/selenium-webdriver-4.11.0/lib/selenium/webdriver/common/driver.rb:334:in `service_url'
from /home/mcheav/.gem/ruby/3.2.0/gems/selenium-webdriver-4.11.0/lib/selenium/webdriver/common/local_driver.rb:28:in `initialize_local_driver'
from /home/mcheav/.gem/ruby/3.2.0/gems/selenium-webdriver-4.11.0/lib/selenium/webdriver/firefox/driver.rb:42:in `initialize'
from /home/mcheav/.gem/ruby/3.2.0/gems/selenium-webdriver-4.11.0/lib/selenium/webdriver/common/driver.rb:53:in `new'
from /home/mcheav/.gem/ruby/3.2.0/gems/selenium-webdriver-4.11.0/lib/selenium/webdriver/common/driver.rb:53:in `for'
from /home/mcheav/.gem/ruby/3.2.0/gems/selenium-webdriver-4.11.0/lib/selenium/webdriver.rb:88:in `for'
from /home/mcheav/.gem/ruby/3.2.0/gems/watir-7.3.0/lib/watir/browser.rb:46:in `initialize'
|
Huh, that's weird that the system reports that as the location but that Ruby can't use it at that location. Try deleting the driver at this location: D:\cygwin64_latest\cygwin64\usr\local\bin\geckodriver.exe |
output after deleting the driver at this location: D:\cygwin64_latest\cygwin64\usr\local\bin\geckodriver.exe and re-run : 2023-08-27 15:35:42 INFO Selenium [:logger_info] Details on how to use and modify Selenium logger: 2023-08-27 15:35:42 DEBUG Selenium [:selenium_manager] Selenium Manager binary found at /home/mcheav/.gem/ruby/3.2.0/gems/selenium-webdriver-4.11.0/bin/windows/selenium-manager.exe |
Ok, well, now that's a network/proxy issues. Something on your system/network doesn't give you access to the site we look at for determining the right driver to install. So 3 things. First, @bonigarcia I'm not familiar with cygwin, any idea why it might be lying to us here or what the disconnect is? Second, figure out what your network issue is and if the network calls need to go through a proxy, or something needs to be added to an allow-list somewhere so it can work automatically like we want. Third, in the meantime you can make it work manually by downloading the correct driver again and referencing it with Watir like this: require 'watir'
Watir::Browser.new :firefox, service: {path: path_to_driver} |
sorry for the network issue, after deleting the driver at this location: D:\cygwin64_latest\cygwin64\usr\local\bin\geckodriver.exe I re-run : require 'watir' Here is the output : 2023-08-27 22:12:24 INFO Selenium [:logger_info] Details on how to use and modify Selenium logger: 2023-08-27 22:12:24 DEBUG Selenium [:selenium_manager] Selenium Manager binary found at /home/mcheav/.gem/ruby/3.2.0/gems/selenium-webdriver-4.11.0/bin/windows/selenium-manager.exe |
@bonigarcia do you think this is related to #12612 ? |
It seems everything is correct in the last logs:
|
Right, but then we get this error:
|
I suppose the problem happens because the filesystem in Cygwin (
But that mapping is not the responsibility of Selenium, I'm afraid. |
@p0deje if Ruby is passing this to child process, shouldn't it figure it out?
|
@titusfortner Probably we need to be checking for the environment and then translating the path accordingly. |
@p0deje I guess I'm not sure how to take what SM is returning to us and convert it to where the system wants to see it? |
@titusfortner I think we can just check if it's selenium/rb/lib/selenium/webdriver/common/platform.rb Lines 110 to 115 in 8640ea8
|
Is there something to do in this issue or did we fix it already? |
@titusfortner I don't see this implemented anywhere in the code, do you want to do it yourself or want me to try it out? |
Oh, I got distracted, running tests on a fix locally now. |
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. |
What happened?
Under Cygwin environment using selenium-webdriver version 11.4? I got the error :
/home/mcheav/.gem/ruby/3.2.0/gems/selenium-webdriver-4.11.0/lib/selenium/webdriver/common/child_process.rb:57:in `spawn': No such file or directory - D:\cygwin64_latest\cygwin64\usr\local\bin\geckodriver.exe
(Errno::ENOENT)
I use this workaround to resolve the issue.
In selenium-webdriver-4.11.0/lib/selenium/webdriver/common/service.rb file, I replace
@executable_path = path by @executable_path = '/usr/local/bin/geckodriver.exe' in initialize method.
How can we reproduce the issue?
require 'watir' Watir::Browser.new :firefox
Relevant log output
Operating System
Cygwin
Selenium version
Ruby 4.11.0
What are the browser(s) and version(s) where you see this issue?
Firefox 116.0.3 (64 bits)
What are the browser driver(s) and version(s) where you see this issue?
geckodriver 0.33.0
Are you using Selenium Grid?
No response
The text was updated successfully, but these errors were encountered: