Skip to content

[🐛 Bug]: Incorrect response structure (not W3C conforming) when unable to find session #12655

@OndraM

Description

@OndraM

What happened?

Errors returned from the remote end should have according to W3C WebDriver spec structure like this:

{
	"value": {
		"error": "invalid session id",
		"message": "No active session with ID 1234",
		"stacktrace": ""
	}
}

This is real-world exception thrown from Selenium server for example when you abruptly close the browser window.

{
  "value": {
    "error": "no such window",
    "message": "no such window: target window already closed
      from unknown error: web view not found
        (Session info: chrome=114.0.5735.198)",
    "stacktrace": "(... stacktrace)"
  }
}

So this is according to the specs.

However, when the tests keep waiting for ~5 minutes and does not execute any commands, Selenium server kills the window with this error in its error log:

14:59:25.369 INFO [LocalNode.stopTimedOutSession] - Session id af891282bf0901a8a29be389a0c505b7 timed out, stopping...

If the client now tries to execute new command, it should obviously fail, because the session is no longer existing. It will fail, but the error JSON client gets as a response is like this:

 {
  value: '/session/0dda41f3d86b6d1dd3e7733ab400f33a',
  message: 'Unable to execute request for an existing session: Unable to find session with ID: 0dda41f3d86b6d1dd3e7733ab400f33a\n' +
    "Build info: version: '4.10.0', revision: 'c14d967899'\n" +
    "System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.4.11-arch2-1', java.version: '20.0.2'\n" +
    'Driver info: driver.version: unknown',
  error: 'invalid session id'
}
  • value is string, not map
  • error and message keys are not part of value map

Which is format not described in the specs, and it is also unexpected by various language bindings, which does not recognize this as proper errors.

How can we reproduce the issue?

  1. Start test
  2. Make the test wait for >5 minutes without executing any commands, for example in WebdriverIO default project:
describe('My Login application', () => {
    it('should login with valid credentials', async () => {
        await LoginPage.open()

        await new Promise(r => setTimeout(r, 500000)); // wait 500 seconds, in the meantime, Selenium will close the browser window

        await LoginPage.login('tomsmith', 'SuperSecretPassword!') // this will fail, but with wrong error
    })
  1. Attempt to make a new command

Relevant log output

15:26:06.041 DEBUG [LocalDistributor.updateNodeAvailability] - Health check result for http://192.168.0.67:4444 was UP
15:27:36.514 INFO [LocalNode.stopTimedOutSession] - Session id bf78f9c50c55618a4778327af6e66a23 timed out, stopping...
15:27:36.517 DEBUG [NettyConnectListener.writeRequest] - Using new Channel '[id: 0xac4be912, L:/127.0.0.1:37384 - R:localhost/127.0.0.1:16421]' for 'DELETE' to '/session/bf78f9c50c55618a4778327af6e66a23'
15:27:36.570 DEBUG [HttpHandler.handleHttpResponse] - 

Request DefaultFullHttpRequest(decodeResult: success, version: HTTP/1.1, content: EmptyByteBufBE)
DELETE /session/bf78f9c50c55618a4778327af6e66a23 HTTP/1.1
traceparent: 00-0e56c0f57ec9aeedfd868ccce3c6189e-44e486110aa231f0-01
host: localhost:16421
Connection: keep-alive
User-Agent: selenium/4.12.0 (java unix)
accept: */*

Response DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 200 OK
Content-Length: 14
Content-Type: application/json; charset=utf-8
cache-control: no-cache

15:27:36.571 DEBUG [ChannelManager.tryToOfferChannelToPool] - Adding key: http://localhost:16421 for channel [id: 0xac4be912, L:/127.0.0.1:37384 - R:localhost/127.0.0.1:16421]
15:27:36.571 DEBUG [SeleniumSpanExporter$1.lambda$export$4] - SpanData{spanContext=ImmutableSpanContext{traceId=0e56c0f57ec9aeedfd868ccce3c6189e, spanId=44e486110aa231f0, traceFlags=01, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=true}, parentSpanContext=ImmutableSpanContext{traceId=0e56c0f57ec9aeedfd868ccce3c6189e, spanId=edbbf7a821500d42, traceFlags=01, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=true}, resource=Resource{schemaUrl=https://opentelemetry.io/schemas/1.20.0, attributes={service.name="unknown_service:java", telemetry.sdk.language="java", telemetry.sdk.name="opentelemetry", telemetry.sdk.version="1.28.0"}}, instrumentationScopeInfo=InstrumentationScopeInfo{name=default, version=null, schemaUrl=null, attributes={}}, name=httpclient.execute, kind=INTERNAL, startEpochNanos=1693574856514109998, endEpochNanos=1693574856570445176, attributes=AttributesMap{data={http.status_code=200, http.method=DELETE, span.kind=client, http.target=/session/bf78f9c50c55618a4778327af6e66a23}, capacity=128, totalAddedValues=4}, totalAttributeCount=4, events=[], totalRecordedEvents=0, links=[], totalRecordedLinks=0, status=ImmutableStatusData{statusCode=OK, description=Kind: OK Description:}, hasEnded=true}
15:27:36.571 DEBUG [SeleniumSpanExporter$1.lambda$export$4] - SpanData{spanContext=ImmutableSpanContext{traceId=0e56c0f57ec9aeedfd868ccce3c6189e, spanId=edbbf7a821500d42, traceFlags=01, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=true}, parentSpanContext=ImmutableSpanContext{traceId=00000000000000000000000000000000, spanId=0000000000000000, traceFlags=00, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=false}, resource=Resource{schemaUrl=https://opentelemetry.io/schemas/1.20.0, attributes={service.name="unknown_service:java", telemetry.sdk.language="java", telemetry.sdk.name="opentelemetry", telemetry.sdk.version="1.28.0"}}, instrumentationScopeInfo=InstrumentationScopeInfo{name=default, version=null, schemaUrl=null, attributes={}}, name=reverse_proxy, kind=INTERNAL, startEpochNanos=1693574856514000000, endEpochNanos=1693574856570730674, attributes=AttributesMap{data={http.status_code=200, http.method=DELETE, http.target=/session/bf78f9c50c55618a4778327af6e66a23}, capacity=128, totalAddedValues=3}, totalAttributeCount=3, events=[], totalRecordedEvents=0, links=[], totalRecordedLinks=0, status=ImmutableStatusData{statusCode=OK, description=Kind: OK Description:}, hasEnded=true}
15:27:36.571 DEBUG [UrlChecker.waitUntilUnavailable] - Waiting for http://localhost:16421/shutdown
15:27:36.572 DEBUG [UrlChecker.lambda$waitUntilUnavailable$2] - Polling http://localhost:16421/shutdown
15:27:36.572 DEBUG [HttpURLConnection.writeRequests] - sun.net.www.MessageHeader@110304a55 pairs: {GET /shutdown HTTP/1.1: null}{User-Agent: Java/20.0.2}{Host: localhost:16421}{Accept: */*}{Connection: keep-alive}
15:27:36.582 DEBUG [HttpURLConnection.getInputStream0] - sun.net.www.MessageHeader@1fc4e8f53 pairs: {null: HTTP/1.1 200 OK}{Content-Length: 40}{Content-Type: application/json; charset=utf-8}
15:27:36.582 DEBUG [AsyncHttpClientHandler.channelInactive] - Channel Closed: [id: 0xac4be912, L:/127.0.0.1:37384 ! R:localhost/127.0.0.1:16421] with attribute DISCARD
15:27:36.592 DEBUG [UrlChecker.lambda$waitUntilUnavailable$2] - Polling http://localhost:16421/shutdown
15:27:36.594 INFO [LocalSessionMap.lambda$new$0] - Deleted session from local Session Map, Id: bf78f9c50c55618a4778327af6e66a23
15:27:36.594 DEBUG [SeleniumSpanExporter$1.lambda$export$4] - SpanData{spanContext=ImmutableSpanContext{traceId=cc326fdb590d1061a2e5322499469b73, spanId=76693d6dd07a494e, traceFlags=01, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=true}, parentSpanContext=ImmutableSpanContext{traceId=00000000000000000000000000000000, spanId=0000000000000000, traceFlags=00, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=false}, resource=Resource{schemaUrl=https://opentelemetry.io/schemas/1.20.0, attributes={service.name="unknown_service:java", telemetry.sdk.language="java", telemetry.sdk.name="opentelemetry", telemetry.sdk.version="1.28.0"}}, instrumentationScopeInfo=InstrumentationScopeInfo{name=default, version=null, schemaUrl=null, attributes={}}, name=local_sessionmap.remove, kind=INTERNAL, startEpochNanos=1693574856594000000, endEpochNanos=1693574856594149922, attributes=AttributesMap{data={session.id=bf78f9c50c55618a4778327af6e66a23}, capacity=128, totalAddedValues=1}, totalAttributeCount=1, events=[ImmutableEventData{name=Deleted session from local Session Map, attributes={logger="org.openqa.selenium.grid.sessionmap.local.LocalSessionMap", session.id="bf78f9c50c55618a4778327af6e66a23"}, epochNanos=1693574856594056466, totalAttributeCount=2}], totalRecordedEvents=1, links=[], totalRecordedLinks=0, status=ImmutableStatusData{statusCode=UNSET, description=}, hasEnded=true}
15:27:36.595 DEBUG [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "cc326fdb590d1061a2e5322499469b73","eventTime": 1693574856594056466,"eventName": "Deleted session from local Session Map","attributes": {"logger": "org.openqa.selenium.grid.sessionmap.local.LocalSessionMap","session.id": "bf78f9c50c55618a4778327af6e66a23"}}

15:27:36.595 INFO [GridModel.release] - Releasing slot for session id bf78f9c50c55618a4778327af6e66a23
15:27:36.595 INFO [SessionSlot.stop] - Stopping session bf78f9c50c55618a4778327af6e66a23
15:27:36.595 DEBUG [LocalNode.lambda$new$5] - Removing Downloads folder associated with bf78f9c50c55618a4778327af6e66a23
15:27:36.595 DEBUG [LocalNode.lambda$new$6] - Removing Uploads folder associated with bf78f9c50c55618a4778327af6e66a23
15:27:36.687 DEBUG [DefaultChannelPool$IdleChannelDetector.run] - Entry count for : http://localhost:16421 : 1
15:27:36.687 DEBUG [DefaultChannelPool$IdleChannelDetector.expiredChannels] - Adding Candidate expired Channel [id: 0xac4be912, L:/127.0.0.1:37384 ! R:localhost/127.0.0.1:16421] isIdleTimeoutExpired=false isRemotelyClosed=true isTtlExpired=false
15:27:36.687 DEBUG [DefaultChannelPool$IdleChannelDetector.closeChannels] - Closing Idle Channel [id: 0xac4be912, L:/127.0.0.1:37384 ! R:localhost/127.0.0.1:16421]
15:27:36.688 DEBUG [DefaultChannelPool$IdleChannelDetector.run] - Closed 1 connections out of 1 in 1 ms
15:28:06.040 DEBUG [LocalDistributor.lambda$asRunnableHealthCheck$9] - Running healthcheck for Node http://192.168.0.67:4444
15:28:06.041 DEBUG [LocalDistributor.updateNodeAvailability] - Health check result for http://192.168.0.67:4444 was UP
15:30:06.040 DEBUG [LocalDistributor.lambda$asRunnableHealthCheck$9] - Running healthcheck for Node http://192.168.0.67:4444
15:30:06.041 DEBUG [LocalDistributor.updateNodeAvailability] - Health check result for http://192.168.0.67:4444 was UP
15:30:35.697 DEBUG [RequestConverter.channelRead0] - Incoming message: DefaultHttpRequest(decodeResult: success, version: HTTP/1.1)
POST /session/bf78f9c50c55618a4778327af6e66a23/element HTTP/1.1
user-agent: webdriver/8.15.10
content-type: application/json; charset=utf-8
connection: keep-alive
accept: application/json
content-length: 44
accept-encoding: gzip, deflate, br
Host: localhost:4444
15:30:35.697 DEBUG [RequestConverter.channelRead0] - Start of http request: DefaultHttpRequest(decodeResult: success, version: HTTP/1.1)
POST /session/bf78f9c50c55618a4778327af6e66a23/element HTTP/1.1
user-agent: webdriver/8.15.10
content-type: application/json; charset=utf-8
connection: keep-alive
accept: application/json
content-length: 44
accept-encoding: gzip, deflate, br
Host: localhost:4444
15:30:35.697 DEBUG [RequestConverter.channelRead0] - Incoming message: DefaultLastHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 44, cap: 44/44, unwrapped: PooledUnsafeDirectByteBuf(ridx: 317, widx: 317, cap: 1024)), decoderResult: success)
15:30:35.697 DEBUG [RequestConverter.channelRead0] - End of http request: DefaultLastHttpContent(data: PooledSlicedByteBuf(ridx: 44, widx: 44, cap: 44/44, unwrapped: PooledUnsafeDirectByteBuf(ridx: 317, widx: 317, cap: 1024)), decoderResult: success)
15:30:35.698 DEBUG [HttpTracing.inject] - Injecting (POST) /session/bf78f9c50c55618a4778327af6e66a23/element into OpenTelemetrySpan{traceId=86ec9da93ea55e01f1ca4e1dcc7fb097,spanId=c694b45da6852ba1} at org.openqa.selenium.grid.router.HandleSession:124
15:30:35.701 DEBUG [SeleniumSpanExporter$1.lambda$export$4] - SpanData{spanContext=ImmutableSpanContext{traceId=86ec9da93ea55e01f1ca4e1dcc7fb097, spanId=c694b45da6852ba1, traceFlags=01, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=true}, parentSpanContext=ImmutableSpanContext{traceId=00000000000000000000000000000000, spanId=0000000000000000, traceFlags=00, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=false}, resource=Resource{schemaUrl=https://opentelemetry.io/schemas/1.20.0, attributes={service.name="unknown_service:java", telemetry.sdk.language="java", telemetry.sdk.name="opentelemetry", telemetry.sdk.version="1.28.0"}}, instrumentationScopeInfo=InstrumentationScopeInfo{name=default, version=null, schemaUrl=null, attributes={}}, name=router.handle_session, kind=INTERNAL, startEpochNanos=1693575035698000000, endEpochNanos=1693575035700071181, attributes=AttributesMap{data={session.id=bf78f9c50c55618a4778327af6e66a23, http.method=POST, error=true, http.target=/session/bf78f9c50c55618a4778327af6e66a23/element}, capacity=128, totalAddedValues=4}, totalAttributeCount=4, events=[ImmutableEventData{name=exception, attributes={exception.message="Unable to execute request for an existing session: Unable to find session with ID: bf78f9c50c55618a4778327af6e66a23
Build info: version: '4.12.0', revision: '249f2a7d1b*'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.4.11-arch2-1', java.version: '20.0.2'
Driver info: driver.version: unknown", exception.stacktrace="org.openqa.selenium.NoSuchSessionException: Unable to find session with ID: bf78f9c50c55618a4778327af6e66a23
Build info: version: '4.12.0', revision: '249f2a7d1b*'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.4.11-arch2-1', java.version: '20.0.2'
Driver info: driver.version: unknown
        at org.openqa.selenium.grid.sessionmap.local.LocalSessionMap.get(LocalSessionMap.java:137)
        at org.openqa.selenium.grid.router.HandleSession.lambda$loadSessionId$4(HandleSession.java:172)
        at io.opentelemetry.context.Context.lambda$wrap$2(Context.java:224)
        at org.openqa.selenium.grid.router.HandleSession.execute(HandleSession.java:125)
        at org.openqa.selenium.remote.http.Route$PredicatedRoute.handle(Route.java:384)
        at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
        at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)
        at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
        at org.openqa.selenium.grid.router.Router.execute(Router.java:87)
        at org.openqa.selenium.grid.web.CheckOriginHeader.lambda$apply$0(CheckOriginHeader.java:69)
        at org.openqa.selenium.grid.web.CheckContentTypeHeader.lambda$apply$0(CheckContentTypeHeader.java:75)
        at org.openqa.selenium.grid.web.EnsureSpecCompliantResponseHeaders.lambda$apply$0(EnsureSpecCompliantResponseHeaders.java:34)
        at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)
        at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)
        at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
        at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)
        at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
        at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)
        at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
        at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)
        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:44)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:577)
        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:1623)
", exception.type="org.openqa.selenium.NoSuchSessionException", http.flavor=1, http.handler_class="org.openqa.selenium.grid.router.HandleSession", http.host="localhost:4444", http.method="POST", http.request_content_length="44", http.scheme="HTTP", http.target="/session/bf78f9c50c55618a4778327af6e66a23/element", http.user_agent="webdriver/8.15.10", session.id="bf78f9c50c55618a4778327af6e66a23"}, epochNanos=1693575035699930506, totalAttributeCount=12}], totalRecordedEvents=1, links=[], totalRecordedLinks=0, status=ImmutableStatusData{statusCode=ERROR, description=Kind: CANCELLED Description:}, hasEnded=true}
15:30:35.701 WARN [SeleniumSpanExporter$1.lambda$export$1] - Unable to execute request for an existing session: Unable to find session with ID: bf78f9c50c55618a4778327af6e66a23
Build info: version: '4.12.0', revision: '249f2a7d1b*'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.4.11-arch2-1', java.version: '20.0.2'
Driver info: driver.version: unknown
15:30:35.701 WARN [SeleniumSpanExporter$1.lambda$export$1] - org.openqa.selenium.NoSuchSessionException: Unable to find session with ID: bf78f9c50c55618a4778327af6e66a23
Build info: version: '4.12.0', revision: '249f2a7d1b*'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.4.11-arch2-1', java.version: '20.0.2'
Driver info: driver.version: unknown
        at org.openqa.selenium.grid.sessionmap.local.LocalSessionMap.get(LocalSessionMap.java:137)
        at org.openqa.selenium.grid.router.HandleSession.lambda$loadSessionId$4(HandleSession.java:172)
        at io.opentelemetry.context.Context.lambda$wrap$2(Context.java:224)
        at org.openqa.selenium.grid.router.HandleSession.execute(HandleSession.java:125)
        at org.openqa.selenium.remote.http.Route$PredicatedRoute.handle(Route.java:384)
        at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
        at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)
        at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
        at org.openqa.selenium.grid.router.Router.execute(Router.java:87)
        at org.openqa.selenium.grid.web.CheckOriginHeader.lambda$apply$0(CheckOriginHeader.java:69)
        at org.openqa.selenium.grid.web.CheckContentTypeHeader.lambda$apply$0(CheckContentTypeHeader.java:75)
        at org.openqa.selenium.grid.web.EnsureSpecCompliantResponseHeaders.lambda$apply$0(EnsureSpecCompliantResponseHeaders.java:34)
        at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)
        at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)
        at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
        at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)
        at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
        at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)
        at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
        at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)
        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:44)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:577)
        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:1623)

15:30:35.701 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "86ec9da93ea55e01f1ca4e1dcc7fb097","eventTime": 1693575035699930506,"eventName": "exception","attributes": {"exception.message": "Unable to execute request for an existing session: Unable to find session with ID: bf78f9c50c55618a4778327af6e66a23\nBuild info: version: '4.12.0', revision: '249f2a7d1b*'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.4.11-arch2-1', java.version: '20.0.2'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.NoSuchSessionException: Unable to find session with ID: bf78f9c50c55618a4778327af6e66a23\nBuild info: version: '4.12.0', revision: '249f2a7d1b*'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.4.11-arch2-1', java.version: '20.0.2'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.grid.sessionmap.local.LocalSessionMap.get(LocalSessionMap.java:137)\n\tat org.openqa.selenium.grid.router.HandleSession.lambda$loadSessionId$4(HandleSession.java:172)\n\tat io.opentelemetry.context.Context.lambda$wrap$2(Context.java:224)\n\tat org.openqa.selenium.grid.router.HandleSession.execute(HandleSession.java:125)\n\tat org.openqa.selenium.remote.http.Route$PredicatedRoute.handle(Route.java:384)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.grid.router.Router.execute(Router.java:87)\n\tat org.openqa.selenium.grid.web.CheckOriginHeader.lambda$apply$0(CheckOriginHeader.java:69)\n\tat org.openqa.selenium.grid.web.CheckContentTypeHeader.lambda$apply$0(CheckContentTypeHeader.java:75)\n\tat org.openqa.selenium.grid.web.EnsureSpecCompliantResponseHeaders.lambda$apply$0(EnsureSpecCompliantResponseHeaders.java:34)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.remote.AddWebDriverSpecHeaders.lambda$apply$0(AddWebDriverSpecHeaders.java:35)\n\tat org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)\n\tat org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)\n\tat org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0(SeleniumHandler.java:44)\n\tat java.base\u002fjava.util.concurrent.Executors$RunnableAdapter.call(Executors.java:577)\n\tat java.base\u002fjava.util.concurrent.FutureTask.run(FutureTask.java:317)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)\n\tat java.base\u002fjava.lang.Thread.run(Thread.java:1623)\n","exception.type": "org.openqa.selenium.NoSuchSessionException","http.flavor": 1,"http.handler_class": "org.openqa.selenium.grid.router.HandleSession","http.host": "localhost:4444","http.method": "POST","http.request_content_length": "44","http.scheme": "HTTP","http.target": "\u002fsession\u002fbf78f9c50c55618a4778327af6e66a23\u002felement","http.user_agent": "webdriver\u002f8.15.10","session.id": "bf78f9c50c55618a4778327af6e66a23"}}

15:30:35.714 DEBUG [RequestConverter.channelRead0] - Incoming message: DefaultHttpRequest(decodeResult: success, version: HTTP/1.1)
POST /session/bf78f9c50c55618a4778327af6e66a23/elements HTTP/1.1
user-agent: webdriver/8.15.10
content-type: application/json; charset=utf-8
connection: keep-alive
accept: application/json
content-length: 44
accept-encoding: gzip, deflate, br
Host: localhost:4444
15:30:35.714 DEBUG [RequestConverter.channelRead0] - Start of http request: DefaultHttpRequest(decodeResult: success, version: HTTP/1.1)
POST /session/bf78f9c50c55618a4778327af6e66a23/elements HTTP/1.1
user-agent: webdriver/8.15.10
content-type: application/json; charset=utf-8
connection: keep-alive
accept: application/json
content-length: 44
accept-encoding: gzip, deflate, br
Host: localhost:4444
15:30:35.715 DEBUG [RequestConverter.channelRead0] - Incoming message: DefaultLastHttpContent(data: PooledSlicedByteBuf(ridx: 0, widx: 44, cap: 44/44, unwrapped: PooledUnsafeDirectByteBuf(ridx: 318, widx: 318, cap: 1024)), decoderResult: success)
15:30:35.715 DEBUG [RequestConverter.channelRead0] - End of http request: DefaultLastHttpContent(data: PooledSlicedByteBuf(ridx: 44, widx: 44, cap: 44/44, unwrapped: PooledUnsafeDirectByteBuf(ridx: 318, widx: 318, cap: 1024)), decoderResult: success)
15:30:35.715 DEBUG [HttpTracing.inject] - Injecting (POST) /session/bf78f9c50c55618a4778327af6e66a23/elements into OpenTelemetrySpan{traceId=7a647bbfbb275ccc0664c759984c274e,spanId=9ba5a2e35dd3ddb5} at org.openqa.selenium.grid.router.HandleSession:124
15:30:35.716 DEBUG [SeleniumSpanExporter$1.lambda$export$4] - SpanData{spanContext=ImmutableSpanContext{traceId=7a647bbfbb275ccc0664c759984c274e, spanId=9ba5a2e35dd3ddb5, traceFlags=01, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=true}, parentSpanContext=ImmutableSpanContext{traceId=00000000000000000000000000000000, spanId=0000000000000000, traceFlags=00, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=false}, resource=Resource{schemaUrl=https://opentelemetry.io/schemas/1.20.0, attributes={service.name="unknown_service:java", telemetry.sdk.language="java", telemetry.sdk.name="opentelemetry", telemetry.sdk.version="1.28.0"}}, instrumentationScopeInfo=InstrumentationScopeInfo{name=default, version=null, schemaUrl=null, attributes={}}, name=router.handle_session, kind=INTERNAL, startEpochNanos=1693575035715000000, endEpochNanos=1693575035715744994, attributes=AttributesMap{data={session.id=bf78f9c50c55618a4778327af6e66a23, http.method=POST, error=true, http.target=/session/bf78f9c50c55618a4778327af6e66a23/elements}, capacity=128, totalAddedValues=4}, totalAttributeCount=4, events=[ImmutableEventData{name=exception, attributes={exception.message="Unable to execute request for an existing session: Unable to find session with ID: bf78f9c50c55618a4778327af6e66a23
Build info: version: '4.12.0', revision: '249f2a7d1b*'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.4.11-arch2-1', java.version: '20.0.2'
Driver info: driver.version: unknown", exception.stacktrace="org.openqa.selenium.NoSuchSessionException: Unable to find session with ID: bf78f9c50c55618a4778327af6e66a23
Build info: version: '4.12.0', revision: '249f2a7d1b*'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.4.11-arch2-1', java.version: '20.0.2'
Driver info: driver.version: unknown
        at org.openqa.selenium.grid.sessionmap.local.LocalSessionMap.get(LocalSessionMap.java:137)
        at org.openqa.selenium.grid.router.HandleSession.lambda$loadSessionId$4(HandleSession.java:172)
        at io.opentelemetry.context.Context.lambda$wrap$2(Context.java:224)
        at org.openqa.selenium.grid.router.HandleSession.execute(HandleSession.java:125)
        at org.openqa.selenium.remote.http.Route$PredicatedRoute.handle(Route.java:384)
        at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
        at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)
        at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
        at org.openqa.selenium.grid.router.Router.execute(Router.java:87)
        at org.openqa.selenium.grid.web.CheckOriginHeader.lambda$apply$0(CheckOriginHeader.java:69)
        at org.openqa.selenium.grid.web.CheckContentTypeHeader.lambda$apply$0(CheckContentTypeHeader.java:75)
        at org.openqa.selenium.grid.web.EnsureSpecCompliantResponseHeaders.lambda$apply$0(EnsureSpecCompliantResponseHeaders.java:34)
        at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)
        at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)
        at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
        at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)
        at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
        at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)
        at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
        at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)
        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:44)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:577)
        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:1623)
", exception.type="org.openqa.selenium.NoSuchSessionException", http.flavor=1, http.handler_class="org.openqa.selenium.grid.router.HandleSession", http.host="localhost:4444", http.method="POST", http.request_content_length="44", http.scheme="HTTP", http.target="/session/bf78f9c50c55618a4778327af6e66a23/elements", http.user_agent="webdriver/8.15.10", session.id="bf78f9c50c55618a4778327af6e66a23"}, epochNanos=1693575035715608857, totalAttributeCount=12}], totalRecordedEvents=1, links=[], totalRecordedLinks=0, status=ImmutableStatusData{statusCode=ERROR, description=Kind: CANCELLED Description:}, hasEnded=true}
15:30:35.716 WARN [SeleniumSpanExporter$1.lambda$export$1] - Unable to execute request for an existing session: Unable to find session with ID: bf78f9c50c55618a4778327af6e66a23
Build info: version: '4.12.0', revision: '249f2a7d1b*'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.4.11-arch2-1', java.version: '20.0.2'
Driver info: driver.version: unknown
15:30:35.716 WARN [SeleniumSpanExporter$1.lambda$export$1] - org.openqa.selenium.NoSuchSessionException: Unable to find session with ID: bf78f9c50c55618a4778327af6e66a23
Build info: version: '4.12.0', revision: '249f2a7d1b*'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.4.11-arch2-1', java.version: '20.0.2'
Driver info: driver.version: unknown
        at org.openqa.selenium.grid.sessionmap.local.LocalSessionMap.get(LocalSessionMap.java:137)
        at org.openqa.selenium.grid.router.HandleSession.lambda$loadSessionId$4(HandleSession.java:172)
        at io.opentelemetry.context.Context.lambda$wrap$2(Context.java:224)
        at org.openqa.selenium.grid.router.HandleSession.execute(HandleSession.java:125)
        at org.openqa.selenium.remote.http.Route$PredicatedRoute.handle(Route.java:384)
        at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
        at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)
        at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
        at org.openqa.selenium.grid.router.Router.execute(Router.java:87)
        at org.openqa.selenium.grid.web.CheckOriginHeader.lambda$apply$0(CheckOriginHeader.java:69)
        at org.openqa.selenium.grid.web.CheckContentTypeHeader.lambda$apply$0(CheckContentTypeHeader.java:75)
        at org.openqa.selenium.grid.web.EnsureSpecCompliantResponseHeaders.lambda$apply$0(EnsureSpecCompliantResponseHeaders.java:34)
        at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)
        at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)
        at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
        at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)
        at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
        at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)
        at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
        at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)
        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:44)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:577)
        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:1623)

15:30:35.717 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "7a647bbfbb275ccc0664c759984c274e","eventTime": 1693575035715608857,"eventName": "exception","attributes": {"exception.message": "Unable to execute request for an existing session: Unable to find session with ID: bf78f9c50c55618a4778327af6e66a23\nBuild info: version: '4.12.0', revision: '249f2a7d1b*'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.4.11-arch2-1', java.version: '20.0.2'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.NoSuchSessionException: Unable to find session with ID: bf78f9c50c55618a4778327af6e66a23\nBuild info: version: '4.12.0', revision: '249f2a7d1b*'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.4.11-arch2-1', java.version: '20.0.2'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.grid.sessionmap.local.LocalSessionMap.get(LocalSessionMap.java:137)\n\tat org.openqa.selenium.grid.router.HandleSession.lambda$loadSessionId$4(HandleSession.java:172)\n\tat io.opentelemetry.context.Context.lambda$wrap$2(Context.java:224)\n\tat org.openqa.selenium.grid.router.HandleSession.execute(HandleSession.java:125)\n\tat org.openqa.selenium.remote.http.Route$PredicatedRoute.handle(Route.java:384)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.grid.router.Router.execute(Router.java:87)\n\tat org.openqa.selenium.grid.web.CheckOriginHeader.lambda$apply$0(CheckOriginHeader.java:69)\n\tat org.openqa.selenium.grid.web.CheckContentTypeHeader.lambda$apply$0(CheckContentTypeHeader.java:75)\n\tat org.openqa.selenium.grid.web.EnsureSpecCompliantResponseHeaders.lambda$apply$0(EnsureSpecCompliantResponseHeaders.java:34)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.remote.AddWebDriverSpecHeaders.lambda$apply$0(AddWebDriverSpecHeaders.java:35)\n\tat org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)\n\tat org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)\n\tat org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0(SeleniumHandler.java:44)\n\tat java.base\u002fjava.util.concurrent.Executors$RunnableAdapter.call(Executors.java:577)\n\tat java.base\u002fjava.util.concurrent.FutureTask.run(FutureTask.java:317)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)\n\tat java.base\u002fjava.lang.Thread.run(Thread.java:1623)\n","exception.type": "org.openqa.selenium.NoSuchSessionException","http.flavor": 1,"http.handler_class": "org.openqa.selenium.grid.router.HandleSession","http.host": "localhost:4444","http.method": "POST","http.request_content_length": "44","http.scheme": "HTTP","http.target": "\u002fsession\u002fbf78f9c50c55618a4778327af6e66a23\u002felements","http.user_agent": "webdriver\u002f8.15.10","session.id": "bf78f9c50c55618a4778327af6e66a23"}}

Operating System

Linux

Selenium version

Tested with wdio 8.15.10, but happens with e.g. php-webdriver 1.15.0 as well. But the response does not depend on language bindings.

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

Chrome 116.0.5845.140

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

Chromedriver 116.0.5845.96

Are you using Selenium Grid?

4.12.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-gridEverything grid and server relatedI-defectSomething is not working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions