Appium 1.2.2 Selenium Grid Destroying Appium servers

So I am running a Selenium Grid with 2 Appium-Android servers on ports :4724 and :4725. and I have one Appium server on port :4723. I run a test on the Android device on port :4725, and after the test suceeds, the Selenium grid cannot see the Appium Android server on port :4724. Here are the logs below from right before the test finishes, to right after it restarts. (Also 4d00cc0d61c7b009 is the udid of the android device on port :4725.

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] Proxied response received with status 200: “{“sessionId”:“4463e7f8db1dda5b65d1cb0199270285”,“status”:0,“value”:“Pay History”}”

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: <-- GET /wd/hub/session/4463e7f8db1dda5b65d1cb0199270285/element/0.35657231556251645-1/text 200 192.488 ms - 81

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: --> GET /wd/hub/status {}

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] Proxying command to 127.0.0.1:9516

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] Making http request with opts: {“url”:“http://127.0.0.1:9516/wd/hub/status",“method”:"GET”}

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] Proxied response received with status 200: “{“sessionId”:”",“status”:0,“value”:{“build”:{“version”:“alpha”},“os”:{“arch”:“x86_64”,“name”:“Mac OS X”,“version”:“10.9.4”}}}"

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: <-- GET /wd/hub/status 200 6.461 ms - 125

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: --> DELETE /wd/hub/session/4463e7f8db1dda5b65d1cb0199270285 {}

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: Shutting down appium session

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“shutdown”}

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] [BOOTSTRAP] [debug] Got command of type SHUTDOWN

info: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:“OK, shutting down”,“status”:0}

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] Sent shutdown command, waiting for UiAutomator to stop…

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] [BOOTSTRAP] [debug] Closed client connection

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=.

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=.

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] [UIAUTOMATOR STDOUT] Time: 57.718

info: [debug] [UIAUTOMATOR STDOUT] OK (1 test)

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] UiAutomator shut down normally

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] Killing chromedriver

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] Chromedriver exited with code null

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] (killed by signal SIGTERM)

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] executing: “/Users/ultilab/android-sdk/platform-tools/adb” -s 4d00cc0d61c7b009 shell “am force-stop com.android.chrome”

SELENIUM - ERROR: 15:27:16.358 INFO - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}-> localhost:4724: The target server failed to respond

15:27:16.358 INFO - Retrying request to {}-> localhost:4724

SELENIUM - ERROR: 15:27:16.361 INFO - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}-> localhost:4724: The target server failed to respond

SELENIUM - ERROR: 15:27:16.362 INFO - Retrying request to {}-> localhost:4724

SELENIUM - ERROR: 15:27:16.365 INFO - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}-> localhost:4724: The target server failed to respond

15:27:16.365 INFO - Retrying request to {}-> localhost:4724

SELENIUM - ERROR: 15:27:16.368 WARN - Failed to check status of node: localhost:4724 failed to respond

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] Stopping logcat capture

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] Logcat terminated with code null, signal SIGTERM

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] Cleaning up appium session

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] Responding to client with success: {“status”:0,“value”:null,“sessionId”:“4463e7f8db1dda5b65d1cb0199270285”}

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: <-- DELETE /wd/hub/session/4463e7f8db1dda5b65d1cb0199270285 200 1095.201 ms - 72 {“status”:0,“value”:null,“sessionId”:“4463e7f8db1dda5b65d1cb0199270285”}

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: --> GET /wd/hub/status {}

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.2.2”,“revision”:“cf6ff5939ddc6b4d45fcbabfbfe13c950e0058c4”}}}

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: <-- GET /wd/hub/status 200 1.225 ms - 104 {“status”:0,“value”:{“build”:{“version”:“1.2.2”,“revision”:“cf6ff5939ddc6b4d45fcbabfbfe13c950e0058c4”}}}

SELENIUM - ERROR: 15:27:21.375 INFO - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}-> localhost:4724: The target server failed to respond

SELENIUM - ERROR: 15:27:21.375 INFO - Retrying request to {}-> localhost:4724

SELENIUM - ERROR: 15:27:21.378 INFO - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}-> localhost:4724: The target server failed to respond

SELENIUM - ERROR: 15:27:21.378 INFO - Retrying request to {}-> localhost:4724

SELENIUM - ERROR: 15:27:21.381 INFO - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}-> localhost:4724: The target server failed to respond

SELENIUM - ERROR: 15:27:21.381 INFO - Retrying request to {}-> localhost:4724

SELENIUM - ERROR: 15:27:21.384 WARN - Failed to check status of node: localhost:4724 failed to respond

SELENIUM - ERROR: 15:27:21.384 WARN - Marking the node as down. Cannot reach the node for 2 tries.

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: --> GET /wd/hub/status {}

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.2.2”,“revision”:“cf6ff5939ddc6b4d45fcbabfbfe13c950e0058c4”}}}

ANDROID - stdout for 4d00cc0d61c7b009: ----> info: <-- GET /wd/hub/status 200 1.139 ms - 104 {“status”:0,“value”:{“build”:{“version”:“1.2.2”,“revision”:“cf6ff5939ddc6b4d45fcbabfbfe13c950e0058c4”}}}

does anyone know if this is a port issue?? or an off by 1 error somewhere in the source code?

Can you post your appium server and selenium grid launch strings, and (if you’re using one) your config file?

This is how I’m starting Selenium Grid, where this.opts[“port”] = 4444

this.selenium = spawn(“java”, ["-jar", __dirname + “/includes/selenium.jar”, “-role”, “hub”, “-port”, this.opts[“port”], “-capabilityMatcher”, “org.openqa.grid.internal.utils.CustomCapabilityMatcher”]);

This is how I’m starting the ios appium instance.
(spawn(‘appium’, [’–nodeconfig’, inputPath, ‘–port’, configData[“configuration”][“port”], “–log”, “/AppiumRunnerHelp/AppiumIOS.log”]));

This is the config file for the ios instance.
{“capabilities”:[{“browserName”:“safari”,“appium-version”:“1.2”,“platformName”:“iOS”,“platformVersion”:“6.0”,“udid”:"*",“maxInstances”:1,“platform”:“MAC”}],“configuration”:{“cleanUpCycle”:2000,“timeout”:30000,“proxy”:“org.openqa.grid.selenium.proxy.DefaultRemoteProxy”,“port”:4723,“url”:“http://localhost:4723/wd/hub",“host”:“localhost”,“maxSession”:1,“register”:true,“registerCycle”:5000,“hubPort”:4444,“hubHost”:"localhost”}}

This is how I’m spawning the Android Instance

this.appiumInstances.push(spawn(‘appium’, [’–nodeconfig’, inputPath, ‘–port’, configData[“configuration”][“port”], “–chromedriver-port”, 9515 + index, “–session-override”, “–log”, “/Users/ultilab/AppiumRunnerHelp/AppiumAndroid.log”]));

This is the config for the first Android instance.

{“capabilities”:[{“browserName”:“chrome”,“appium-version”:“1.2”,“platformName”:“Android”,“platformVersion”:“4.3”,“udid”:“HT39LW904844”,“maxInstances”:1,“platform”:“MAC”}],“configuration”:{“cleanUpCycle”:2000,“timeout”:30000,“proxy”:“org.openqa.grid.selenium.proxy.DefaultRemoteProxy”,“port”:4724,“url”:“http://localhost:4724/wd/hub",“host”:“localhost”,“maxSession”:1,“register”:true,“registerCycle”:5000,“hubPort”:4444,“hubHost”:"localhost”}}

This is the config file for the second Android Instance

{“capabilities”:[{“browserName”:“chrome”,“appium-version”:“1.2”,“platformName”:“Android”,“platformVersion”:“4.4”,“udid”:“4d00cc0d61c7b009”,“maxInstances”:1,“platform”:“MAC”}],“configuration”:{“cleanUpCycle”:2000,“timeout”:30000,“proxy”:“org.openqa.grid.selenium.proxy.DefaultRemoteProxy”,“port”:4725,“url”:“http://localhost:4725/wd/hub",“host”:“localhost”,“maxSession”:1,“register”:true,“registerCycle”:5000,“hubPort”:4444,“hubHost”:"localhost”}}

does anyone know of any current known Selenium Grid issues that might be causing this?