"Connection Refused" error after changing Hub and Nodes from a WiFi connection to a LAN one
What happened?
My current Selenium Grid setup is composed of two Mac Mini machines, each one runs 3 iOS Simulators on Appium, they were working okay whilst they were connected to our office WiFi, but after connecting an Ethernet cable to each machine to make the signal stronger, the tests will no longer run properly on the Node machine. Would appreciate any assistance on this
No idea if this is helpful but here's a screenshot of the connection
How can we reproduce the issue?
Have a selenium node seperate from the hub with a setup like along of the lines of this:
#Appium4.yml
server:
port: 4723
use-drivers:
- xcuitest
default-capabilities:
appium:wdaLocalPort: 8100
appium:derivedDataPath: ~/nodeData4
appium:wdaLaunchTimeout: 720000 # 2 minutes per Simulator
#appium:usePrebuiltWDA: true
appium:settings[pageSourceExcludedAttributes]: "visible"
appium:newCommandTimeout: 9999
#appium:isHeadless: true
appium:mjpegServerPort: 9103
appium:mjpegScreenshotUrl: "http://localhost:9103"
# node4.toml
[server]
port = 5555
[node]
detect-drivers = false
session-timeout=900
[relay]
url = "http://localhost:4723"
status-endpoint = "/status"
configs = [
"1", "{\"platformName\": \"iOS\", \"appium:platformVersion\": \"17.0\", \"appium:deviceName\": \"iPhone 15 Pro Max\", \"appium:automationName\": \"XCUITest\"}"
]
Run this sh
REPORT_FOLDER=_reports
SELENIUM_GRID_FILE_PATH="utils/selenium-server-4.13.0.jar"
SELENIUM_GRID_HUB="CZ2FMCHHEN"
# Begin Appium Servers ---------------------
echo "Starting Appium Server 4..."
nohup node ./node_modules/appium/build/lib/main.js --config variables/selenium_grid/appium4.yml > ${REPORT_FOLDER}/appium.log &
echo "Starting Appium Server 5..."
nohup node ./node_modules/appium/build/lib/main.js --config variables/selenium_grid/appium5.yml > ${REPORT_FOLDER}/appium5.log &
# Begin Grid Nodes ---------------------
echo "Starting Selenium Grid Node 4..."
nohup java -jar ${SELENIUM_GRID_FILE_PATH} node --config ${NODE4_CONFIG} --hub ${SELENIUM_GRID_HUB} > ${REPORT_FOLDER}/node.log &
echo "Starting Selenium Grid Node 5..."
nohup java -jar ${SELENIUM_GRID_FILE_PATH} node --config ${NODE5_CONFIG} --hub ${SELENIUM_GRID_HUB} > ${REPORT_FOLDER}/node5.log &
connect the machine (preferably mac) to an Ethernet cable and try to run tests from the hub
### Relevant log output
```shell
Output from node
09:28:47.668 INFO [RelaySessionFactory.apply] - Starting session for Capabilities {appium:app: /Users/jenkins/test_apps/mu..., appium:autoGrantPermissions: false, appium:automationName: XCUITest, appium:deviceName: iPhone 15 Pro Max, appium:newCommandTimeout: 9999, appium:platformVersion: 17.0, appium:useNativeCachingStrategy: false, platformName: IOS}
09:28:47.676 WARN [SeleniumSpanExporter$1.lambda$export$1] - Error while creating session with the service http://localhost:4723. java.net.ConnectException: Connection refused: localhost/0:0:0:0:0:0:0:1:4723
09:28:47.676 WARN [SeleniumSpanExporter$1.lambda$export$1] - java.io.UncheckedIOException: java.net.ConnectException: Connection refused: localhost/0:0:0:0:0:0:0:1:4723
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.netty.NettyClient.execute(NettyClient.java:96)
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:468)
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:345)
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:345)
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:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Output from hub
09:28:47.440 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "49975591cab1da31948fe7139f1f56de","eventTime": 1714465727432247208,"eventName": "exception","attributes": {"exception.message": "Unable to create session: Could not start a new session. Could not start a new session. Error while creating session with the service http:\u002f\u002flocalhost:4723. org.asynchttpclient.exception.RemotelyClosedException: Remotely closed \nHost info: host: 'L07RN0TTJAVY', ip: '10.32.54.122'\nBuild info: version: '4.13.0', revision: 'ba948ece5b*'\nSystem info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '14.3.1', java.version: '11.0.21'\nDriver info: driver.version: unknown\nBuild info: version: '4.20.0', revision: '866c76ca80'\nSystem info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '13.6.1', java.version: '11.0.21'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Could not start a new session. Error while creating session with the service http:\u002f\u002flocalhost:4723. org.asynchttpclient.exception.RemotelyClosedException: Remotely closed \nHost info: host: 'L07RN0TTJAVY', ip: '10.32.54.122'\nBuild info: version: '4.13.0', revision: 'ba948ece5b*'\nSystem info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '14.3.1', java.version: '11.0.21'\nDriver info: driver.version: unknown\nBuild info: version: '4.20.0', revision: '866c76ca80'\nSystem info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '13.6.1', java.version: '11.0.21'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.grid.node.remote.RemoteNode.newSession(RemoteNode.java:152)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:651)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:570)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:830)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:790)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat java.base\u002fjava.lang.Thread.run(Thread.java:829)\n","exception.type": "org.openqa.selenium.SessionNotCreatedException","logger": "org.openqa.selenium.grid.distributor.local.LocalDistributor","request.payload": "[Capabilities {appium:app: \u002fUsers\u002fjenkins\u002ftest_apps\u002fmu..., appium:autoGrantPermissions: false, appium:automationName: XCUITest, appium:newCommandTimeout: 9999, appium:useNativeCachingStrategy: false, platformName: IOS}]"}}
09:28:47.440 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "51905955b5ad880423de1149fcde836d","eventTime": 1714465700014222500,"eventName": "Session request received by the Distributor","attributes": {"logger": "org.openqa.selenium.grid.distributor.local.LocalDistributor","request.payload": "[Capabilities {appium:app: \u002fUsers\u002fjenkins\u002ftest_apps\u002fmu..., appium:autoGrantPermissions: false, appium:automationName: XCUITest, appium:newCommandTimeout: 9999, appium:useNativeCachingStrategy: false, platformName: IOS}]"}}
09:28:47.440 WARN [SeleniumSpanExporter$1.lambda$export$1] - org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Could not start a new session. Error while creating session with the service http://localhost:4743. org.asynchttpclient.exception.RemotelyClosedException: Remotely closed
Host info: host: 'L07RN0TTJAVY', ip: '10.32.54.122'
Build info: version: '4.13.0', revision: 'ba948ece5b*'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '14.3.1', java.version: '11.0.21'
Driver info: driver.version: unknown
Build info: version: '4.20.0', revision: '866c76ca80'
System info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '13.6.1', java.version: '11.0.21'
Driver info: driver.version: unknown
at org.openqa.selenium.grid.node.remote.RemoteNode.newSession(RemoteNode.java:152)
at org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:651)
at org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:570)
at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:830)
at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:790)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
### Operating System
Mac OS Sonoma 14.3.1
### Selenium version
4.13.0 for the node runner, 4.20 for the hub (doesn't work even if hub is on 4.13)
### What are the browser(s) and version(s) where you see this issue?
N/A
### What are the browser driver(s) and version(s) where you see this issue?
XCUITest
### Are you using Selenium Grid?
Yes - versions specified above
@tking16, 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!
Connection refused: localhost/0:0:0:0:0:0:0:1:4723
Appium server is refusing the connection. Have you checked the servers logs to find any issues?
@diemol Nothing I could see personally
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m connect ECONNREFUSED 127.0.0.1:8100
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Matched '/status' to command name 'getStatus'
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m connect ECONNREFUSED 127.0.0.1:8100
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Matched '/status' to command name 'getStatus'
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m connect ECONNREFUSED 127.0.0.1:8100
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Matched '/status' to command name 'getStatus'
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m connect ECONNREFUSED 127.0.0.1:8100
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Matched '/status' to command name 'getStatus'
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m connect ECONNREFUSED 127.0.0.1:8100
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Matched '/status' to command name 'getStatus'
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m connect ECONNREFUSED 127.0.0.1:8100
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Matched '/status' to command name 'getStatus'
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m connect ECONNREFUSED 127.0.0.1:8100
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Matched '/status' to command name 'getStatus'
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m connect ECONNREFUSED 127.0.0.1:8100
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Matched '/status' to command name 'getStatus'
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m connect ECONNREFUSED 127.0.0.1:8100
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Matched '/status' to command name 'getStatus'
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m connect ECONNREFUSED 127.0.0.1:8100
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Matched '/status' to command name 'getStatus'
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m connect ECONNREFUSED 127.0.0.1:8100
[38;5;0m[HTTP][0m [37m-->[39m [37mGET[39m [37m/status[39m
[38;5;0m[HTTP][0m {}
[38;5;16m[AppiumDriver@b063][0m Calling AppiumDriver.getStatus() with args: []
[38;5;16m[AppiumDriver@b063][0m Responding to client with driver.getStatus() result: {"ready":true,"message":"The server is ready to accept new connections","build":{"version":"2.4.1","git-sha":"1a05bd56f5e795b12c5dc0da4dd2ef604a465780","built":"2024-04-30 15:06:47 +0100"}}
[38;5;0m[HTTP][0m <-- GET /status 200 1 ms - 199
[38;5;0m[HTTP][0m
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Matched '/status' to command name 'getStatus'
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m connect ECONNREFUSED 127.0.0.1:8100
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Matched '/status' to command name 'getStatus'
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Got response with status 200: {"value":{"build":{"upgradedAt":"1714487171002","time":"Apr 30 2024 15:28:17","productBundleIdentifier":"com.facebook.WebDriverAgentRunner"},"os":{"testmanagerdVersion":65535,"name":"iOS","sdkVersion":"17.0","version":"17.0"},"device":"iphone","ios":{"simulatorVersion":"17.0","ip":"10.32.54.122"},"message":"WebDriverAgent is ready to accept commands","state":"success","ready":true},"sessionId":null}
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m WebDriverAgent information:
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m {
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m "build": {
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m "upgradedAt": "1714487171002",
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m "time": "Apr 30 2024 15:28:17",
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m "productBundleIdentifier": "com.facebook.WebDriverAgentRunner"
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m },
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m "os": {
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m "testmanagerdVersion": 65535,
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m "name": "iOS",
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m "sdkVersion": "17.0",
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m "version": "17.0"
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m },
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m "device": "iphone",
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m "ios": {
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m "simulatorVersion": "17.0",
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m "ip": "10.32.54.122"
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m },
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m "message": "WebDriverAgent is ready to accept commands",
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m "state": "success",
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m "ready": true
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m }
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m WebDriverAgent successfully started after 202103ms
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Event 'wdaSessionAttempted' logged at 1714487491424 (15:31:31 GMT+0100 (British Summer Time))
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Sending createSession command to WDA
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Matched '/session' to command name 'createSession'
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Proxying [POST /session] to [POST http://127.0.0.1:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"com.thisistheCompany.guacamole.development","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true,"forceAppLaunch":true,"useNativeCachingStrategy":false,"forceSimulatorSoftwareKeyboardPresence":true}],"alwaysMatch":{}}}
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Got response with status 200: {"value":{"sessionId":"ED455A65-60DB-4A4F-8ED3-2219445F2410","capabilities":{"sdkVersion":"17.0","device":"iphone"}},"sessionId":"ED455A65-60DB-4A4F-8ED3-2219445F2410"}
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Determined the downstream protocol as 'W3C'
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m WDA session startup took 8622ms
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Event 'wdaSessionStarted' logged at 1714487500047 (15:31:40 GMT+0100 (British Summer Time))
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Event 'wdaStarted' logged at 1714487500047 (15:31:40 GMT+0100 (British Summer Time))
[38;5;80m[BaseDriver][0m The value of 'elementResponseAttributes' setting did not change. Skipping the update for it
[38;5;80m[BaseDriver][0m The value of 'shouldUseCompactResponses' setting did not change. Skipping the update for it
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Starting MJPEG stream reading URL: 'http://localhost:9103'
[38;5;160m[Support][0m Loading local package 'mjpeg-consumer'
[38;5;16m[AppiumDriver@b063][0m New XCUITestDriver session created successfully, session 7d1fd45b-cc14-4d25-ba08-6a7235a54754 added to master session list
[38;5;16m[AppiumDriver@b063][0m Applying the initial values to Appium settings parsed from W3C caps: {"pageSourceExcludedAttributes":"visible"}
[38;5;16m[AppiumDriver@b063][0m Event 'newSessionStarted' logged at 1714487500392 (15:31:40 GMT+0100 (British Summer Time))
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Cached the protocol value 'W3C' for the new session 7d1fd45b-cc14-4d25-ba08-6a7235a54754
[38;5;32m[XCUITestDriver@445f (7d1fd45b)][0m Responding to client with driver.createSession() result: {"capabilities":{"webStorageEnabled":false,"locationContextEnabled":false,"browserName":"","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true,"networkConnectionEnabled":false,"platformName":"IOS","app":"/Users/jenkins/test_apps/multiple-iOS-simulators-appium/TheApp.app","autoGrantPermissions":"false","automationName":"XCUITest","deviceName":"iPhone 15 Pro Max","newCommandTimeout":9999,"platformVersion":"17.0","useNativeCachingStrategy":false,"wdaLocalPort":8100,"derivedDataPath":"~/nodeData4","wdaLaunchTimeout":720000,"isHeadless":true,"mjpegServerPort":9103,"mjpegScreenshotUrl":"http://localhost:9103","udid":"00DF38B2-0EB7-4922-BCAF-2BAACC601D26"}}
[38;5;0m[HTTP][0m <-- POST /session 200 226407 ms - 762
[38;5;0m[HTTP][0m
[38;5;0m[HTTP][0m [37m-->[39m [37mGET[39m [37m/status[39m
[38;5;0m[HTTP][0m {}
[38;5;16m[AppiumDriver@b063][0m Calling AppiumDriver.getStatus() with args: []
[38;5;16m[AppiumDriver@b063][0m Responding to client with driver.getStatus() result: {"ready":true,"message":"The server is ready to accept new connections","build":{"version":"2.4.1","git-sha":"1a05bd56f5e795b12c5dc0da4dd2ef604a465780","built":"2024-04-30 15:06:47 +0100"}}
[38;5;0m[HTTP][0m <-- GET /status 200 1 ms - 199
[38;5;0m[HTTP][0m
[38;5;0m[HTTP][0m [37m-->[39m [37mGET[39m [37m/status[39m
[38;5;0m[HTTP][0m {}
[38;5;16m[AppiumDriver@b063][0m Calling AppiumDriver.getStatus() with args: []
[38;5;16m[AppiumDriver@b063][0m Responding to client with driver.getStatus() result: {"ready":true,"message":"The server is ready to accept new connections","build":{"version":"2.4.1","git-sha":"1a05bd56f5e795b12c5dc0da4dd2ef604a465780","built":"2024-04-30 15:06:47 +0100"}}
[38;5;0m[HTTP][0m <-- GET /status 200 2 ms - 199
[38;5;0m[HTTP][0m
[38;5;0m[HTTP][0m [37m-->[39m [37mGET[39m [37m/status[39m
[38;5;0m[HTTP][0m {}
[38;5;16m[AppiumDriver@b063][0m Calling AppiumDriver.getStatus() with args: []
[38;5;16m[AppiumDriver@b063][0m Responding to client with driver.getStatus() result: {"ready":true,"message":"The server is ready to accept new connections","build":{"version":"2.4.1","git-sha":"1a05bd56f5e795b12c5dc0da4dd2ef604a465780","built":"2024-04-30 15:06:47 +0100"}}
[38;5;0m[HTTP][0m <-- GET /status 200 1 ms - 199
[38;5;0m[HTTP][0m
[38;5;0m[HTTP][0m [37m-->[39m [37mGET[39m [37m/status[39m
[38;5;0m[HTTP][0m {}
[38;5;16m[AppiumDriver@b063][0m Calling AppiumDriver.getStatus() with args: []
[38;5;16m[AppiumDriver@b063][0m Responding to client with driver.getStatus() result: {"ready":true,"message":"The server is ready to accept new connections","build":{"version":"2.4.1","git-sha":"1a05bd56f5e795b12c5dc0da4dd2ef604a465780","built":"2024-04-30 15:06:47 +0100"}}
[38;5;0m[HTTP][0m <-- GET /status 200 2 ms - 199
[38;5;0m[HTTP][0m
[38;5;0m[HTTP][0m [37m-->[39m [37mGET[39m [37m/status[39m
[38;5;0m[HTTP][0m {}
[38;5;16m[AppiumDriver@b063][0m Calling AppiumDriver.getStatus() with args: []
[38;5;16m[AppiumDriver@b063][0m Responding to client with driver.getStatus() result: {"ready":true,"message":"The server is ready to accept new connections","build":{"version":"2.4.1","git-sha":"1a05bd56f5e795b12c5dc0da4dd2ef604a465780","built":"2024-04-30 15:06:47 +0100"}}
[38;5;0m[HTTP][0m <-- GET /status 200 2 ms - 199
[38;5;0m[HTTP][0m
[38;5;0m[HTTP][0m [37m-->[39m [37mGET[39m [37m/status[39m
[38;5;0m[HTTP][0m {}
[38;5;16m[AppiumDriver@b063][0m Calling AppiumDriver.getStatus() with args: []
[38;5;16m[AppiumDriver@b063][0m Responding to client with driver.getStatus() result: {"ready":true,"message":"The server is ready to accept new connections","build":{"version":"2.4.1","git-sha":"1a05bd56f5e795b12c5dc0da4dd2ef604a465780","built":"2024-04-30 15:06:47 +0100"}}
[38;5;0m[HTTP][0m <-- GET /status 200 5 ms - 199
[38;5;0m[HTTP][0m
[38;5;0m[HTTP][0m [37m-->[39m [37mGET[39m [37m/status[39m
[38;5;0m[HTTP][0m {}
[38;5;16m[AppiumDriver@b063][0m Calling AppiumDriver.getStatus() with args: []
[38;5;16m[AppiumDriver@b063][0m Responding to client with driver.getStatus() result: {"ready":true,"message":"The server is ready to accept new connections","build":{"version":"2.4.1","git-sha":"1a05bd56f5e795b12c5dc0da4dd2ef604a465780","built":"2024-04-30 15:06:47 +0100"}}
[38;5;0m[HTTP][0m <-- GET /status 200 1 ms - 199
[38;5;0m[HTTP][0m
[38;5;0m[HTTP][0m [37m-->[39m [37mGET[39m [37m/status[39m
[38;5;0m[HTTP][0m {}
[38;5;16m[AppiumDriver@b063][0m Calling AppiumDriver.getStatus() with args: []
[38;5;16m[AppiumDriver@b063][0m Responding to client with driver.getStatus() result: {"ready":true,"message":"The server is ready to accept new connections","build":{"version":"2.4.1","git-sha":"1a05bd56f5e795b12c5dc0da4dd2ef604a465780","built":"2024-04-30 15:06:47 +0100"}}
[38;5;0m[HTTP][0m <-- GET /status 200 9 ms - 199
[38;5;0m[HTTP][0m
[38;5;0m[HTTP][0m [37m-->[39m [37mGET[39m [37m/status[39m
[38;5;0m[HTTP][0m {}
[38;5;16m[AppiumDriver@b063][0m Calling AppiumDriver.getStatus() with args: []
[38;5;16m[AppiumDriver@b063][0m Responding to client with driver.getStatus() result: {"ready":true,"message":"The server is ready to accept new connections","build":{"version":"2.4.1","git-sha":"1a05bd56f5e795b12c5dc0da4dd2ef604a465780","built":"2024-04-30 15:06:47 +0100"}}
[38;5;0m[HTTP][0m <-- GET /status 200 1 ms - 199
[38;5;0m[HTTP][0m
connect ECONNREFUSED 127.0.0.1:8100
It seems appium:wdaLocalPort: 8100 needs a while to start, but then it does start, and then the log you shared above looks successful, as the session was created.
@diemol I'm now getting another error:
Host info: host: 'L07RN0TTJAVY', ip: '10.32.54.122'
Build info: version: '4.13.0', revision: 'ba948ece5b*'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '14.3.1', java.version: '11.0.21'
Driver info: driver.version: unknown
Build info: version: '4.13.0', revision: 'ba948ece5b*'
System info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '13.6.1', java.version: '11.0.21'
Driver info: driver.version: unknown
12:20:41.839 WARN [SeleniumSpanExporter$1.lambda$export$1] - org.openqa.selenium.RetrySessionRequestException: Could not start a new session. Could not start a new session. Max session count reached.
Host info: host: 'L07RN0TTJAVY', ip: '10.32.54.122'
Build info: version: '4.13.0', revision: 'ba948ece5b*'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '14.3.1', java.version: '11.0.21'
Driver info: driver.version: unknown
Build info: version: '4.13.0', revision: 'ba948ece5b*'
System info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '13.6.1', java.version: '11.0.21'
Driver info: driver.version: unknown
at org.openqa.selenium.grid.node.remote.RemoteNode.newSession(RemoteNode.java:149)
at org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:648)
at org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:565)
at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:829)
at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:787)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
12:20:41.839 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "293ecf3a753a6369997e07d3b7a10ce9","eventTime": 1714562441839295208,"eventName": "exception","attributes": {"exception.message": "Unable to create session: Could not start a new session. Could not start a new session. Max session count reached. \nHost info: host: 'L07RN0TTJAVY', ip: '10.32.54.122'\nBuild info: version: '4.13.0', revision: 'ba948ece5b*'\nSystem info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '14.3.1', java.version: '11.0.21'\nDriver info: driver.version: unknown\nBuild info: version: '4.13.0', revision: 'ba948ece5b*'\nSystem info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '13.6.1', java.version: '11.0.21'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.RetrySessionRequestException: Could not start a new session. Could not start a new session. Max session count reached. \nHost info: host: 'L07RN0TTJAVY', ip: '10.32.54.122'\nBuild info: version: '4.13.0', revision: 'ba948ece5b*'\nSystem info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '14.3.1', java.version: '11.0.21'\nDriver info: driver.version: unknown\nBuild info: version: '4.13.0', revision: 'ba948ece5b*'\nSystem info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '13.6.1', java.version: '11.0.21'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.grid.node.remote.RemoteNode.newSession(RemoteNode.java:149)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:648)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:565)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:829)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:787)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat java.base\u002fjava.lang.Thread.run(Thread.java:829)\n","exception.type": "org.openqa.selenium.RetrySessionRequestException","logger": "org.openqa.selenium.grid.distributor.local.LocalDistributor","request.payload": "[Capabilities {appium:app: \u002fUsers\u002fJenkins\u002ftest_apps\u002fmu..., appium:autoGrantPermissions: false, appium:automationName: XCUITest, appium:newCommandTimeout: 9999, appium:useNativeCachingStrategy: false, platformName: IOS}]"}}
12:20:41.839 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "d02c809fe3dab0b07402bc47316fd5e4","eventTime": 1714562441837028791,"eventName": "Session request received by the Distributor","attributes": {"logger": "org.openqa.selenium.grid.distributor.local.LocalDistributor","request.payload": "[Capabilities {appium:app: \u002fUsers\u002fJenkins\u002ftest_apps\u002fmu..., appium:autoGrantPermissions: false, appium:automationName: XCUITest, appium:newCommandTimeout: 9999, appium:useNativeCachingStrategy: false, platformName: IOS}]"}}
It says "Max session count reached", I'm a bit confused by this, I can't set the sessions to more than 1 right? As I'm running a native iOS app and not a browser, so my understanding is if I do set it to more than 1 it will try to run multiple apps on a single device, resulting in more failures?
In the Selenium docs max-sessions is defined as "Maximum number of concurrent sessions. Default value is the number of available processors.". I'm only running 3 devices on this node, I will share the output of cURL GET 'http://localhost:4444/status'
Forgot to add, the machine is processer is a: 3.2 GHz 6-Core Intel Core i7, so definitely has more than a single processor
In the Selenium docs max-sessions is defined as "Maximum number of concurrent sessions. Default value is the number of available processors.". I'm only running 3 devices on this node, I will share the output of cURL GET 'http://localhost:4444/status'
This applies when you are using browsers only. In your case, you need to configure the host based on the requirements a simulator has to calculate how many concurrent sessions you can have.
It says "Max session count reached", I'm a bit confused by this, I can't set the sessions to more than 1 right? As I'm running a native iOS app and not a browser, so my understanding is if I do set it to more than 1 it will try to run multiple apps on a single device, resulting in more failures?
I don't remember exactly how to do it, but I believe you can run more than one simulator and each one with a different app if desired. You should check the appium docs.
I will close this issue as there is no bug for us to triage or fix.
This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs.