-
-
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]: Unable to obtain: Capabilities -> Issue still present in 4.15 #13091
Comments
@parholmdahl, 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! |
Oh! And a note: This error was not present in 4.11.. |
This might be a Chrome 118 issue, please update versions and try again. |
I am still seeing this issue on 4.15.0 running Chrome 119 |
I also see this with 119 |
We are trying to upgrade from 4.8 to 4.15 to have the latest version of browsers, and we are facing the same problem! Parallel testing no longer works. This is a huge problem/blocker. |
Seems like this is the same as #12802 as well, and we thought caching in 4.15 would fix. One thing I see in common with all of these is that they are using |
From the java logs it looks like the output of the selenium manager is not json / blank. @bonigarcia am i reading the rust code correctly? |
Maybe we should be outputting the logs as they happen after all, instead of trying to parse them in the result, in case the result has a bug for some reason. |
Since last Friday (2 days ago) we are also getting this issue: I suspect it is because of Chrome browser 118 (and 119 and above) because this failure did not appear with Chrome 117. |
This issue is giving an error that the selenium manager JSON can't be parsed. What is the error/stack trace you think matches it? Also, make sure your driver & browser versions match exactly if you aren't using Selenium Manager. |
titus, our error shows: In my Intellij (java) > External Libraries it shows for selenium 4.4.0 |
I'm not sure, but it like to be the same as 1992. I did a test by just opening a few browsers and do a sleep. As soon as there are some in parallel/at the same time the problem quickly arises. This is a major blocker because we have lost stability. I use the following versions:
SessionNotCreatedException: Message: Could not start a new session. Could not start a new session. Unable to create session: Could not start a new session. Response code 500. Message: Could not start a new session. Unable to obtain: Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 119.0, moz:debuggerAddress: true, moz:firefoxOptions: {profile: UEsDBBQAAAAIAHuCZFfrmRmacgM...}, pageLoadStrategy: normal, platformName: linux, se:noVncPort: 7900, se:vncEnabled: true}, error Failed to parse json output, executed: [--browser, firefox, --output, json, --browser-version, 119.0] Build info: version: '4.15.0', revision: '1d14b5521b' |
@vaatje right, the node is using Selenium Manager, trying to parse the results and failing for some reason. The client version of Selenium does not matter in this case. Is there anyone seeing this issue while not using Docker? |
We need a way to entirely skip the usage of SM when the environment is already configured. This is an overhead in the Docker images. |
I've been analyzing this issue. The problem seems to be that the JSON output expected by the Java bindings is empty. I believe this can be caused by one of the following causes:
@jonathan-fortin Can you help to detect the cause (Rust or Java)? For that, and since you are already using Selenium 4.15.0, please download the Selenium Manager binary containing the previous PR (i.e., this file: selenium-manager_linux-x64), uncompress and replace it with the one in your cache ( In any case, I agree with @diemol, and I believe we need to implement some mechanism (an env, maybe) to skip using Selenium Manager entirely. Because in this use case (Docker containers), Selenium Manager should not be executed at all. |
Hi all, We are also experiencing this issue and I can confirm that this is happening with chromedriver 118 and above. In my case I'm running tests using docker selenium grid, all updated to the last version except chromedriver (to make it work). |
In which docker image tag works and which one does not? |
For us the revert today to standalone-chrome 117 made the issue disappear. |
OK, this is not related to the Chrome version. It is related to the Selenium version. The Chrome 117 image uses Selenium 4.13, while the Chrome 118 image uses Selenium 4.14.1 |
I think this is a good time to figure out what this means as we move to Selenium 5.
|
Option 5, but without invoking SM. Or, @bonigarcia, does SM do any network call when using offline mode? But in any case, the Docker images have offline mode configured for SM, and this issue is happening because SM is being invoked. |
All this is to say that I think SM is being too eager to get information it doesn't need to satisfy the user requirement if things are already on the system. I don't think it is bad to collect more information locally to give potentially useful messages (e.g., |
@jonathan-fortin I pushed a new commit in PR #13123 (branch java_fix_sm_exec) including a retries logic based on yours. |
@bonigarcia : I tested your branch and it is now stable! This solves the 2 problems below: Problem 1: error Failed to parse json output, executed: [--browser, chrome, --output, json, --browser-version, 119.0] Problem 2: error Failed to run command: [--browser, chrome, --output, json, --browser-version, 119.0] Will it be possible to include this branch for the next release? |
@jonathan-fortin is there a easy way to reproduce this issue? This would make it easier to test changes |
In the original version, example 4.15.0, you will encounter the problem quickly and easily. |
Would like to add here we have upgraded from 4.14.0 to 4.15.0 and jdk17 this week and are seeing this issue intermittently in a non docker environment.
This is using a chrome 119 bin, seems more prone to it if init is concurrent which would line up with concerns around caching |
@jonathan-fortin i am currently not able to run docker on my dev box, so could you check the latest commit to the sm-direct-copy This commit will use the SYNC flag to ensure the data & metadata is written to disk. This is really the last commit from my side to fix this, as i am running out of ideas :/ @PMooreWand this has been fixed in d1787a9 this ticket is still open as |
@joerg1985 : Ok, I'll try, but the problem was solved with the retry method I proposed and has been implemented by @bonigarcia in the following branch: java_fix_sm_exec |
@joerg1985 : I tried your latest commit and I get the same problem. |
From my point of view it looks like a problem with Chrome |
I can get the issue to occur with Firefox as well, so it isn't specific to Chrome. |
It's not tied to a specific browser. And all these issues have been resolved in @bonigarcia' s branch: java_fix_sm_exec Solved: error Failed to parse json output, executed: [--browser, chrome, --output, json, --browser-version, 119.0] Solved: error Failed to run command: [--browser, chrome, --output, json, --browser-version, 119.0] So why not move forward with this branch? |
The first issue has allready been fixed in trunk, so i think the branch should be rebased. In general i am not a friend of these kind of workarounds in selenium, effected users can easily add a local try/catch as workaround. The root cause should be found and fixed, therefore it might be good to close this issue and create a new one with a clear explanation what is differten to the original issue. This might help to check whether others see this issue too, outside from docker. Docker should be fixed as soon as selenium manager is not called any in a preconfigured environment, as @titusfortner suggested. But these are only my two cents, others have to decide this. |
I understand and agree with @titusfortner about Selenium Manager. But until this part is in place, it is not possible to use Selenium with Docker. It crashes all the time. It is not possible to carry out tests and have stable results. So, I believe this may be a workaround in the meantime. |
Can someone who has this issue use the nightly jar and create a new issue with the full details of the error seen? I'm closing this due to the original reported issue no longer applying directly to the problem that remains to be fixed. I also do not want to use the branch referred to above because I think we should be addressing the issue in the existing libraries, not switching to new ones. @pujagani & @diemol would appreciate your opinions on this as well. |
I released a new set of Docker images where the browser driver path is set via properties, and with that, Selenium Manager is avoided. Please try with https://github.com/SeleniumHQ/docker-selenium/releases/tag/4.15.0-20231122 |
@diemol, Great!!! This version fixes this problem! It's good news :) ! |
@jonathan-fortin, I have a question for you. Can you confirm that you are not using the |
@giuliohome I confirm that we do not use this option. |
@diemol where can we find these images? |
@vaatje they are on Docker Hub, and you need to do the usual Size is different because images are compressed in Docker Hub, and the release shows the uncompressed size. |
@jonathan-fortin, Thank you. When I run a test, a generic test passes while a download test fails with a 404 error when I use the following code: const response = await fetch(`${selenium_url_only}/session/${sessionId}/se/files`, {headers: headers});
console.log(response) I observed a log in Grafana similar to the one below:
or this log in my GitLab pipeline
It's possible that I have some incorrect configurations. However, @jonathan-fortin, could you confirm whether you are also conducting a download test by fetching from something like ${selenium_url_only}/session/${sessionId}/se/files? Thank you, @jonathan-fortin, and I apologize for bothering you again. |
@jonathan-fortin, okay. Maybe it was a network issue between AKS clusters (or related to this issue). I tested it again in a single Kubernetes cluster, and the download test looks good to me (hopefully). |
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?
Occasionally in our tests we get this error. I can't see any thing special that happens, it is just that sometimes we cant get a session from the grid.
Our setup is like:
Kubernetes for 1 hub with selenium/hub:4.15
4 Nodes based on selenium/node-base:4.15 all with different capabilities (3 nodes with mtls certs inserted and 1 node "vanilla")
All nodes have "manually installed" browsers as in we install chrome, edge and firefox it in the dockerfile.
All nodes are setup with this config:
How can we reproduce the issue?
Relevant log output
Operating System
Runs on docker
Selenium version
4.15
What are the browser(s) and version(s) where you see this issue?
Latest Chrome, Edge, Firefox
What are the browser driver(s) and version(s) where you see this issue?
Latest of each
Are you using Selenium Grid?
Yes. 4.15.
The text was updated successfully, but these errors were encountered: