-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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]: "--headlessmode=new" with Chromedriver 128 in container results in SessionNotCreatedException #14457
Comments
@1dEraNCeSIv0, 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! |
Thank you for sharing the details. I tried to reproduce the issue but was not able to. Docker command: Selenium Java code:
Is the error happening each time? or is it intermittent? How can we reproduce this? |
I am able to reproduce it if I run multiple sessions in parallel or run multiple sessions sequentially. |
I tried reproducing it again locally and noticed that the image was broken due to line endings changing upon up- and download. Long story short, I believe I've fixed the Dockerfile and the following steps should now work again to reproduce the issue using the repository linked above:
If there's any issues with the image please let me know. It should cause the issue consistently, my error-rate so far is 100% in maybe 10 attempts. |
@pujagani, can you try to reproduce the same again with image |
@VietND96 Thank you! Let me try it out and provide my findings here. |
I am able to reproduce the issue (using #14457 (comment) not consistently, it failed one time with " |
With the demo repo shared, I am able to see the error described in the issue. But those are two different things. I was trying to run tests on my machine pointing to the docker-selenium grid and was not able to reproduce the issue accurately on the last attempt. But the repo is trying to run tests inside the docker container locally without using the Grid. I have a feeling this is not a Selenium issue. |
In the demo repo shared I have made the following updates:
After this, I no longer see the error. Sharing the output below:
|
@1dEraNCeSIv0 Can you please try it and provide an update? |
I've incorporated your changes into the repository, no changes. Feel free to check if I made an error when editing the project.
FWIW I also checked the specific installed chromium version when I run the image and it's the one you used
|
Thank you for trying. I am not sure how to help further since I am unable to reproduce it consistently on my end. |
I've finally found that one of my colleagues can run the tests and they consistently work for them as well. I'll be digging more into that next week, hopefully I'll be able to narrow down the exact causes of the error. I'll let you know once I find out more |
Okay, I've find some time to look into this further. Turns out that my colleague who can run the tests consistently... cannot actually run them consistently. Upon retrying today they exhibited the same behavior I've mostly been getting. So I've tried it on a windows machines and get the error 100% of the time Now, ideally none of that would matter anyway because within the docker image we should all have the same state to run the same code with, getting the same results. Apparently this is not the case but at this point I have no idea what the differences are. Some other things I tried: Upgrading to chromium / chromium-driver 129. It has had mixed results.
So the takeaway is that unspecified things happened that fixed the error temporarily but generally speaking 129 seems to exhibit the same issue we've been seeing with 128. The only way I know that reliably avoids the timeout error is by using a chromium/chromedriver version < 127. And if it works perfectly on your end I wish what causes that. |
I've made some changes and now I am on a setup that seems to work consistently so far. I've changed:
With those changes made the selenium tests in the demo project now work again, seemingly consistently. I suspect the issue to be with chromium and / or chromium-chromedriver but that's all I've got. In case anyone wants to take a look at what the working project looks like I've created a separate branch. |
I'm having the same issue... Upgrading to |
On first glance this looks like a different issue, we've only ever gotten the error posted above and it does not mention |
Unfortunately headless=old works, but only for some tests and in a non deterministic way. The only working solution is to downgrade to a version <= 127. |
I too was facing the same issue. Can see the following in chromedriver verbose logs
Could be some issue with GPU Acceleration in latest chrome versions with headless mode. Worked when i added |
@KrishnaSuravarapu, I've always used that flag and your issue seems to be completely different from this one. |
What happened?
Recently we upgraded our Jenkins to the latest version and most of our (Java based) Selenium tests started failing in their pipelines,
SessionNotCreatedException
caused by a timeout inorg.openqa.selenium.remote.http.AddSeleniumUserAgent
.Upon further investigation we found that the following combination of circumstances causes consistent failure:
--headless=new
I've browsed the issues here to check if it's been reported before and it looks similar to this issue, might be the same cause.
For now our workaround is to downgrade the chromium / chromedriver version our Jenkins runs with. We could also switch our tests to
--headless=old
but I see that as a fix of last resort. I'd much rather Selenium and new chromedriver versions work together out of the box, even in new headless mode.How can we reproduce the issue?
See this repository for a minimal reproducing example. For instructions on how to reproduce the issue please see the readme.
Relevant log output
Operating System
Alpine 3.20, Debian 12
Selenium version
4.19.1, 4.23
What are the browser(s) and version(s) where you see this issue?
Chrome 128
What are the browser driver(s) and version(s) where you see this issue?
Chromedriver 128
Are you using Selenium Grid?
No
The text was updated successfully, but these errors were encountered: