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”}}}