Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[🐛 Bug]: Response code 500 SessionNotCreatedException starting with chrome 131.0.6741.0 on windows only #15332

Open
zefkide opened this issue Feb 25, 2025 · 13 comments

Comments

@zefkide
Copy link

zefkide commented Feb 25, 2025

What happened?

Hello,
We are running selenium 4 grid (hub + nodes) in a following configuration :

  • 1 hub RH9
  • 2 nodes RH9
  • 2 nodes win server 2022 (datacenter)
  • 1 node win server 2016 (datacenter)
    We are constraint to upgrade every few months all our browsers (chrome and edge). Running tests against chrome 132 and 133 results in failures of 10 to 30% only on windows node machines not on linux ones.
    So we have tested the same basic test in a row of 250 to 500 times in order to identify the version with issues. The test consists in getting a page on a local website and find an webelement id in that page. Since the error is present on all windows machines the grid was configured for the test with only one node Windows Server 2022. We have starting with version 114 of chrome and going up to version 131. All the tests were executed with the exactly the same version of browser and driver. The first failure happened with the latest version of 131 (131.0.6778.264), so we have drilled down into the minor versions of 131. The first version that failed was 131.0.6741.0 (for both chrome and chromedriver) so we have crosschecked between chrome 131.0.6741.0 and chrome 131.0.6740.0 :
    chrome 131.0.6741.0 + chromedriver 131.0.6740.0 : ko in the first 20 runs
    chrome 131.0.6740.0 + chromedriver 131.0.6741.0 : ok for 500 tests in a row
    So it seems that chrome 131.0.6741.0 is responsible for the issue or maybe selenium is not properly handling the chrome via chromedriver starting with this particular version.
    Some help will be appreciated to unblock this situation :)

How can we reproduce the issue?

The drivers and navigators were downloaded using selenium-manager.exe in command line, like this :
C:\Users\selenium\.cache\selenium\manager\0.4.27>selenium-manager.exe --avoid-stats --browser chrome --browser-version 123
[2025-02-25T08:46:44.431Z INFO ] Driver path: C:\Users\selenium\.cache\selenium\chromedriver\win64\123.0.6312.122\chromedriver.exe
[2025-02-25T08:46:44.435Z INFO ] Browser path: C:\Users\selenium\.cache\selenium\chrome\win64\123.0.6312.122\chrome.exe

Relevant log output

Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: Could not start a new session. Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: disconnected: unable to send message to renderer
  (failed to check if window was closed: disconnected: not connected to DevTools)
  (Session info: chrome=131.0.6778.264)
Host info: host: 'POL01', ip: '10.2.2.240'
Build info: version: '4.29.0', revision: '18ae989'
System info: os.name: 'Windows Server 2022', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.10'
Driver info: driver.version: unknown
Build info: version: '4.29.0', revision: '18ae989'
System info: os.name: 'Windows Server 2022', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.10'
Driver info: driver.version: unknown
Build info: version: '4.29.0', revision: '18ae989'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.14.0-503.21.1.el9_5.x86_64', java.version: '17.0.14'
Driver info: driver.version: unknown
Build info: version: '4.29.0', revision: '5fc1ec94cb'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.14.0-503.21.1.el9_5.x86_64', java.version: '17.0.14'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Command: [null, newSession {capabilities=[Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [--ignore-certificate-errors, --remote-allow-origins=*], extensions: []}, pageLoadStrategy: normal}]}]
Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [--ignore-certificate-errors, --remote-allow-origins=*], extensions: []}, pageLoadStrategy: normal}
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:114)
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:61)
        at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:187)
        at org.openqa.selenium.remote.TracedCommandExecutor.execute(TracedCommandExecutor.java:53)
        at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:545)
        at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:245)
        at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:174)
        at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:152)
        at sop.selenium.Main.main(Main.java:344)

Operating System

HUB on RedHat9, node on Windows Server 2022 Datacenter Edition

Selenium version

4.29.0

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

chrome starting with version chrome 131.0.6741.0

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

chromedriver 131.latest is working fine

Are you using Selenium Grid?

Grid 4.29.0

Copy link

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

@zefkide
Copy link
Author

zefkide commented Feb 25, 2025

Same issue with antivirus disabled, so is no AV related

@cgoldberg
Copy link
Contributor

This is likely a bug in Chromedriver or Chrome and not something Selenium can fix. That exception is thrown when an error is returned by chromedriver.

@zefkide
Copy link
Author

zefkide commented Feb 25, 2025

In this way selenium become potentialy incompatible with chrome on windows starting with the version 131.0.6741.0. I will try to check if the same results are obtained without the grid infrastructure in order to simplify the way this issue can be reproduced.

@cgoldberg
Copy link
Contributor

@zefkide simple reproduction steps would be helpful. Also try to reproduce it on the latest version of chromedriver and Chrome (currently 133 I think).

If it persists, report it to the chromedriver maintainers:
https://issues.chromium.org/issues?q=componentid:1608258


I am going to close this issue since I don't think there is any action for Selenium devs to take. Feel free to re-open it or submit a new one with reproduction steps if that's not the case.

@zefkide
Copy link
Author

zefkide commented Feb 27, 2025

Just for information the issue was posted on chromium support board here along with all the steps to reproduce and without using selenium grid infrastructure. The issue was paired with some other related error that I was able to found in our logs : "Invalid session Id" and browser closed.

@zefkide
Copy link
Author

zefkide commented Feb 28, 2025

Hello,
The chromium team is considering a selenium(code) issue. They require some selenium assistance to provide further input and adding "TE-Needs TriageHelp"
Best regards

@cgoldberg
Copy link
Contributor

@zefkide

I disagree with that analysis. Your repro case essentially just instantiates webdriver.Chrome() and immediately crashes with an error from chromedriver.

Can you try to launch Chrome without selenium on this system and see what happens?

I will re-open this for now, but I don't see how we can fix anything based on info provided.

Also, please add your original repro code to this issue.

@cgoldberg cgoldberg reopened this Feb 28, 2025
@zefkide
Copy link
Author

zefkide commented Feb 28, 2025

Hello,
First of all chrome is working fine on all machines that I tested (4 windows machines). It never crashed in a normal human usage. Also all the versions prior to 131.0.6741.0 runs just fine 500+ tests in a loop. All versions starting with 131.0.6741.0 (and up to 133.latest) are crashing in the same way and doesn't take more than 20-30 (very rare goes to 50-60) loops until happening.
In java (with selenium grid) the crash happen in the second line of the code (since the program is configured for using sGridUrl) :
if (sGridUrl == null) driver = new ChromeDriver(options);
else driver = new RemoteWebDriver(new URL(sGridUrl), options); ### <--- crashing here on all windows nodes
Best regards

@cgoldberg
Copy link
Contributor

@zefkide

Since it happens in both Java and Python, and only with newer versions of ChromeDriver/Chrome, that makes me more convinced it's a Chrome or Chromedriver issue.

I have no idea how to proceed or what to fix in selenium based on the info you provided. I'll leave this issue open for now in case someone else has an idea.

@cgoldberg
Copy link
Contributor

@zefkide

Also, can you provide a short self-contained code sample that reproduces this, just so we have it recorded in this issue?

@zefkide
Copy link
Author

zefkide commented Feb 28, 2025

In java (17.x) on windows machine x64:
Download chrome/chromedriver versions 131.0.6740.0 and 131.0.6741.0 in a test folder then run this code :

public static void main(String[] args)  {
	String version = args[0];
	int loops = Integer.parseInt(args[1]);
	WebDriver driver = null;
	ChromeOptions options = new ChromeOptions();
	options.setBinary("chrome" + version + "/chrome.exe");
	System.setProperty("webdriver.chrome.driver", "chromedriver" + version + ".exe");

	for (int i = 1; i <= loops; i++) {
		try {
  	        System.out.println("Test: " + i);
		driver = new ChromeDriver(options);
		driver.get("http://localhost/test.html");
		WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(5)); 
		WebElement elem = wait.until(ExpectedConditions
				.visibilityOfElementLocated(By.id("myCustomId")));
		} finally {
			driver.quit();
		}
	}
}

if you will run the command : java -jar myTestApp.jar 40 50
then you will use version 131.0.6740.0 and 50 loops and app runs smoothly

if you will run the command : java -jar myTestApp.jar 41 50
then you will use version 131.0.6741.0 and 50 loops and app will crash with following exception :
...

Test: 25
Test: 26
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: disconnected: Unable to receive message from renderer
  (failed to check if window was closed: disconnected: not connected to DevTools)
  (Session info: chrome=131.0.6741.0)
Host info: host: 'MYHOSTNAME', ip: '10.2.2.112'
Build info: version: '4.29.0', revision: '5fc1ec94cb'
System info: os.name: 'Windows Server 2019', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.10'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [], binary: chrome41/chrome.exe, extensions: []}}]}]
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:114)
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:61)
        at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:187)
        at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:216)
        at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:174)
        at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:545)
        at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:245)
        at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:174)
        at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:110)
        at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:88)
        at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:83)
        at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:72)
        at sop.selenium.Main.main(Main.java:70)

@zefkide
Copy link
Author

zefkide commented Feb 28, 2025

Is anyone able to confirm that at list this issue exist ?

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

No branches or pull requests

2 participants