Appium grid issue

Hello all,

I just started appium automation on iOS. I got the automation working if I run appium server as HUB, but I couldn’t get it work as a grid connected to a HUB on the same MAC.

I used java -jar selenium-server-standalone-2.45.0.jar -role hub to start the HUB on local, and started appium server as a grid using this nodeconfig.json

{
  "capabilities":
      [
        {
          "browserName": "iOS",
          "version":"8.1",
          "maxInstances": 1,
          "platform":"MAC"
        }
      ],
  "configuration":
  {
    "cleanUpCycle":2000,
    "timeout":600000,
    "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
    "url":"http://127.0.0.1:4725/wd/hub",
    "host": "127.0.0.1",
    "port": 4725,
    "maxSession": 1,
    "register": true,
    "registerCycle": 5000,
    "hubPort": 4444,
    "hubHost": "127.0.0.1"
  }
}

The appium connected to the HUB successfully and this statement driver = new RemoteWebDriver(new URL(“http://127.0.0.1:4444/wd/hub”), cap); created a new session on the appium grid, and the app I wanted to automate started up on the iOS device. However, it seems the HUB and the driver creation didn’t know the session was created, so my automation stuck at the driver creation state without sending any further commands. In this case, the appium grid will shut down this session after the 60s timeout waiting for new commands.

Here is the partial log from the appium grid:

info: [debug] Device launched! Ready for commands
info: [debug] Setting command timeout to the default of 60 secs
info: [debug] Appium session started with sessionId e6b1d2b9-8ceb-4d25-a925-73cea8f1003a


info: <-- POST /wd/hub/session 303 16613.696 ms - 9 


info: --> GET /wd/hub/status {}


info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: <-- GET /wd/hub/status 200 1.791 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}


info: --> GET /wd/hub/status {}


info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: <-- GET /wd/hub/status 200 1.059 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}


info: --> GET /wd/hub/status {}


info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: <-- GET /wd/hub/status 200 1.931 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}


info: --> GET /wd/hub/status {}


info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}


info: <-- GET /wd/hub/status 200 3.659 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}


info: --> GET /wd/hub/status {}


info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: <-- GET /wd/hub/status 200 1.912 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}


info: --> GET /wd/hub/status {}


info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}


info: <-- GET /wd/hub/status 200 3.457 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}


info: --> GET /wd/hub/status {}


info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}


info: <-- GET /wd/hub/status 200 3.622 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}


info: --> GET /wd/hub/status {}


info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: <-- GET /wd/hub/status 200 1.288 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}


info: --> GET /wd/hub/status {}


info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: <-- GET /wd/hub/status 200 1.419 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}


info: --> GET /wd/hub/status {}


info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: <-- GET /wd/hub/status 200 1.444 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}


info: --> GET /wd/hub/status {}


info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: <-- GET /wd/hub/status 200 1.692 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}


info: --> GET /wd/hub/status {}


info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: <-- GET /wd/hub/status 200 2.321 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}


info: --> GET /wd/hub/status {}


info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: <-- GET /wd/hub/status 200 1.600 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}


info: --> GET /wd/hub/status {}


info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}
info: <-- GET /wd/hub/status 200 2.532 ms - 178 {"status":0,"value":{"build":{"version":"1.3.5","revision":"a124a15677e26b33db16e81c4b3b34d9c6b8cac9"},"isShuttingDown":false},"sessionId":"e6b1d2b9-8ceb-4d25-a925-73cea8f1003a"}


info: [debug] Didn't get a new command in 60 secs, shutting down...


info: Shutting down appium session
info: [debug] Stopping ios
info: [debug] Destroying instruments client socket.
info: [debug] Closing socket server.


info: [debug] Instruments socket server was closed
info: [debug] Sending sigterm to instruments
info: [debug] [INST] 2015-03-06 00:52:23 +0000 Stopped: Script was stopped by the user

After the session was created, appium grid tried to tell the HUB that the session was created successfully, and I used tcpdump to check port 4444 and saw messages coming in during that time, but I didn’t know why the HUB didn’t notify my client that the session had been created so the the webdriver can send in other new commands. Is it possible that the selenium HUB doesn’t recognize the response from the appium grid?

Did anyone encounter this issue before? Any help will be appreciated. Thanks!

Getting silimar problem myself, when i
driver = new AndroidDriver(new URL(“http://192.168.0.13:4237/wd/hub”), capabilities);
it works
but when I
driver = new AndroidDriver(new URL(“http://192.168.0.13:4444/wd/hub”), capabilities);

to grid, app startes and the dies

Any ideas ?

  ,"sessionId":"0db8f3b0-562a-44fb-aea1-d42bc1c005cb"}
    info: --> GET /wd/hub/status {}
    info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}},"sessionId":"0db8f3b0-562a-44fb-aea1-d42bc1c005cb"}
    info: <-- GET /wd/hub/status 200 0.589 ms - 155 {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}},"sessionId":"0db8f3b0-562a-44fb-aea1-d42bc1c005cb"}
    info: --> DELETE /wd/hub/session/0db8f3b0-562a-44fb-aea1-d42bc1c005cb {}
    info: Shutting down appium session
    info: [debug] Pressing the HOME button
    info: [debug] executing cmd: /Users/connollys/tools/android-sdk-macosx/platform-tools/adb -s 192.168.56.101:5555 shell "input keyevent 3"
    info: [debug] Stopping logcat capture
    info: [debug] Logcat terminated with code null, signal SIGTERM
    info: [debug] Sent shutdown command, waiting for UiAutomator to stop...
    info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"shutdown"}
    info: [debug] [BOOTSTRAP] [debug] Got command of type SHUTDOWN
    info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"OK, shutting down","status":0}
    info: [debug] [BOOTSTRAP] [debug] Closed client connection
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=.
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
    info: [debug] [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=.
    info: [debug] [UIAUTOMATOR STDOUT] Time: 32.494
    info: [debug] [UIAUTOMATOR STDOUT] OK (1 test)
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
    info: [debug] UiAutomator shut down normally
    info: [debug] Cleaning up android objects
    info: [debug] Cleaning up appium session
    info: [debug] Responding to client with success: {"status":0,"value":null,"sessionId":"0db8f3b0-562a-44fb-aea1-d42bc1c005cb"}
    info: <-- DELETE /wd/hub/session/0db8f3b0-562a-44fb-aea1-d42bc1c005cb 200 412.501 ms - 76 {"status":0,"value":null,"sessionId":"0db8f3b0-562a-44fb-aea1-d42bc1c005cb"}
    info: --> GET /wd/hub/status {}
    info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
    info: <-- GET /wd/hub/status 200 0.710 ms - 104 {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
    info: --> GET /wd/hub/status {}
    info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
    info: <-- GET /wd/hub/status 200 0.718 ms - 104 {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
    info: --> GET /wd/hub/status {}

[quote="seanyconnolly, post:2, topic:3224, full:true"]
Getting silimar problem myself, when i   
driver = new AndroidDriver(new URL("http://192.168.0.13:4237/wd/hub"), capabilities);  
it works
but when I 
  driver = new AndroidDriver(new URL("http://192.168.0.13:4444/wd/hub"), capabilities);

to grid, app startes and the dies

Any ideas ?





  ,"sessionId":"0db8f3b0-562a-44fb-aea1-d42bc1c005cb"}
    info: --&gt; GET /wd/hub/status {}
    info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}},"sessionId":"0db8f3b0-562a-44fb-aea1-d42bc1c005cb"}
    info: &lt;-- GET /wd/hub/status 200 0.589 ms - 155 {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}},"sessionId":"0db8f3b0-562a-44fb-aea1-d42bc1c005cb"}
    info: --&gt; DELETE /wd/hub/session/0db8f3b0-562a-44fb-aea1-d42bc1c005cb {}
    info: Shutting down appium session
    info: [debug] Pressing the HOME button
    info: [debug] executing cmd: /Users/connollys/tools/android-sdk-macosx/platform-tools/adb -s 192.168.56.101:5555 shell "input keyevent 3"
    info: [debug] Stopping logcat capture
    info: [debug] Logcat terminated with code null, signal SIGTERM
    info: [debug] Sent shutdown command, waiting for UiAutomator to stop...
    info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"shutdown"}
    info: [debug] [BOOTSTRAP] [debug] Got command of type SHUTDOWN
    info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"OK, shutting down","status":0}
    info: [debug] [BOOTSTRAP] [debug] Closed client connection
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=.
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
    info: [debug] [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=.
    info: [debug] [UIAUTOMATOR STDOUT] Time: 32.494
    info: [debug] [UIAUTOMATOR STDOUT] OK (1 test)
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
    info: [debug] UiAutomator shut down normally
    info: [debug] Cleaning up android objects
    info: [debug] Cleaning up appium session
    info: [debug] Responding to client with success: {"status":0,"value":null,"sessionId":"0db8f3b0-562a-44fb-aea1-d42bc1c005cb"}
    info: &lt;-- DELETE /wd/hub/session/0db8f3b0-562a-44fb-aea1-d42bc1c005cb 200 412.501 ms - 76 {"status":0,"value":null,"sessionId":"0db8f3b0-562a-44fb-aea1-d42bc1c005cb"}
    info: --&gt; GET /wd/hub/status {}
    info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
    info: &lt;-- GET /wd/hub/status 200 0.710 ms - 104 {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
    info: --&gt; GET /wd/hub/status {}
    info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
    info: &lt;-- GET /wd/hub/status 200 0.718 ms - 104 {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
    info: --&gt; GET /wd/hub/status {}

Fixed

set hub host when running grid, as the server didnt know how to talk back to client, or something like that

java -jar selenium-2.45.0/selenium-server-standalone-2.45.0.jar -role hub -host 192.168.0.13

Hi all,

I’m getting below error while connecting to Grid using Appium , the second device getting error and one device is executing fine.

error: Unhandled error: Error: read ECONNRESET
at errnoException (net.js:905:11)
at TCP.onread (net.js:559:19) context: [POST /wd/hub/session {"desiredCapabilities…

Error Coming while running multiple sessions using appium.Please let me know if any one knows about this.

I’m using different ports 4723, 4724 for two devices…

Thanks,
Bhaskar.

Try mentioning the port -p portvalue (even though if its mentioned in nodeconfig)

Yes @PavithraNavaneeth ,

Thanks for the reply. Done with the same and achieved long back. cheers :blush:

Regards,
Bahskar.

i am getting the same error

info: [debug] Didn’t get a new command in 60 secs, shutting down…
info: Shutting down appium session
info: [debug] Pressing the HOME button

can anybody please tell me how to avoid this?

(links to own paid content are against TOS)

will you please help me i’m getting same issue.