Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃悰 Bug]: java.io.UncheckedIOException: java.io.IOException: HTTP/1.1 header parser received no bytes #13913

Open
alokkr016 opened this issue May 7, 2024 · 30 comments

Comments

@alokkr016
Copy link

What happened?

13:53:38.611 WARN [SeleniumSpanExporter$1.lambda$export$1] - Error while creating session with the service http://127.0.0.1:8232. java.io.IOException: HTTP/1.1 header parser received no bytes
13:53:38.611 WARN [SeleniumSpanExporter$1.lambda$export$1] - java.io.UncheckedIOException: java.io.IOException: HTTP/1.1 header parser received no bytes
at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute0(JdkHttpClient.java:439)
at org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42)
at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:55)
at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute(JdkHttpClient.java:355)
at org.openqa.selenium.remote.tracing.TracedHttpClient.execute(TracedHttpClient.java:54)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:89)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:61)
at org.openqa.selenium.grid.node.relay.RelaySessionFactory.apply(RelaySessionFactory.java:169)
at org.openqa.selenium.grid.node.relay.RelaySessionFactory.apply(RelaySessionFactory.java:70)
at org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)
at org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)
at org.openqa.selenium.grid.node.NewNodeSession.execute(NewNodeSession.java:50)
at org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:192)
at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
at org.openqa.selenium.grid.security.RequiresSecretFilter.lambda$apply$0(RequiresSecretFilter.java:62)
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:270)
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:44)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:842)
Caused by: java.io.IOException: HTTP/1.1 header parser received no bytes
at java.net.http/jdk.internal.net.http.common.Utils.wrapWithExtraDetail(Utils.java:348)
at java.net.http/jdk.internal.net.http.Http1Response$HeadersReader.onReadError(Http1Response.java:675)
at java.net.http/jdk.internal.net.http.Http1AsyncReceiver.checkForErrors(Http1AsyncReceiver.java:302)
at java.net.http/jdk.internal.net.http.Http1AsyncReceiver.flush(Http1AsyncReceiver.java:268)
at java.net.http/jdk.internal.net.http.common.SequentialScheduler$LockingRestartableTask.run(SequentialScheduler.java:205)
at java.net.http/jdk.internal.net.http.common.SequentialScheduler$CompleteRestartableTask.run(SequentialScheduler.java:149)
at java.net.http/jdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(SequentialScheduler.java:230)
... 3 more
Caused by: java.io.EOFException: EOF reached while reading
at java.net.http/jdk.internal.net.http.Http1AsyncReceiver$Http1TubeSubscriber.onComplete(Http1AsyncReceiver.java:596)
at java.net.http/jdk.internal.net.http.SocketTube$InternalReadPublisher$ReadSubscription.signalCompletion(SocketTube.java:640)
at java.net.http/jdk.internal.net.http.SocketTube$InternalReadPublisher$InternalReadSubscription.read(SocketTube.java:845)
at java.net.http/jdk.internal.net.http.SocketTube$SocketFlowTask.run(SocketTube.java:181)
at java.net.http/jdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(SequentialScheduler.java:230)
at java.net.http/jdk.internal.net.http.common.SequentialScheduler.runOrSchedule(SequentialScheduler.java:303)
at java.net.http/jdk.internal.net.http.common.SequentialScheduler.runOrSchedule(SequentialScheduler.java:256)
at java.net.http/jdk.internal.net.http.SocketTube$InternalReadPublisher$InternalReadSubscription.signalReadable(SocketTube.java:774)
at java.net.http/jdk.internal.net.http.SocketTube$InternalReadPublisher$ReadEvent.signalEvent(SocketTube.java:957)
at java.net.http/jdk.internal.net.http.SocketTube$SocketFlowEvent.handle(SocketTube.java:253)
at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.handleEvent(HttpClientImpl.java:979)
at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.lambda$run$3(HttpClientImpl.java:934)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.run(HttpClientImpl.java:934)

13:53:38.612 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "9fb3378d3b491a4a6a5327f223ea4a50","eventTime": 1715070218596521292,"eventName": "exception","attributes": {"driver.url": "http:\u002f\u002f127.0.0.1:8232","exception.message": "Error while creating session with the service http:\u002f\u002f127.0.0.1:8232. java.io.IOException: HTTP\u002f1.1 header parser received no bytes","exception.stacktrace": "java.io.UncheckedIOException: java.io.IOException: HTTP\u002f1.1 header parser received no bytes\n\tat org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute0(JdkHttpClient.java:439)\n\tat org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42)\n\tat org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:55)\n\tat org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute(JdkHttpClient.java:355)\n\tat org.openqa.selenium.remote.tracing.TracedHttpClient.execute(TracedHttpClient.java:54)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:89)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:61)\n\tat org.openqa.selenium.grid.node.relay.RelaySessionFactory.apply(RelaySessionFactory.java:169)\n\tat org.openqa.selenium.grid.node.relay.RelaySessionFactory.apply(RelaySessionFactory.java:70)\n\tat org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)\n\tat org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)\n\tat org.openqa.selenium.grid.node.NewNodeSession.execute(NewNodeSession.java:50)\n\tat org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:192)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.grid.security.RequiresSecretFilter.lambda$apply$0(RequiresSecretFilter.java:62)\n\tat org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute(SpanWrappedHttpHandler.java:87)\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:360)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.grid.node.Node.execute(Node.java:270)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:360)\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:539)\n\tat java.base\u002fjava.util.concurrent.FutureTask.run(FutureTask.java:264)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\n\tat java.base\u002fjava.lang.Thread.run(Thread.java:842)\nCaused by: java.io.IOException: HTTP\u002f1.1 header parser received no bytes\n\tat java.net.http\u002fjdk.internal.net.http.common.Utils.wrapWithExtraDetail(Utils.java:348)\n\tat java.net.http\u002fjdk.internal.net.http.Http1Response$HeadersReader.onReadError(Http1Response.java:675)\n\tat java.net.http\u002fjdk.internal.net.http.Http1AsyncReceiver.checkForErrors(Http1AsyncReceiver.java:302)\n\tat java.net.http\u002fjdk.internal.net.http.Http1AsyncReceiver.flush(Http1AsyncReceiver.java:268)\n\tat java.net.http\u002fjdk.internal.net.http.common.SequentialScheduler$LockingRestartableTask.run(SequentialScheduler.java:205)\n\tat java.net.http\u002fjdk.internal.net.http.common.SequentialScheduler$CompleteRestartableTask.run(SequentialScheduler.java:149)\n\tat java.net.http\u002fjdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(SequentialScheduler.java:230)\n\t... 3 more\nCaused by: java.io.EOFException: EOF reached while reading\n\tat java.net.http\u002fjdk.internal.net.http.Http1AsyncReceiver$Http1TubeSubscriber.onComplete(Http1AsyncReceiver.java:596)\n\tat java.net.http\u002fjdk.internal.net.http.SocketTube$InternalReadPublisher$ReadSubscription.signalCompletion(SocketTube.java:640)\n\tat java.net.http\u002fjdk.internal.net.http.SocketTube$InternalReadPublisher$InternalReadSubscription.read(SocketTube.java:845)\n\tat java.net.http\u002fjdk.internal.net.http.SocketTube$SocketFlowTask.run(SocketTube.java:181)\n\tat java.net.http\u002fjdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(SequentialScheduler.java:230)\n\tat java.net.http\u002fjdk.internal.net.http.common.SequentialScheduler.runOrSchedule(SequentialScheduler.java:303)\n\tat java.net.http\u002fjdk.internal.net.http.common.SequentialScheduler.runOrSchedule(SequentialScheduler.java:256)\n\tat java.net.http\u002fjdk.internal.net.http.SocketTube$InternalReadPublisher$InternalReadSubscription.signalReadable(SocketTube.java:774)\n\tat java.net.http\u002fjdk.internal.net.http.SocketTube$InternalReadPublisher$ReadEvent.signalEvent(SocketTube.java:957)\n\tat java.net.http\u002fjdk.internal.net.http.SocketTube$SocketFlowEvent.handle(SocketTube.java:253)\n\tat java.net.http\u002fjdk.internal.net.http.HttpClientImpl$SelectorManager.handleEvent(HttpClientImpl.java:979)\n\tat java.net.http\u002fjdk.internal.net.http.HttpClientImpl$SelectorManager.lambda$run$3(HttpClientImpl.java:934)\n\tat java.base\u002fjava.util.ArrayList.forEach(ArrayList.java:1511)\n\tat java.net.http\u002fjdk.internal.net.http.HttpClientImpl$SelectorManager.run(HttpClientImpl.java:934)\n","exception.type": "java.io.UncheckedIOException","logger": "org.openqa.selenium.grid.node.relay.RelaySessionFactory","session.capabilities": "{"appium:app": "\u002fUsers\u002falokkumar\u002fIdeaProjects\u002ffrontend-automation-optimus\u002fsrc\u002ftest\u002fresources\u002fapp\u002fDREAMQA-nowiremock.app","appium:autoAcceptAlerts": true,"appium:automationName": "XCUITest","appium:derivedDataPath": "\u002fUsers\u002falokkumar\u002fWebDriverAgentRunner-Runner.app","appium:newCommandTimeout": 30,"appium:platformVersion": "17.4","appium:udid": "9DA81278-7B6C-4F52-BF04-FB85DB05DFFE","appium:usePrebuiltWDA": true,"appium:wdaLaunchTimeout": 60000,"appium:wdaLocalPort": 8200,"platformName": "IOS"}\n"}}

13:53:38.613 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "9fb3378d3b491a4a6a5327f223ea4a50","eventTime": 1715070218612890584,"eventName": "Unable to create session with the driver","attributes": {"current.session.count": 0,"logger": "org.openqa.selenium.grid.node.local.LocalNode","session.request.capabilities": "Capabilities {appium:app: \u002fUsers\u002falokkumar\u002fIdeaProjec..., appium:autoAcceptAlerts: true, appium:automationName: XCuiTest, appium:derivedDataPath: \u002fUsers\u002falokkumar\u002fWebDriverA..., appium:newCommandTimeout: 30, appium:usePrebuiltWDA: true, appium:wdaLaunchTimeout: 60000, platformName: IOS}","session.request.downstreamdialect": "[W3C]"}}

13:53:38.713 INFO [RelaySessionFactory.apply] - Starting session for Capabilities {appium:app: /Users/alokkumar/IdeaProjec..., appium:autoAcceptAlerts: true, appium:automationName: XCUITest, appium:derivedDataPath: /Users/alokkumar/WebDriverA..., appium:newCommandTimeout: 30, appium:platformVersion: 17.4, appium:udid: 9DA81278-7B6C-4F52-BF04-FB8..., appium:usePrebuiltWDA: true, appium:wdaLaunchTimeout: 60000, appium:wdaLocalPort: 8200, platformName: IOS}
13:53:38.725 WARN [SeleniumSpanExporter$1.lambda$export$1] - Error while creating session with the service http://127.0.0.1:8232. java.net.ConnectException
13:53:38.725 WARN [SeleniumSpanExporter$1.lambda$export$1] - java.io.UncheckedIOException: java.net.ConnectException
at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute0(JdkHttpClient.java:439)
at org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42)
at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:55)
at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute(JdkHttpClient.java:355)
at org.openqa.selenium.remote.tracing.TracedHttpClient.execute(TracedHttpClient.java:54)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:89)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:61)
at org.openqa.selenium.grid.node.relay.RelaySessionFactory.apply(RelaySessionFactory.java:169)
at org.openqa.selenium.grid.node.relay.RelaySessionFactory.apply(RelaySessionFactory.java:70)
at org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)
at org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)
at org.openqa.selenium.grid.node.NewNodeSession.execute(NewNodeSession.java:50)
at org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:192)
at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
at org.openqa.selenium.grid.security.RequiresSecretFilter.lambda$apply$0(RequiresSecretFilter.java:62)
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:270)
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:44)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:842)
Caused by: java.net.ConnectException
at java.net.http/jdk.internal.net.http.common.Utils.toConnectException(Utils.java:1055)
at java.net.http/jdk.internal.net.http.PlainHttpConnection.connectAsync(PlainHttpConnection.java:198)
at java.net.http/jdk.internal.net.http.PlainHttpConnection.checkRetryConnect(PlainHttpConnection.java:230)
at java.net.http/jdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$1(PlainHttpConnection.java:206)
at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:934)
at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:911)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1773)
... 3 more
Caused by: java.nio.channels.ClosedChannelException
at java.base/sun.nio.ch.SocketChannelImpl.ensureOpen(SocketChannelImpl.java:195)
at java.base/sun.nio.ch.SocketChannelImpl.beginConnect(SocketChannelImpl.java:760)
at java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:848)
at java.net.http/jdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$0(PlainHttpConnection.java:183)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
at java.net.http/jdk.internal.net.http.PlainHttpConnection.connectAsync(PlainHttpConnection.java:185)
... 9 more

13:53:38.725 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "84b627a12c7ccf1c297ceea40eb88511","eventTime": 1715070218724915875,"eventName": "exception","attributes": {"driver.url": "http:\u002f\u002f127.0.0.1:8232","exception.message": "Error while creating session with the service http:\u002f\u002f127.0.0.1:8232. java.net.ConnectException","exception.stacktrace": "java.io.UncheckedIOException: java.net.ConnectException\n\tat org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute0(JdkHttpClient.java:439)\n\tat org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42)\n\tat org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:55)\n\tat org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute(JdkHttpClient.java:355)\n\tat org.openqa.selenium.remote.tracing.TracedHttpClient.execute(TracedHttpClient.java:54)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:89)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:61)\n\tat org.openqa.selenium.grid.node.relay.RelaySessionFactory.apply(RelaySessionFactory.java:169)\n\tat org.openqa.selenium.grid.node.relay.RelaySessionFactory.apply(RelaySessionFactory.java:70)\n\tat org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)\n\tat org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)\n\tat org.openqa.selenium.grid.node.NewNodeSession.execute(NewNodeSession.java:50)\n\tat org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:192)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.grid.security.RequiresSecretFilter.lambda$apply$0(RequiresSecretFilter.java:62)\n\tat org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute(SpanWrappedHttpHandler.java:87)\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:360)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.grid.node.Node.execute(Node.java:270)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:360)\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:539)\n\tat java.base\u002fjava.util.concurrent.FutureTask.run(FutureTask.java:264)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\n\tat java.base\u002fjava.lang.Thread.run(Thread.java:842)\nCaused by: java.net.ConnectException\n\tat java.net.http\u002fjdk.internal.net.http.common.Utils.toConnectException(Utils.java:1055)\n\tat java.net.http\u002fjdk.internal.net.http.PlainHttpConnection.connectAsync(PlainHttpConnection.java:198)\n\tat java.net.http\u002fjdk.internal.net.http.PlainHttpConnection.checkRetryConnect(PlainHttpConnection.java:230)\n\tat java.net.http\u002fjdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$1(PlainHttpConnection.java:206)\n\tat java.base\u002fjava.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:934)\n\tat java.base\u002fjava.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:911)\n\tat java.base\u002fjava.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)\n\tat java.base\u002fjava.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1773)\n\t... 3 more\nCaused by: java.nio.channels.ClosedChannelException\n\tat java.base\u002fsun.nio.ch.SocketChannelImpl.ensureOpen(SocketChannelImpl.java:195)\n\tat java.base\u002fsun.nio.ch.SocketChannelImpl.beginConnect(SocketChannelImpl.java:760)\n\tat java.base\u002fsun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:848)\n\tat java.net.http\u002fjdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$0(PlainHttpConnection.java:183)\n\tat java.base\u002fjava.security.AccessController.doPrivileged(AccessController.java:569)\n\tat java.net.http\u002fjdk.internal.net.http.PlainHttpConnection.connectAsync(PlainHttpConnection.java:185)\n\t... 9 more\n","exception.type": "java.io.UncheckedIOException","logger": "org.openqa.selenium.grid.node.relay.RelaySessionFactory","session.capabilities": "{"appium:app": "\u002fUsers\u002falokkumar\u002fIdeaProjects\u002ffrontend-automation-optimus\u002fsrc\u002ftest\u002fresources\u002fapp\u002fDREAMQA-nowiremock.app","appium:autoAcceptAlerts": true,"appium:automationName": "XCUITest","appium:derivedDataPath": "\u002fUsers\u002falokkumar\u002fWebDriverAgentRunner-Runner.app","appium:newCommandTimeout": 30,"appium:platformVersion": "17.4","appium:udid": "9DA81278-7B6C-4F52-BF04-FB85DB05DFFE","appium:usePrebuiltWDA": true,"appium:wdaLaunchTimeout": 60000,"appium:wdaLocalPort": 8200,"platformName": "IOS"}\n"}}

13:53:38.725 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "84b627a12c7ccf1c297ceea40eb88511","eventTime": 1715070218725718500,"eventName": "Unable to create session with the driver","attributes": {"current.session.count": 0,"logger": "org.openqa.selenium.grid.node.local.LocalNode","session.request.capabilities": "Capabilities {appium:app: \u002fUsers\u002falokkumar\u002fIdeaProjec..., appium:autoAcceptAlerts: true, appium:automationName: XCuiTest, appium:derivedDataPath: \u002fUsers\u002falokkumar\u002fWebDriverA..., appium:newCommandTimeout: 30, appium:usePrebuiltWDA: true, appium:wdaLaunchTimeout: 60000, platformName: IOS}","session.request.downstreamdialect": "[W3C]"}}

13:53:38.773 INFO [RelaySessionFactory.apply] - Starting session for Capabilities {appium:app: /Users/alokkumar/IdeaProjec..., appium:autoAcceptAlerts: true, appium:automationName: XCUITest, appium:derivedDataPath: /Users/alokkumar/WebDriverA..., appium:newCommandTimeout: 30, appium:platformVersion: 17.4, appium:udid: 9DA81278-7B6C-4F52-BF04-FB8..., appium:usePrebuiltWDA: true, appium:wdaLaunchTimeout: 60000, appium:wdaLocalPort: 8200, platformName: IOS}
13:53:38.779 WARN [SeleniumSpanExporter$1.lambda$export$1] - Error while creating session with the service http://127.0.0.1:8232. java.net.ConnectException
13:53:38.779 WARN [SeleniumSpanExporter$1.lambda$export$1] - java.io.UncheckedIOException: java.net.ConnectException
at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute0(JdkHttpClient.java:439)
at org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42)
at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:55)
at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute(JdkHttpClient.java:355)
at org.openqa.selenium.remote.tracing.TracedHttpClient.execute(TracedHttpClient.java:54)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:89)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:61)
at org.openqa.selenium.grid.node.relay.RelaySessionFactory.apply(RelaySessionFactory.java:169)
at org.openqa.selenium.grid.node.relay.RelaySessionFactory.apply(RelaySessionFactory.java:70)
at org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)
at org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)
at org.openqa.selenium.grid.node.NewNodeSession.execute(NewNodeSession.java:50)
at org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:192)
at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
at org.openqa.selenium.grid.security.RequiresSecretFilter.lambda$apply$0(RequiresSecretFilter.java:62)
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:270)
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:44)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:842)
Caused by: java.net.ConnectException
at java.net.http/jdk.internal.net.http.common.Utils.toConnectException(Utils.java:1055)
at java.net.http/jdk.internal.net.http.PlainHttpConnection.connectAsync(PlainHttpConnection.java:198)
at java.net.http/jdk.internal.net.http.PlainHttpConnection.checkRetryConnect(PlainHttpConnection.java:230)
at java.net.http/jdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$1(PlainHttpConnection.java:206)
at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:934)
at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:911)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1773)
... 3 more
Caused by: java.nio.channels.ClosedChannelException
at java.base/sun.nio.ch.SocketChannelImpl.ensureOpen(SocketChannelImpl.java:195)
at java.base/sun.nio.ch.SocketChannelImpl.beginConnect(SocketChannelImpl.java:760)
at java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:848)
at java.net.http/jdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$0(PlainHttpConnection.java:183)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
at java.net.http/jdk.internal.net.http.PlainHttpConnection.connectAsync(PlainHttpConnection.java:185)
... 9 more

How can we reproduce the issue?

Using selenium-server-4.21.0-SNAPSHOT.jar is causing when I run the grid and Appium server programmatically, but not when I run them manually?

Relevant log output

13:53:38.611 WARN [SeleniumSpanExporter$1.lambda$export$1] - Error while creating session with the service http://127.0.0.1:8232. java.io.IOException: HTTP/1.1 header parser received no bytes
13:53:38.611 WARN [SeleniumSpanExporter$1.lambda$export$1] - java.io.UncheckedIOException: java.io.IOException: HTTP/1.1 header parser received no bytes
	at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute0(JdkHttpClient.java:439)
	at org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42)
	at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:55)
	at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute(JdkHttpClient.java:355)
	at org.openqa.selenium.remote.tracing.TracedHttpClient.execute(TracedHttpClient.java:54)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:89)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:61)
	at org.openqa.selenium.grid.node.relay.RelaySessionFactory.apply(RelaySessionFactory.java:169)
	at org.openqa.selenium.grid.node.relay.RelaySessionFactory.apply(RelaySessionFactory.java:70)
	at org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)
	at org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)
	at org.openqa.selenium.grid.node.NewNodeSession.execute(NewNodeSession.java:50)
	at org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:192)
	at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
	at org.openqa.selenium.grid.security.RequiresSecretFilter.lambda$apply$0(RequiresSecretFilter.java:62)
	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:270)
	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:44)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:842)
Caused by: java.io.IOException: HTTP/1.1 header parser received no bytes
	at java.net.http/jdk.internal.net.http.common.Utils.wrapWithExtraDetail(Utils.java:348)
	at java.net.http/jdk.internal.net.http.Http1Response$HeadersReader.onReadError(Http1Response.java:675)
	at java.net.http/jdk.internal.net.http.Http1AsyncReceiver.checkForErrors(Http1AsyncReceiver.java:302)
	at java.net.http/jdk.internal.net.http.Http1AsyncReceiver.flush(Http1AsyncReceiver.java:268)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler$LockingRestartableTask.run(SequentialScheduler.java:205)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler$CompleteRestartableTask.run(SequentialScheduler.java:149)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(SequentialScheduler.java:230)
	... 3 more
Caused by: java.io.EOFException: EOF reached while reading
	at java.net.http/jdk.internal.net.http.Http1AsyncReceiver$Http1TubeSubscriber.onComplete(Http1AsyncReceiver.java:596)
	at java.net.http/jdk.internal.net.http.SocketTube$InternalReadPublisher$ReadSubscription.signalCompletion(SocketTube.java:640)
	at java.net.http/jdk.internal.net.http.SocketTube$InternalReadPublisher$InternalReadSubscription.read(SocketTube.java:845)
	at java.net.http/jdk.internal.net.http.SocketTube$SocketFlowTask.run(SocketTube.java:181)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(SequentialScheduler.java:230)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler.runOrSchedule(SequentialScheduler.java:303)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler.runOrSchedule(SequentialScheduler.java:256)
	at java.net.http/jdk.internal.net.http.SocketTube$InternalReadPublisher$InternalReadSubscription.signalReadable(SocketTube.java:774)
	at java.net.http/jdk.internal.net.http.SocketTube$InternalReadPublisher$ReadEvent.signalEvent(SocketTube.java:957)
	at java.net.http/jdk.internal.net.http.SocketTube$SocketFlowEvent.handle(SocketTube.java:253)
	at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.handleEvent(HttpClientImpl.java:979)
	at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.lambda$run$3(HttpClientImpl.java:934)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.run(HttpClientImpl.java:934)

13:53:38.612 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "9fb3378d3b491a4a6a5327f223ea4a50","eventTime": 1715070218596521292,"eventName": "exception","attributes": {"driver.url": "http:\u002f\u002f127.0.0.1:8232","exception.message": "Error while creating session with the service http:\u002f\u002f127.0.0.1:8232. java.io.IOException: HTTP\u002f1.1 header parser received no bytes","exception.stacktrace": "java.io.UncheckedIOException: java.io.IOException: HTTP\u002f1.1 header parser received no bytes\n\tat org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute0(JdkHttpClient.java:439)\n\tat org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42)\n\tat org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:55)\n\tat org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute(JdkHttpClient.java:355)\n\tat org.openqa.selenium.remote.tracing.TracedHttpClient.execute(TracedHttpClient.java:54)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:89)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:61)\n\tat org.openqa.selenium.grid.node.relay.RelaySessionFactory.apply(RelaySessionFactory.java:169)\n\tat org.openqa.selenium.grid.node.relay.RelaySessionFactory.apply(RelaySessionFactory.java:70)\n\tat org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)\n\tat org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)\n\tat org.openqa.selenium.grid.node.NewNodeSession.execute(NewNodeSession.java:50)\n\tat org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:192)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.grid.security.RequiresSecretFilter.lambda$apply$0(RequiresSecretFilter.java:62)\n\tat org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute(SpanWrappedHttpHandler.java:87)\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:360)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.grid.node.Node.execute(Node.java:270)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:360)\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:539)\n\tat java.base\u002fjava.util.concurrent.FutureTask.run(FutureTask.java:264)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\n\tat java.base\u002fjava.lang.Thread.run(Thread.java:842)\nCaused by: java.io.IOException: HTTP\u002f1.1 header parser received no bytes\n\tat java.net.http\u002fjdk.internal.net.http.common.Utils.wrapWithExtraDetail(Utils.java:348)\n\tat java.net.http\u002fjdk.internal.net.http.Http1Response$HeadersReader.onReadError(Http1Response.java:675)\n\tat java.net.http\u002fjdk.internal.net.http.Http1AsyncReceiver.checkForErrors(Http1AsyncReceiver.java:302)\n\tat java.net.http\u002fjdk.internal.net.http.Http1AsyncReceiver.flush(Http1AsyncReceiver.java:268)\n\tat java.net.http\u002fjdk.internal.net.http.common.SequentialScheduler$LockingRestartableTask.run(SequentialScheduler.java:205)\n\tat java.net.http\u002fjdk.internal.net.http.common.SequentialScheduler$CompleteRestartableTask.run(SequentialScheduler.java:149)\n\tat java.net.http\u002fjdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(SequentialScheduler.java:230)\n\t... 3 more\nCaused by: java.io.EOFException: EOF reached while reading\n\tat java.net.http\u002fjdk.internal.net.http.Http1AsyncReceiver$Http1TubeSubscriber.onComplete(Http1AsyncReceiver.java:596)\n\tat java.net.http\u002fjdk.internal.net.http.SocketTube$InternalReadPublisher$ReadSubscription.signalCompletion(SocketTube.java:640)\n\tat java.net.http\u002fjdk.internal.net.http.SocketTube$InternalReadPublisher$InternalReadSubscription.read(SocketTube.java:845)\n\tat java.net.http\u002fjdk.internal.net.http.SocketTube$SocketFlowTask.run(SocketTube.java:181)\n\tat java.net.http\u002fjdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(SequentialScheduler.java:230)\n\tat java.net.http\u002fjdk.internal.net.http.common.SequentialScheduler.runOrSchedule(SequentialScheduler.java:303)\n\tat java.net.http\u002fjdk.internal.net.http.common.SequentialScheduler.runOrSchedule(SequentialScheduler.java:256)\n\tat java.net.http\u002fjdk.internal.net.http.SocketTube$InternalReadPublisher$InternalReadSubscription.signalReadable(SocketTube.java:774)\n\tat java.net.http\u002fjdk.internal.net.http.SocketTube$InternalReadPublisher$ReadEvent.signalEvent(SocketTube.java:957)\n\tat java.net.http\u002fjdk.internal.net.http.SocketTube$SocketFlowEvent.handle(SocketTube.java:253)\n\tat java.net.http\u002fjdk.internal.net.http.HttpClientImpl$SelectorManager.handleEvent(HttpClientImpl.java:979)\n\tat java.net.http\u002fjdk.internal.net.http.HttpClientImpl$SelectorManager.lambda$run$3(HttpClientImpl.java:934)\n\tat java.base\u002fjava.util.ArrayList.forEach(ArrayList.java:1511)\n\tat java.net.http\u002fjdk.internal.net.http.HttpClientImpl$SelectorManager.run(HttpClientImpl.java:934)\n","exception.type": "java.io.UncheckedIOException","logger": "org.openqa.selenium.grid.node.relay.RelaySessionFactory","session.capabilities": "{\"appium:app\": \"\\u002fUsers\\u002falokkumar\\u002fIdeaProjects\\u002ffrontend-automation-optimus\\u002fsrc\\u002ftest\\u002fresources\\u002fapp\\u002fDREAMQA-nowiremock.app\",\"appium:autoAcceptAlerts\": true,\"appium:automationName\": \"XCUITest\",\"appium:derivedDataPath\": \"\\u002fUsers\\u002falokkumar\\u002fWebDriverAgentRunner-Runner.app\",\"appium:newCommandTimeout\": 30,\"appium:platformVersion\": \"17.4\",\"appium:udid\": \"9DA81278-7B6C-4F52-BF04-FB85DB05DFFE\",\"appium:usePrebuiltWDA\": true,\"appium:wdaLaunchTimeout\": 60000,\"appium:wdaLocalPort\": 8200,\"platformName\": \"IOS\"}\n"}}

13:53:38.613 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "9fb3378d3b491a4a6a5327f223ea4a50","eventTime": 1715070218612890584,"eventName": "Unable to create session with the driver","attributes": {"current.session.count": 0,"logger": "org.openqa.selenium.grid.node.local.LocalNode","session.request.capabilities": "Capabilities {appium:app: \u002fUsers\u002falokkumar\u002fIdeaProjec..., appium:autoAcceptAlerts: true, appium:automationName: XCuiTest, appium:derivedDataPath: \u002fUsers\u002falokkumar\u002fWebDriverA..., appium:newCommandTimeout: 30, appium:usePrebuiltWDA: true, appium:wdaLaunchTimeout: 60000, platformName: IOS}","session.request.downstreamdialect": "[W3C]"}}

13:53:38.713 INFO [RelaySessionFactory.apply] - Starting session for Capabilities {appium:app: /Users/alokkumar/IdeaProjec..., appium:autoAcceptAlerts: true, appium:automationName: XCUITest, appium:derivedDataPath: /Users/alokkumar/WebDriverA..., appium:newCommandTimeout: 30, appium:platformVersion: 17.4, appium:udid: 9DA81278-7B6C-4F52-BF04-FB8..., appium:usePrebuiltWDA: true, appium:wdaLaunchTimeout: 60000, appium:wdaLocalPort: 8200, platformName: IOS}
13:53:38.725 WARN [SeleniumSpanExporter$1.lambda$export$1] - Error while creating session with the service http://127.0.0.1:8232. java.net.ConnectException
13:53:38.725 WARN [SeleniumSpanExporter$1.lambda$export$1] - java.io.UncheckedIOException: java.net.ConnectException
	at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute0(JdkHttpClient.java:439)
	at org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42)
	at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:55)
	at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute(JdkHttpClient.java:355)
	at org.openqa.selenium.remote.tracing.TracedHttpClient.execute(TracedHttpClient.java:54)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:89)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:61)
	at org.openqa.selenium.grid.node.relay.RelaySessionFactory.apply(RelaySessionFactory.java:169)
	at org.openqa.selenium.grid.node.relay.RelaySessionFactory.apply(RelaySessionFactory.java:70)
	at org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)
	at org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)
	at org.openqa.selenium.grid.node.NewNodeSession.execute(NewNodeSession.java:50)
	at org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:192)
	at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
	at org.openqa.selenium.grid.security.RequiresSecretFilter.lambda$apply$0(RequiresSecretFilter.java:62)
	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:270)
	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:44)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:842)
Caused by: java.net.ConnectException
	at java.net.http/jdk.internal.net.http.common.Utils.toConnectException(Utils.java:1055)
	at java.net.http/jdk.internal.net.http.PlainHttpConnection.connectAsync(PlainHttpConnection.java:198)
	at java.net.http/jdk.internal.net.http.PlainHttpConnection.checkRetryConnect(PlainHttpConnection.java:230)
	at java.net.http/jdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$1(PlainHttpConnection.java:206)
	at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:934)
	at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:911)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1773)
	... 3 more
Caused by: java.nio.channels.ClosedChannelException
	at java.base/sun.nio.ch.SocketChannelImpl.ensureOpen(SocketChannelImpl.java:195)
	at java.base/sun.nio.ch.SocketChannelImpl.beginConnect(SocketChannelImpl.java:760)
	at java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:848)
	at java.net.http/jdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$0(PlainHttpConnection.java:183)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
	at java.net.http/jdk.internal.net.http.PlainHttpConnection.connectAsync(PlainHttpConnection.java:185)
	... 9 more

13:53:38.725 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "84b627a12c7ccf1c297ceea40eb88511","eventTime": 1715070218724915875,"eventName": "exception","attributes": {"driver.url": "http:\u002f\u002f127.0.0.1:8232","exception.message": "Error while creating session with the service http:\u002f\u002f127.0.0.1:8232. java.net.ConnectException","exception.stacktrace": "java.io.UncheckedIOException: java.net.ConnectException\n\tat org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute0(JdkHttpClient.java:439)\n\tat org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42)\n\tat org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:55)\n\tat org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute(JdkHttpClient.java:355)\n\tat org.openqa.selenium.remote.tracing.TracedHttpClient.execute(TracedHttpClient.java:54)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:89)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:61)\n\tat org.openqa.selenium.grid.node.relay.RelaySessionFactory.apply(RelaySessionFactory.java:169)\n\tat org.openqa.selenium.grid.node.relay.RelaySessionFactory.apply(RelaySessionFactory.java:70)\n\tat org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)\n\tat org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)\n\tat org.openqa.selenium.grid.node.NewNodeSession.execute(NewNodeSession.java:50)\n\tat org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:192)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.grid.security.RequiresSecretFilter.lambda$apply$0(RequiresSecretFilter.java:62)\n\tat org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute(SpanWrappedHttpHandler.java:87)\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:360)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.grid.node.Node.execute(Node.java:270)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:360)\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:539)\n\tat java.base\u002fjava.util.concurrent.FutureTask.run(FutureTask.java:264)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\n\tat java.base\u002fjava.lang.Thread.run(Thread.java:842)\nCaused by: java.net.ConnectException\n\tat java.net.http\u002fjdk.internal.net.http.common.Utils.toConnectException(Utils.java:1055)\n\tat java.net.http\u002fjdk.internal.net.http.PlainHttpConnection.connectAsync(PlainHttpConnection.java:198)\n\tat java.net.http\u002fjdk.internal.net.http.PlainHttpConnection.checkRetryConnect(PlainHttpConnection.java:230)\n\tat java.net.http\u002fjdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$1(PlainHttpConnection.java:206)\n\tat java.base\u002fjava.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:934)\n\tat java.base\u002fjava.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:911)\n\tat java.base\u002fjava.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)\n\tat java.base\u002fjava.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1773)\n\t... 3 more\nCaused by: java.nio.channels.ClosedChannelException\n\tat java.base\u002fsun.nio.ch.SocketChannelImpl.ensureOpen(SocketChannelImpl.java:195)\n\tat java.base\u002fsun.nio.ch.SocketChannelImpl.beginConnect(SocketChannelImpl.java:760)\n\tat java.base\u002fsun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:848)\n\tat java.net.http\u002fjdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$0(PlainHttpConnection.java:183)\n\tat java.base\u002fjava.security.AccessController.doPrivileged(AccessController.java:569)\n\tat java.net.http\u002fjdk.internal.net.http.PlainHttpConnection.connectAsync(PlainHttpConnection.java:185)\n\t... 9 more\n","exception.type": "java.io.UncheckedIOException","logger": "org.openqa.selenium.grid.node.relay.RelaySessionFactory","session.capabilities": "{\"appium:app\": \"\\u002fUsers\\u002falokkumar\\u002fIdeaProjects\\u002ffrontend-automation-optimus\\u002fsrc\\u002ftest\\u002fresources\\u002fapp\\u002fDREAMQA-nowiremock.app\",\"appium:autoAcceptAlerts\": true,\"appium:automationName\": \"XCUITest\",\"appium:derivedDataPath\": \"\\u002fUsers\\u002falokkumar\\u002fWebDriverAgentRunner-Runner.app\",\"appium:newCommandTimeout\": 30,\"appium:platformVersion\": \"17.4\",\"appium:udid\": \"9DA81278-7B6C-4F52-BF04-FB85DB05DFFE\",\"appium:usePrebuiltWDA\": true,\"appium:wdaLaunchTimeout\": 60000,\"appium:wdaLocalPort\": 8200,\"platformName\": \"IOS\"}\n"}}

13:53:38.725 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "84b627a12c7ccf1c297ceea40eb88511","eventTime": 1715070218725718500,"eventName": "Unable to create session with the driver","attributes": {"current.session.count": 0,"logger": "org.openqa.selenium.grid.node.local.LocalNode","session.request.capabilities": "Capabilities {appium:app: \u002fUsers\u002falokkumar\u002fIdeaProjec..., appium:autoAcceptAlerts: true, appium:automationName: XCuiTest, appium:derivedDataPath: \u002fUsers\u002falokkumar\u002fWebDriverA..., appium:newCommandTimeout: 30, appium:usePrebuiltWDA: true, appium:wdaLaunchTimeout: 60000, platformName: IOS}","session.request.downstreamdialect": "[W3C]"}}

13:53:38.773 INFO [RelaySessionFactory.apply] - Starting session for Capabilities {appium:app: /Users/alokkumar/IdeaProjec..., appium:autoAcceptAlerts: true, appium:automationName: XCUITest, appium:derivedDataPath: /Users/alokkumar/WebDriverA..., appium:newCommandTimeout: 30, appium:platformVersion: 17.4, appium:udid: 9DA81278-7B6C-4F52-BF04-FB8..., appium:usePrebuiltWDA: true, appium:wdaLaunchTimeout: 60000, appium:wdaLocalPort: 8200, platformName: IOS}
13:53:38.779 WARN [SeleniumSpanExporter$1.lambda$export$1] - Error while creating session with the service http://127.0.0.1:8232. java.net.ConnectException
13:53:38.779 WARN [SeleniumSpanExporter$1.lambda$export$1] - java.io.UncheckedIOException: java.net.ConnectException
	at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute0(JdkHttpClient.java:439)
	at org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42)
	at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:55)
	at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute(JdkHttpClient.java:355)
	at org.openqa.selenium.remote.tracing.TracedHttpClient.execute(TracedHttpClient.java:54)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:89)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:61)
	at org.openqa.selenium.grid.node.relay.RelaySessionFactory.apply(RelaySessionFactory.java:169)
	at org.openqa.selenium.grid.node.relay.RelaySessionFactory.apply(RelaySessionFactory.java:70)
	at org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)
	at org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)
	at org.openqa.selenium.grid.node.NewNodeSession.execute(NewNodeSession.java:50)
	at org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:192)
	at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
	at org.openqa.selenium.grid.security.RequiresSecretFilter.lambda$apply$0(RequiresSecretFilter.java:62)
	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:270)
	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:44)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:842)
Caused by: java.net.ConnectException
	at java.net.http/jdk.internal.net.http.common.Utils.toConnectException(Utils.java:1055)
	at java.net.http/jdk.internal.net.http.PlainHttpConnection.connectAsync(PlainHttpConnection.java:198)
	at java.net.http/jdk.internal.net.http.PlainHttpConnection.checkRetryConnect(PlainHttpConnection.java:230)
	at java.net.http/jdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$1(PlainHttpConnection.java:206)
	at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:934)
	at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:911)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1773)
	... 3 more
Caused by: java.nio.channels.ClosedChannelException
	at java.base/sun.nio.ch.SocketChannelImpl.ensureOpen(SocketChannelImpl.java:195)
	at java.base/sun.nio.ch.SocketChannelImpl.beginConnect(SocketChannelImpl.java:760)
	at java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:848)
	at java.net.http/jdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$0(PlainHttpConnection.java:183)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
	at java.net.http/jdk.internal.net.http.PlainHttpConnection.connectAsync(PlainHttpConnection.java:185)
	... 9 more

Operating System

macOS

Selenium version

4.18.1

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

7.15.1

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

xcuitest

Are you using Selenium Grid?

4.21.0-SNAPSHOT

Copy link

github-actions bot commented May 7, 2024

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

@diemol
Copy link
Member

diemol commented May 7, 2024

What is programmatically and what is manually? Can you actually share the details and just not dump a stacktrace?

@alokkr016
Copy link
Author

I have set up three iOS nodes and I'm running five test cases. To automate this process, I've created a shell script containing grid and node commands, which I'm executing programmatically using Java. Additionally, I've launched three iOS devices. While the test cases are running successfully on two of the devices, one device is experiencing issues. Interestingly, when I manually run the grid command and Appium server command in the terminal, the tests are distributed perfectly across all three devices."

@diemol
Copy link
Member

diemol commented May 7, 2024

If I understand correctly, launching every process on the terminal works, but it fails when you use the script you created. Why would that be related to Selenium Grid?

@alokkr016
Copy link
Author

alokkr016 commented May 7, 2024

Because with the help of my script I am able to launch the simulator, launch the grid, and register the node. However, when I am creating the driver for the device 1, I am facing an exception.

@diemol
Copy link
Member

diemol commented May 7, 2024

Why don't you share the script? We could help with something, perhaps.

@diemol
Copy link
Member

diemol commented May 7, 2024

Here is my sample script file
Could you please check and provide me with valuable suggestions

I am sorry, but I do not even understand several pieces of the script. I cannot give suggestions because there is a lot of context I do not have. My recommendation is to start small and after you get everything running manually and successfully, break the manual steps one by one into scrips so you can track when it starts to fail.

As it stands, I do not understand why this is a Selenium Grid issue, given that the error happens only when your script is used.

@mykola-mokhnach
Copy link

mykola-mokhnach commented May 7, 2024

@diemol

Just wanted to add my 5 cents to this issue.

the exceptions happens at

ProtocolHandshake.Result result = new ProtocolHandshake().createSession(client, command);
according to the above stack trace. There we see that the code tries to create a new session using the java http client created using the default configuration. We have already confirmed this does not work with the Appium server as it only accepts HTTP/1.1, while the default setting for the java HTTP client is HTTP/2, unless changed in the ClientConfig.

Could you please confirm this client actually picks up the protocol-version value from the node config in the hub version being used by the issue creator?

@joerg1985
Copy link
Member

@alokkr016 i had a short look at the script and i am wondering why you do not pass the hub url to the node?

I would suggest to redirect the output of the node to a file and check whether it does start or the startup fails.

@diemol
Copy link
Member

diemol commented May 7, 2024

@mykola-mokhnach yes, a few lines above.

@alokkr016
Copy link
Author

@joerg1985 Even though I am specifying the hub URL as --hub http://<hub-ip>:4444, the test cases are still failing on the first device. Additionally, I am encountering the same exception:

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 service http://127.0.0.1:8232. java.io.IOException: HTTP/1.1 header parser received no bytes.

@joerg1985
Copy link
Member

@alokkr016 how about the logs of the node?

@alokkr016
Copy link
Author

alokkr016 commented May 8, 2024

@joerg1985
file.txt

@joerg1985
Copy link
Member

From the logs:
Appium REST http interface listener started on http://0.0.0.0:4724
Appium REST http interface listener started on http://0.0.0.0:4725

From the error message:
23:44:47.799 WARN [SeleniumSpanExporter$1.lambda$export$1] - Error while creating session with the service http://127.0.0.1:4723. java.io.IOException: HTTP/1.1 header parser received no bytes

So i would suggest to check the generated config / toml files, there should be a missmatch in the ports.

@alokkr016
Copy link
Author

alokkr016 commented May 14, 2024

Everything is okay. Each configuration has a different port number, UDID, and version. There are no issues with the configurations, still it's not working

@diemol
Copy link
Member

diemol commented May 14, 2024

Thank you for the feedback, I am closing this issue.

@diemol diemol closed this as not planned Won't fix, can't repro, duplicate, stale May 14, 2024
@krishtoautomate
Copy link

what is the fix here?

@titusfortner
Copy link
Member

I think this was closed by mistake; the OP said it is still not working for them, and there's now a Sauce Labs user getting the same error.

Also, the lack of http 2 support in Appium seems like a pretty big deal. @jlipps have you considered updating to a better maintained http server if the one you're using can't support it?

@titusfortner titusfortner reopened this May 21, 2024
@littlegeek01
Copy link

littlegeek01 commented May 22, 2024

Hello I am an engineer at Disney and I am getting the same error. Please forgive me if I am being naive, it is my first time looking this closely at the Selenium code.

My setup is pretty simple:
Appium Java client -> selenium hub -> selenium node relay -> appium 2.5.4

I believe @titusfortner is correct. There was a previous bug submitted by @mykola-mokhnach (#12918) that talked about needing a solution for forcing HTTP/1.1. A workaround was put in place which allows someone to specifically force HTTP/1.1 on the JdkHttpClient. This was then implemented in the Appium Java client so now when a message is sent from that client, there is no Connection: Upgrade, HTTP2-Settings sent with the call. The problem I am having is that when the HUB receives that message, it's JdkHttpClient doesn't seem to be configured to do the same thing, so it passes the Connection: Upgrade, HTTP2-Settings along to the selenium node relay which then propagates that to the Appium server which cannot handle HTTP/2 connections at this time. Calls made directly from the selenium node relay to Appium (which do not originate from the HUB) do not include Connection: Upgrade, HTTP2-Settings, I'm assuming because the node allows you configure the protocol-version.

If the HUB configuration were to allow us to specify the version the same way we can in the Java Webdriver client or the node configuration, then we may be able to force HTTP/1.1 all the way through the stack.

I ran tcpdump on my selenium hub and selenium node relay instances and can provide those logs if necessary.

@mykola-mokhnach
Copy link

mykola-mokhnach commented May 22, 2024

Also, the lack of http 2 support in Appium seems like a pretty big deal. @jlipps have you considered updating to a better maintained http server if the one you're using can't support it?

This would be a major change in the server architecture, which also might lead to major changes in official and third party components, which we want to avoid. Currently Appium uses Express.js 4 as its HTTP framework. Unfortunately it is currently in maintenance mode and its successor (Express.js 5) is still in the early beta stage: expressjs/express#4920

So, the question here is whether we'd like to keep it stable or to make it modern, but with the risk of losing stability.

I've also mentioned it once that there is a possibility to add HTTP/2 support to the current Express.js 4 - based implementation by enabling server-side HTTPS. See https://github.com/appium/appium/blob/master/packages/appium/docs/en/guides/tls.md

@joerg1985
Copy link
Member

@littlegeek01 did you try to set the protocol-version inside the relay config (available since v4.20.0)?

@mykola-mokhnach why not dropping the http/2 headers in the appium server like the selenium server does? see

private static final ImmutableSet<String> IGNORED_REQ_HEADERS =
ImmutableSet.<String>builder()
.add("connection")
.add("http2-settings")
.add("keep-alive")
.add("proxy-authorization")
.add("proxy-authenticate")
.add("proxy-connection")
.add("te")
.add("trailer")
.add("transfer-encoding")
.add("upgrade")
.build();

Should the relay config default to http1.1 as appium is (in my mind) the main usecase for this and selenium itself does not use nor benefit from http/2? Some drivers do not even fully implement http1.1 (e.g. chunked requests), i don't think they will start to implement http/2.

@littlegeek01
Copy link

Hello @joerg1985: I did set the protocol-verson on the relay config; however, that doesn't seem to be where the problem lies. All traffic originating from the relay correctly forces HTTP/1.1 (the /status call that is made to Appium), it's only the traffic that is coming from the HUB that is the problem. I don't see any way to force the protocol version on the HUB, which is reflected in the configuration matrix provided here: https://www.selenium.dev/documentation/grid/configuration/cli_options/

@alokkr016
Copy link
Author

@joerg1985, I encountered a similar issue despite enforcing HTTP/1.1 in the protocol version. While all test cases are executing flawlessly on Android, I am experiencing this problem with iOS.

@joerg1985
Copy link
Member

@littlegeek01 there should be no direct traffic from the HUB to Appium, everything should passed through the relay.
As long as the direct connect feature is not used, are you using this feature?
https://github.com/appium/java-client/blob/a67dd969a6252806a14d9adaf09d78f2147fba8d/src/main/java/io/appium/java_client/AppiumClientConfig.java#L177-L185

@alokkr016 are you using direct connect? see link above

@alokkr016
Copy link
Author

No @joerg1985 I am not using direct connect

@littlegeek01
Copy link

@joerg1985 In my setup there is no traffic going directly from the HUB to Appium. All traffic goes through the node relay. The distinction in traffic is where it originates. If traffic comes from my client, through the hub, through the node relay, then it fails. If traffic comes from the node relay to Appium, then things are fine.

For example:
The node relay makes a periodic call to the /status endpoint on Appium. Since this traffic originates from the node relay, there is no problem. When I make a call from my java client to start a session, the traffic originates from my application server, goes to selenium hub, then goes to selenium node relay, then to Appium. This call fails because somewhere along the way (I believe in the hub) the protocol no longer gets forced to HTTP/1.1. When I was doing my TCP tracing, it was the hub that started adding on the Connection: Upgrade, HTTP2-Settings header.

@alokkr016
Copy link
Author

alokkr016 commented May 22, 2024

One more thing I want to mention:

I get org.asynchttpclient.exception.RemotelyClosedException: Remotely closed when I use the selenium-grid-server version that did not have the protocol-version enforced in the node configuration. I tried(4.13.0, 4.10.0)

23:47:23.507 WARN [SeleniumSpanExporter$1.lambda$export$1] - Error while creating session with the service http://127.0.0.1:4723. org.asynchttpclient.exception.RemotelyClosedException: Remotely closed
23:47:23.507 WARN [SeleniumSpanExporter$1.lambda$export$1] - java.io.UncheckedIOException: org.asynchttpclient.exception.RemotelyClosedException: Remotely closed
	at org.openqa.selenium.remote.http.netty.NettyHttpHandler.makeCall(NettyHttpHandler.java:73)
	at org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42)
	at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:55)
	at org.openqa.selenium.remote.http.netty.NettyHttpHandler.execute(NettyHttpHandler.java:48)
	at org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42)
	at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:55)
	at org.openqa.selenium.remote.http.netty.NettyClient.execute(NettyClient.java:97)
	at org.openqa.selenium.remote.tracing.TracedHttpClient.execute(TracedHttpClient.java:54)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:115)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:96)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:68)
	at org.openqa.selenium.grid.node.relay.RelaySessionFactory.apply(RelaySessionFactory.java:164)
	at org.openqa.selenium.grid.node.relay.RelaySessionFactory.apply(RelaySessionFactory.java:72)
	at org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)
	at org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:467)
	at org.openqa.selenium.grid.node.NewNodeSession.execute(NewNodeSession.java:50)
	at org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:193)
	at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
	at org.openqa.selenium.grid.security.RequiresSecretFilter.lambda$apply$0(RequiresSecretFilter.java:62)
	at org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute(SpanWrappedHttpHandler.java:91)
	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.grid.node.Node.execute(Node.java:262)
	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:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:842)
Caused by: org.asynchttpclient.exception.RemotelyClosedException: Remotely closed
	at org.asynchttpclient.exception.RemotelyClosedException.INSTANCE(Unknown Source)

@joerg1985
Copy link
Member

@littlegeek01 The /status endpoint is handled by the appium server and not passed to the mobile device. So the connection from Appium to the mobile device might fail.

@littlegeek01
Copy link

littlegeek01 commented May 22, 2024

@joerg1985 I think the relevant info is the headers that are sent. We already know that Appium cannot handle the 'Connection: Upgrade, HTTP2-Settings' header. When the /status endpoint is called from the node relay, the GET request does not include that header. When the node relay proxies commands from the hub it does include that header. I don't think that the device is involved at all in this scenario.

@joerg1985
Copy link
Member

@littlegeek01 the ReverseProxyHandler used by the relay to handle these requests (from the hub to the relay) will remove these headers so they should not be proxied to the appium server. The client used to send it to the appium server should pick up the protocol version from the relay config and not add them again.
Do you have tcpdumps from the relay to appium server?

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

No branches or pull requests

7 participants