Skip to content

[🐛 Bug]: UnreachableBrowserException: Error communicating with the remote browser. It may have died. #2840

Open
@prajaktak15

Description

@prajaktak15

What happened?

We are facing issue while executing serenity tests in selenium grid. Serenity version is v4.2.16 .
Tests are failing with below error intermittently.

UnreachableBrowserException: Error communicating with the remote browser. It may have died.

Experiencing issue with selenium version v4.28 onwards for both platforms Linux and Windows.

Command used to start Selenium Grid with Docker (or Kubernetes)

version: "3.0"
services:

 selenium-sec-chrome_Container1:
    environment:
      - SE_EVENT_BUS_HOST=<Hub_Server>
      - SE_EVENT_BUS_PUBLISH_PORT=<Pubilsh_Port>
      - SE_EVENT_BUS_SUBSCRIBE_PORT=<Subscribe_Port>
      - SE_NODE_HOST=<Node_Host>
      - SE_NODE_PORT=<Node_Port>
      - SE_NODE_MAX_SESSIONS=8
      - SE_NODE_OVERRIDE_MAX_SESSIONS=true
      - REMOTE_HOST=https://${HOSTNAME}:<Host>
      - SE_OPTS=--https-certificate /home/seluser/g4httpsgsg.pem --https-private-key /home/seluser/g4httpsgsg.key 
      - SE_NODE_SESSION_TIMEOUT=900
      - SE_DRAIN_AFTER_SESSION_COUNT=100
      - SE_NODE_GRID_URL=<Pubilsh_Port>
#   image: /node-chrome:4.28.1-20250202
#   image: /node-chrome:4.32.0-20250505
    image: /node-chrome:4.30.0-20250323
    privileged: true
#    logging:
#     driver: "none"
    shm_size: 8gb
    ports:
      - <Port>:<Port>
    restart: always
    volumes:
      - /dev/shm:/dev/shm
      - /opt/grid/cert:/home/seluser

Relevant log output

1. Node error log : Selnium v4.30

Driver info: driver.version: unknown
org.openqa.selenium.WebDriverException: Build info: version: '4.30.0', revision: '509c7f1'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '4.18.0-553.47.1.el8_10.x86_64', java.version: '21.0.6'
Driver info: driver.version: unknown
        at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute(JdkHttpClient.java:419)
        at org.openqa.selenium.remote.tracing.TracedHttpClient.execute(TracedHttpClient.java:54)
        at org.openqa.selenium.grid.web.ReverseProxyHandler.execute(ReverseProxyHandler.java:91)
        at org.openqa.selenium.grid.node.DefaultActiveSession.execute(DefaultActiveSession.java:62)
        at org.openqa.selenium.grid.node.local.SessionSlot.execute(SessionSlot.java:130)
        at org.openqa.selenium.grid.node.local.LocalNode.executeWebDriverCommand(LocalNode.java:718)
        at org.openqa.selenium.grid.node.ForwardWebDriverCommand.execute(ForwardWebDriverCommand.java:48)
        at org.openqa.selenium.remote.http.Route$PredicatedRoute.handle(Route.java:397)
        at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
        at org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute(SpanWrappedHttpHandler.java:87)
        at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)
        at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:360)
        at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
        at org.openqa.selenium.grid.node.Node.execute(Node.java:286)
        at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:360)
        at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
        at org.openqa.selenium.remote.AddWebDriverSpecHeaders.lambda$apply$0(AddWebDriverSpecHeaders.java:35)
        at org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)
        at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)
        at org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)
        at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)
        at org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0(SeleniumHandler.java:49)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.InterruptedException
        at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:386)
        at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073)
        at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute(JdkHttpClient.java:413)
        ... 26 more

2. Test Error Log :

org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: '4.28.1', revision: '73f5ad48a2'
System info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '14.7.5', java.version: '17.0.11'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Command: [5206e5c379c7e2969c8257bd24bf086d, findElements [using, value]]

Operating System

Linux Redhat

Docker Selenium version (image tag)

4.30.0-20250323

Selenium Grid chart version (chart version)

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions