Skip to content

[🐛 Bug]: Selenium unable to connect to Chrome 128 when not directly installed #14438

@fredericDelaporte

Description

@fredericDelaporte

What happened?

We have .Net console application run as a Windows Service which uses Selenium to drive Chrome, through Selenium.WebDriver.ChromeDriver 128 and Selenium.WebDriver 4.23. So, it is run under Windows 11 and Windows Server 2022.

In our different environments, it has started to fail since last week, with the latest affected environment failing since yesterday (Sunday 25 of August). It appears to fail working with Chrome 128. The BrowserVersion option was set as stable. Forcing it to 127 restores the application, allowing it to operate normally. Switching back to stable or forcing it explicitly to 128 causes the trouble to appear again.

The trouble was originally seen while using ChromeDriver 127. Upgrading it to 128 changed nothing. Purging the .cache/selenium folder did not help.

The trouble is not reproducible on a machine on which Chrome 128 is directly installed. If it is not installed, or if only an older version is installed, the trouble occurs.

When there is the trouble, the application logs contain an error about a network service crash, then a "Sandbox cannot access executable" error, then timeouts from renderer.

Chrome-Error-Log.txt
Chrome-Normal-Log.txt

Moreover, running the application locally in an interactive session show a blank window appearing, when the trouble occurs.
Chrome-Blank-Windows

Of course it may be a Chrome or Chromedriver issue instead of a Selenium one, but I do not know. Still it makes Chrome 128 unusable with Selenium and Windows if there is no standalone installation of Chrome.

And maybe the CI troubles in #14429 are related since it seems to upgrade some things to the 128 version.

How can we reproduce the issue?

Make sure Chrome is not installed at all on the test machine.

In a new net8 Console app project, add Nuget references to Selenium.WebDriver 4.27, and paste this code into the Program.cs file:

using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Internal.Logging;

Log.SetLevel(LogEventLevel.Trace);
var driverOptions = new ChromeOptions()
{
    BrowserVersion = "128"
};
driverOptions.AddArgument("headless");
using var driver = new ChromeDriver(driverOptions);

Console.WriteLine("Press enter to leave");
Console.ReadLine();
Console.WriteLine("Closing Chrome");
driver.Close();
Console.WriteLine("Exiting");

I have not added rendering calls, so that minimal example only shows the initialization troubles including the blank window, not the rendering timeouts. Using 127 as the BrowserVersion makes the initialization troubles disappear.

Relevant log output

14:08:59.501 TRACE SeleniumManager: Driver path: C:\Users\fdelaporte\.cache\selenium\chromedriver\win64\128.0.6613.84\chromedriver.exe
14:08:59.526 TRACE SeleniumManager: Browser path: C:\Users\fdelaporte\.cache\selenium\chrome\win64\128.0.6613.84\chrome.exe
Starting ChromeDriver 128.0.6613.84 (606aa55c7d687518d34b55accc5a71ea0bd28727-refs/branch-heads/6613@{#1335}) on port 51150
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully on port 51150.
14:08:59.866 DEBUG HttpCommandExecutor: Executing command: []: newSession {"capabilities":{"firstMatch":[{"browserName":"chrome","goog:chromeOptions":{"args":["headless"],"binary":"C:\\Users\\fdelaporte\\.cache\\selenium\\chrome\\win64\\128.0.6613.84\\chrome.exe"}}]}}
14:08:59.873 TRACE HttpCommandExecutor: >> Method: POST, RequestUri: 'http://localhost:51150/session', Version: 1.1, Content: System.Net.Http.ByteArrayContent, Headers:
{
  Accept: application/json; charset=utf-8
  User-Agent: selenium/4.23.0
  User-Agent: (.net windows)
  Content-Type: application/json; charset=utf-8
  Content-Length: 194
}
{"capabilities":{"firstMatch":[{"browserName":"chrome","goog:chromeOptions":{"args":["headless"],"binary":"C:\\Users\\fdelaporte\\.cache\\selenium\\chrome\\win64\\128.0.6613.84\\chrome.exe"}}]}}
[24828:27152:0826/140900.126:ERROR:sandbox_win.cc(852)] Sandbox cannot access executable. Check filesystem permissions are valid. See https://bit.ly/31yqMJR.: Acc├¿s refus├®. (0x5)

DevTools listening on ws://127.0.0.1:51153/devtools/browser/c06b5642-48e8-49ae-b2b8-1c0c5e027cbf
[24828:3464:0826/140900.312:ERROR:network_service_instance_impl.cc(608)] Network service crashed, restarting service.
14:09:00.661 TRACE HttpCommandExecutor: << StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
{
  Cache-Control: no-cache
  Content-Length: 866
  Content-Type: application/json; charset=utf-8
}
14:09:00.673 DEBUG HttpCommandExecutor: Response: (c29a448d094106dcb43e27a4ee178b2d Success: System.Collections.Generic.Dictionary`2[System.String,System.Object])
Press enter to leave
Created TensorFlow Lite XNNPACK delegate for CPU.

Closing driver
14:09:17.747 DEBUG HttpCommandExecutor: Executing command: [c29a448d094106dcb43e27a4ee178b2d]: close {}
14:09:17.749 TRACE HttpCommandExecutor: >> Method: DELETE, RequestUri: 'http://localhost:51150/session/c29a448d094106dcb43e27a4ee178b2d/window', Version: 1.1, Content: <null>, Headers:
{
  User-Agent: selenium/4.23.0
  User-Agent: (.net windows)
  Accept: application/json
  Accept: image/png
}
14:09:18.043 TRACE HttpCommandExecutor: << StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
{
  Cache-Control: no-cache
  Content-Length: 12
  Content-Type: application/json; charset=utf-8
}
14:09:18.048 DEBUG HttpCommandExecutor: Response: ( Success: System.Object[])
Exiting

Operating System

Windows 11, Windows Server 2022, run from Paris, France.

Selenium version

.net 8.0.8

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

Chrome 128 (128.0.6613.84)

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

ChromeDriver 128.0.6613.84 (and 127.0.6533.119)

Are you using Selenium Grid?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!I-defectSomething is not working as intendedJ-staleApplied to issues that become stale, and eventually closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions