Bootstrap is always running on port 4724. Parallel execution

Hello all.

I’m facing an issue while I’m trying to connect two physical devices to two different appium servers.

I start Appium servers via command line, each server is configured with different ports:
First Appium server:

“C:/Program Files (x86)/Appium/node.exe” “C:/Program Files (x86)/Appium/node_modules/appium/lib/server/main.js” --address 127.0.0.1 --port 4723 --platform-name Android --platform-version 6.0 --automation-name Appium --device-name “04e86d24” --bootstrap-port 4724 --chromedriver-port 4725 --log-no-color --session-override

Second Appium server:

“C:/Program Files (x86)/Appium/node.exe” “C:/Program Files (x86)/Appium/node_modules/appium/lib/server/main.js” --address 127.0.0.1 --port 4733 --platform-name Android --platform-version 4.3 --automation-name Appium --device-name “4df1c14332955fd3” --bootstrap-port 4734 --chromedriver-port 4735 --log-no-color --session-override

Then I execute parallely a test on both Appium servers…

DesiredCapabilities capabilities01 = new DesiredCapabilities();
capabilities01.setCapability(“appPackage”, APP_PACKAGE);
capabilities01.setCapability(“appActivity”, APP_ACTIVITY);
capabilities01.setCapability(“deviceName”, “MyAndroid01”);
capabilities01.setCapability(“udid”, DEVICE1_UDID);

firstDriver = new AndroidDriver(new URL(“http://127.0.0.1:4723/wd/hub”), capabilities01);

DesiredCapabilities capabilities02 = new DesiredCapabilities();
capabilities02.setCapability(“appPackage”, APP_PACKAGE);
capabilities02.setCapability(“appActivity”, APP_ACTIVITY);
capabilities02.setCapability(“deviceName”, “MyAndroid02”);
capabilities02.setCapability(“udid”, DEVICE2_UDID);

secondDriver = new AndroidDriver(new URL(“http://127.0.0.1:4733/wd/hub”), capabilities02);

Server launching and driver instantation is executed independently from two Java Threads simultaneously. The two Appium servers are started at same time with no problems. After the server launches the threads, it tries to connect the pertinent device to the correct server (one hosted on 4723 port and other on 4733 port).
Everything is going OK until the device connection reachs bootstrap starting in Appium server log. Then ONE of the servers continues with no problems (I think the first that reaches bootstrap starting) and the OTHER server gets stuck on this message:

info: [debug] Pushing command to appium work queue: [“wake”,{}]
or in this message:
error: Unhandled error: Error: read ECONNRESET
at exports._errnoException (util.js:746:11)
at TCP.onread (net.js:561:26) context: [POST /wd/hub/session {“desiredCapabi
lities”:{“appPackage”:“com.munichre.digital.doctor.debug”,“appActivity”:“com.mun
ichre.digital.doctor.pres.ui.authentication.splash.SplashViewActivity”,“platform
Version”:“6.0”,"automatio]

After some searching I always get to the same point: ‘Start your servers in different ports and bootstrap-ports’, and that what I’m doing as shown above. So, looking the stucked Appium server log I’ve realized that just above of the “wake” or “ECONNRESET” messages there is starting bootstrap on port 4724.Then checked the the successful Appium server and is using port 4724 too, so both servers opens 4724 port for bootstrap!

At this point I’m really confused, why is both servers opening the same port for bootstrap if I explicity defined different bootstrap ports for each server?

Uploaded a capture where the second appium server gets stucked:

Any suggestion? Thanks

1 Like
  • 4724 is default bootstap port to use on device to talk to Appium.
  • Besides, another socket that appium starts up on 4724

There is no related info to avoid using boostrap and appium port different (as I know) but I think you should avoid using port 4724 for Appium port and bootstrap port as well to avoid any conflicting.

What prevented you from using another port instead of 4724 for the 1st one?

I’m running 3 Android devices in parallel and I started from:
appiumPort = 4726
bootStrspPort = 2296
chromePort = 6006

Hey there,

It is a good practice to specify the port for bootstrap too?
I’ve used Appium without it all the time.

did you try to use -bp that controls the Appium bootstrap port?