-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
[🐛 Bug]: downloaded drivers are allegedly not executable #12425
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
Comments
@joerg1985, 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! |
I tried synchronizing the selenium manager calls without success. I also tried to repace the File.canExecute with Files.isExecutable, also no success. So i hat a look at the javadoc and this might be the effects described in Setting Initial Permissions |
@diemol Don't the Java tests use the pinned version of browser/drivers rather than Selenium Manager? It's really hard to know what is happening since we're swallowing the actual error messages. Can we throw the error here just to debug it - https://github.com/SeleniumHQ/selenium/blob/trunk/java/src/org/openqa/selenium/firefox/GeckoDriverInfo.java#L74 |
@titusfortner i removed the try catch in the commit joerg1985@829fa63 this revealed the |
@titusfortner No, we agreed to use Selenium Manager for tests in Java a while ago. The If it is a permissions issue, isn't is something we should look inside Selenium Manager? Does it matter how the binary is invoked? |
Look at this run where, i polled until the file gets executable and it is getting executable after some ms. |
Would that mean that Selenium Manager answers but the operating system is still completing those file permission tasks? |
I think there is no warrenty that changes in file attributes are instantly visible and this might be implementation specific for all the filesystems out there? |
We could try to create the file with the correct permissions and not modify them, as far as i understand the rust code :D |
Just wrote my first lines of rust code to set the permissions while the files are created: Will run the pipeline now several times to see if the issue is gone. |
There is a File.sync_all method, just added it CI is running, keep fingers crossed |
tried unistd/fn.fsync and unistd/fn.syncfs with no success. |
Bazel does run the UnitTests concurrently from different processes, so one process will invoke the download of the selenium manager and another one will pickup the incomplete file without the execution flag. @titusfortner Do you think it is possible to add some locking to the selenium manager, to avoid picking the incomplete download? Or should i just workaround it for the unit testing? Or should we just ignore these flaky unit tests? |
PS: i also noticed Bazel does not show the cause of an exception in the console. this might be helpfull to detect the root cause of other failing tests. |
|
Okay, so we might get others into this.
I am not aware of the rust code, this must someone else check.
Yes, but this does not cover this case.
Yes, i think this is happening here. One SM is still extracting and another SM picks it up before it is ready (marked executable).
This would probably make it not better
That's a possible workaround, but others might see this effect too on their CI pipeline. |
I need more context on when this is happening. Does this happen only when we run our tests? Or does this happen when someone runs tests using Selenium as a dependency? |
It's being reproduced in our tests, but I don't think our tests are using Selenium Manager substantively differently than how others could be using it. |
I think this will happen as soon as someone is running tests in parallel on the same system and the selenium manager is downloading something. The first call to the selenium manager will start to download and extract files, while a concurrent call to the selenium manager will pick up the incomplete files and will return the path to the client bingings to use them. |
I just noticed the issue again in a recent run, the links above are outdated: |
Do we know what error we actually get when trying to use a file that has not finished downloading so we can rescue it? We've also implemented this as a singleton, could we toggle a parameter to mark driver downloads in progress and have future method calls block on that? |
I think bazel is using multiple processes to run tests in parallel, therefore the singleton does not help to fix To wait until the driver is executable could be implemented in the selenium manager to have this in one central place. |
This issue is looking for contributors. Please comment below or reach out to us through our IRC/Slack/Matrix channels if you are interested. |
Is this issue still valid? I was reported for an old version of SM, so it may not be certain anymore. |
During the May 2024 Selenium Summit, we decided to implement a locking mechanism. It will be low priority until we find a way to reproduce it. |
Since we don't have a reproducible example for this, but we do for #13511 let's track the fix there. |
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?
I have seen in GitActions unit tests failing in the CI with a 'RuntimeException: No driver can be provided for capabilities Capabilities ...', e.g.:
So i created a commit to remove the try/catch bock of
isAvailable
and replaced it with a loop to better hit the issue, seejoerg1985@829fa63
After this i did run the ci pipeline and did see this errors a cause:
org.openqa.selenium.remote.NoSuchDriverException: chromedriver located at /home/runner/.cache/selenium/chromedriver/linux64/115.0.5790.102/chromedriver, cannot be executed
org.openqa.selenium.remote.NoSuchDriverException: geckodriver located at /home/runner/.cache/selenium/geckodriver/linux64/0.33.0/geckodriver, cannot be executed
Is it possible that concurrently calling
DriverFinder.getPath
will cause this issue? I guess the Selenium Manager does not ensure that other instances of the Selenium Manager have completed, before passing the driver path back to theDriverFinder.getPath
? Or is the executable flag some how set asynchronous to creating the file? This might also be a bug in the JDK and theFile.canExecute()
is outdated.This might also happen outside the Selenium GitHub unit tests, so i decided to raise this ticket to start investigations.
How can we reproduce the issue?
Cherry pick https://github.com/joerg1985/selenium/commit/829fa6347b579f219795d7abca4cfcdc2d178770 to reproduce in GitHub Actions.
Relevant log output
Operating System
GitHub Actions
Selenium version
trunk
What are the browser(s) and version(s) where you see this issue?
chrome, firefox
What are the browser driver(s) and version(s) where you see this issue?
latest
Are you using Selenium Grid?
No response
The text was updated successfully, but these errors were encountered: