[🐛 Bug]: java.io.UncheckedIOException: java.io.IOException: HTTP/1.1 header parser received no bytes
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
@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!
What is programmatically and what is manually? Can you actually share the details and just not dump a stacktrace?
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."
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?
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.
Why don't you share the script? We could help with something, perhaps.
#!/usr/bin/env bash
appium_path=$(which appium)
echo "Appium path set to : $appium_path"
#appium_path1=$(whereis appium | cut -f2 -d ":" )
platformName=$1
echo "Platform for execution is : $platformName"
HUB_IP="127.0.0.1"
CLIENT_IP="127.0.0.1"
CLIENT_PORT=9000
FILE_PATH=$PWD/selenium-grid
echo $FILE_PATH
GRID_CONFIG_PATH=temp
function registerGrid4AndroidNodes() {
adb kill-server && adb start-server
sleep 2
echo $FILE_PATH
mkdir -p $FILE_PATH/$GRID_CONFIG_PATH
BASE_PORT=8001
BOOTSTRAP_BASE_PORT=9005
SYSTEM_BASE_PORT=8205
DEVICE_LIST="$(adb devices)"
DEVICE_COUNT="$(adb devices | grep -wc "device")"
deviceArray=()
echo $DEVICE_LIST
function registerGrid4iOSNodes() {
mkdir -p $FILE_PATH/$GRID_CONFIG_PATH
BASE_PORT=8231
SYSTEM_BASE_PORT=8100
DEVICE_LIST=($(xcrun simctl list devices | grep "(Booted)" | grep -E -o -i "([0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12})"))
DEVICE_COUNT=($(xcrun simctl list devices | grep "(Booted)" | grep -E -o -i "([0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12})" | grep -i -c "-"))
declare -a DEVICE_NAME_LIST
# Extract booted iPhone device names
while IFS= read -r line; do
DEVICE_NAME_LIST+=("$line")
done < <(xcrun simctl list devices | grep "Booted" | grep -E -o -i "iPhone [^\(]*")
SIM_COUNT=$(expr $DEVICE_COUNT - 1)
OS=iOS
j=1
index=1
echo "My device count $DEVICE_COUNT"
>$FILE_PATH/node_ios.log
if [ $DEVICE_COUNT -gt 0 ]; then
for ((i = 0; i < $DEVICE_COUNT; i++)); do
port=$(($BASE_PORT + $index))
wda_port=$(($SYSTEM_BASE_PORT + $(expr $index \* 100)))
CLIENT_PORT=$(($CLIENT_PORT + $index))
DEVICE_MODEL=($(xcrun simctl list devices | grep "(${DEVICE_LIST[$i]})"))
udid=${DEVICE_LIST[$i]}
echo "index $i"
untrimmedDeviceName="${DEVICE_NAME_LIST[i]}"
deviceName="${untrimmedDeviceName%"${untrimmedDeviceName##*[![:space:]]}"}"
echo "Device Name $deviceName"
declare -a DEVICE_OS=()
until [ "$OS" == "${DEVICE_OS[1]}" ]; do
DEVICE_OS=($(xcrun simctl list devices | grep -E -B$j "(${DEVICE_LIST[$i]})" | grep "iOS"))
((j += 1))
done
deviceVersion=${DEVICE_OS[2]}
# Create appium registration config dynamically
appium_node_config="server:
port: $port
use-drivers:
- xcuitest
default-capabilities:
appium:wdaLaunchTimeout: 60000
appium:wdaLocalPort: $wda_port
appium:newCommandTimeout: 30000"
# Write appium server config for each node to yml file
appium_node_config_file_name=$udid.yml
echo "$appium_node_config" > $FILE_PATH/$GRID_CONFIG_PATH/$appium_node_config_file_name
sleep 4
${appium_path} --config $FILE_PATH/$GRID_CONFIG_PATH/$appium_node_config_file_name &
sleep 6
# Create node registration config dynamically
register_node_config="[server]
port = $CLIENT_PORT
[node]
detect-drivers = false
session-timeout=9000
[relay]
url = \"http://$CLIENT_IP:$port\"
status-endpoint = \"/status\"
protocol-version = \"HTTP/1.1\"
configs = [
'1', '{\"platformName\": \"iOS\", \"appium:platformVersion\": \"$deviceVersion\", \"appium:udid\": \"$udid\", \"appium:automationName\": \"XCUITest\",\"appium:wdaLocalPort\": $wda_port}'
]"
# Write node registration config to toml file
register_node_file_name=$udid.toml
echo "$register_node_config" > $FILE_PATH/$GRID_CONFIG_PATH/$register_node_file_name
sleep 6
echo "Device"$index
echo "WDA Port : "${wda_port}
echo "Client Port : " ${port}
exec 3>&1 1>>$FILE_PATH/node_ios.log 2>&1
# java -jar $FILE_PATH/selenium-server-4.13.0.jar node --config $FILE_PATH/$GRID_CONFIG_PATH/$register_node_file_name &
java -jar $FILE_PATH/selenium-server-4.21.0-SNAPSHOT-2.jar node --config $FILE_PATH/$GRID_CONFIG_PATH/$register_node_file_name &
sleep 7
((index += 1))
((SIM_COUNT -= 1))
done
else
echo "No devices are connected"
fi
sleep 3
}
case "$platformName" in
#case 1
"android")
registerGrid4AndroidNodes ;;
#case 2
"ios")
registerGrid4iOSNodes ;;
esac
public class Main {
public ThreadLocal<AppiumDriver> driver = new ThreadLocal<>();
private final static String hubURL = URLFactory.gridHubURL();
private static AtomicInteger wdaPort = new AtomicInteger(URLFactory.wdaPortOffset());
private static AtomicInteger systemPort = new AtomicInteger(URLFactory.systemPortOffset());
public static String platformName;
public static Properties userProps;
private String iOSBuild;
private String appPath = PathEnvironmentFactory.appPath;
private static Properties driverProps;
public void setDriver(AppiumDriver driver) {
this.driver.set(driver);
}
public AppiumDriver getDriver() {
return this.driver.get();
}
protected AppiumDriver getIOSDriver() throws IOException {
AppiumDriver iosDriver = null;
XCUITestOptions xcuiTestOptions = new XCUITestOptions();
DesiredCapabilities iosCapabilities = new DesiredCapabilities();
platformName = Platform.IOS.name().toLowerCase();
if(StringUtils.equalsAny(platformName, "ios", "cross"))
iOSBuild = appPath + System.getProperty("apkName", driverProps.get("iOSBuild") + ".app");
else if (StringUtils.equalsAny(platformName, "real_devices", "ios_real_devices")) {
iOSBuild = appPath + System.getProperty("apkName", driverProps.get("iOSBuild") + ".ipa");
}
xcuiTestOptions.setPlatformName(Platform.IOS.name());
xcuiTestOptions.setApp(System.getProperty("user.dir") + "/src/test/resources/app/ALOKQA-nowiremock.app");
xcuiTestOptions.autoAcceptAlerts();
xcuiTestOptions.setAutomationName(AutomationName.IOS_XCUI_TEST);
xcuiTestOptions.setWdaLaunchTimeout(Duration.ofSeconds(60));
xcuiTestOptions.setNewCommandTimeout(Duration.ofSeconds(30));
try {
setDriver(new IOSDriver(new URL(hubURL), xcuiTestOptions));
iosDriver = getDriver();
iosDriver.manage().timeouts().implicitlyWait(Duration.ofSeconds(20));
} catch (Exception e) {
e.printStackTrace();
LoggerUtils.ReportLog(LoggerUtils.LogsType.ERROR, "Session not created, Error occurred.");
}
return iosDriver;
}
}
Here is my sample script file Could you please check and provide me with valuable suggestions
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.
@diemol
Just wanted to add my 5 cents to this issue.
the exceptions happens at https://github.com/SeleniumHQ/selenium/blob/0345a23bebf54aead25bb0f11c9c5c9d63112adc/java/src/org/openqa/selenium/grid/node/relay/RelaySessionFactory.java#L169 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?
@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.
@mykola-mokhnach yes, a few lines above.
@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.
@alokkr016 how about the logs of the node?
@joerg1985 file.txt
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.
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
Thank you for the feedback, I am closing this issue.
what is the fix here?
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?
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 (https://github.com/SeleniumHQ/selenium/issues/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.
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: https://github.com/expressjs/express/issues/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
@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 https://github.com/SeleniumHQ/selenium/blob/4f457b14e06cb28693a64750b4e6960b13ccbe4a/java/src/org/openqa/selenium/grid/web/ReverseProxyHandler.java#L39-L51
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.
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/
@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.
@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
No @joerg1985 I am not using direct connect
@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.
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)
@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.
@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.
@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?