Appium server throwing Unhandled error: Error: connect ECONNREFUSED - appium

I'm using appium 1.4. Just before client connection to appium server, an appium server socket is created on port 4274. But when client is trying to connect it gets the following exception:
2015-06-03 08:52:32:541 - info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
2015-06-03 08:52:32:554 - info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
2015-06-03 08:52:32:555 - info: [debug] [BOOTSTRAP] [debug] Loading json...
2015-06-03 08:52:32:555 - info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
2015-06-03 08:52:33:552 - error: Unhandled error: Error: connect ECONNREFUSED
at errnoException (net.js:904:11)
at Object.afterConnect [as oncomplete] (net.js:895:19) context: [POST /wd/hub/session {"desiredCapabilities":{"automationName":"Appium","platformVersion":"Nokia X software platform 1.1","deviceName":"Nokia XL Dual SIM","platformName":"Android","browserName":"Browser"}}]
But, there is no server socket created on port 4274 on host where appium is running.
Could someone suggest me what went wrong and how to resolve this issue ?

Related

Error in loading Appium XCUITEST driver

I am really stuck, any help will be appreciated...
I have installed the latest server version (1.6.0).
When I am checking the server version it is OK...
Asis-Mac-mini:/ asihizkiahu$ appium -v
1.6.0
Observe at the server version in the log attached, it indicates Appium v1.6.0-beta1 (wrong version)
Does this causes the error?
I get error...
[MJSONWP] Encountered internal error running command: Error: Could not navigate to webview; there are none!
Log with the wrong server:
[node, /Users/asihizkiahu/node_modules/appium/build/lib/main.js, --address, 127.0.0.1, --port, 4723]
Appium server started.
(node:13191) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[Appium] Welcome to Appium v1.6.0-beta1
[Appium] Non-default server args:
[Appium] address: '127.0.0.1'
[Appium] Appium REST http interface listener started on 127.0.0.1:4723
Trying to set IOS driver
Property file src/test/resources/messaging_sanity_test/capabilities.properties parsed successfully
[MJSONWP] Encountered internal error running command: Error: Could not navigate to webview; there are none!
Here is part of the log that contain the error:
[debug] [RemoteDebugger] Receiving data from remote debugger: '{"argument":{"WIRApplicationDictionaryKey":{}},"selector":"rpcreportConnectedApplicationList:"}'
[debug] [RemoteDebugger] Received no apps from remote debugger. Unable to connect.
[debug] [RemoteDebugger] Receiving data from remote debugger: '{"argument":{"WIRDriverDictionaryKey":{}},"selector":"rpcreportConnectedDriverList:"}'
[debug] [RemoteDebugger] Notified of connected drivers: {}.
[debug] [RemoteDebugger] Connected to application
[debug] [RemoteDebugger] Sim name: iPhone
[debug] [RemoteDebugger] Sim build: 14A345
[debug] [RemoteDebugger] Sim platform version: 10.0
[debug] [RemoteDebugger] Selecting application
[debug] [RemoteDebugger] No applications currently connected.
[debug] [iOS] No web frames found.
[iOS] Could not find any webviews yet, refreshing/retrying
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: false
[debug] [RemoteDebugger] useNewSafari --> false
[debug] [RemoteDebugger] Debugger socket connected to ::1:27753
[debug] [RemoteDebugger] Sending connection key request
[debug] [RemoteDebugger] Sending 'rpcreportIdentifier:' message to remote debugger
[debug] [RemoteDebugger] Receiving data from remote debugger: '{"argument":{"WIRSimulatorBuildKey":"14A345","WIRSimulatorProductVersionKey":"10.0","WIRSimulatorNameKey":"iPhone"},"selector":"rpcreportSetup:"}'
[debug] [RemoteDebugger] Received response from socket send: '["iPhone","14A345","10.0"]'
[debug] [RemoteDebugger] Receiving data from remote debugger: '{"argument":{"WIRApplicationDictionaryKey":{}},"selector":"rpcreportConnectedApplicationList:"}'
[debug] [RemoteDebugger] Received no apps from remote debugger. Unable to connect.
[debug] [RemoteDebugger] Connected to application
[debug] [RemoteDebugger] Sim name: iPhone
[debug] [RemoteDebugger] Sim build: 14A345
[debug] [RemoteDebugger] Sim platform version: 10.0
[debug] [RemoteDebugger] Selecting application
[debug] [RemoteDebugger] No applications currently connected.
[debug] [iOS] No web frames found.
[XCUITest] Error: Could not navigate to webview; there are none!
at XCUITestDriver.spinHandles$ (lib/commands/context.js:506:13)
at tryCatch (/Users/asihizkiahu/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as next
at GeneratorFunctionPrototype.invoke (/Users/asihizkiahu/node_modules/babel-runtime/regenerator/runtime.js:136:37)
Error: Could not navigate to webview; there are none!
at XCUITestDriver.spinHandles$ (lib/commands/context.js:506:13)
at tryCatch (/Users/asihizkiahu/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as next
at GeneratorFunctionPrototype.invoke (/Users/asihizkiahu/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[JSONWP Proxy] Proxying [DELETE /session/34948802-75b5-4ee5-922f-20b4b658fa18] to [DELETE http://localhost:8100/session/E545A2AC-EB6F-4BD1-A419-DB6CF7B04987] with no body
[debug] [RemoteDebugger] Receiving data from remote debugger: '{"argument":{"WIRDriverDictionaryKey":{}},"selector":"rpcreportConnectedDriverList:"}'
[debug] [RemoteDebugger] Notified of connected drivers: {}.
[JSONWP Proxy] Got response with status 200: "{\n \"value\" : {\n\n },...
[XCUITest] Shutting down WebDriverAgent
[XCUITest] Simulator log exited with code 'null'
[XCUITest] xcodebuild exited with code 'null' and signal 'SIGTERM'
[debug] [XCUITest] Running iOS simulator reset flow
[debug] [XCUITest] Shutting down simulator
[debug] [iOSSim] Killing all iOS Simulators
[debug] [XCUITest] Full reset is on. Cleaning simulator
[debug] [iOSSim] Killing any simulator daemons for 5A494E7A-EE78-4095-8922-CF1C3CC89FAB
[iOSSim] Cleaning simulator 5A494E7A-EE78-4095-8922-CF1C3CC89FAB
[debug] [XCUITest] Resetting simulator
[debug] [XCUITest] Shutting down simulator
[debug] [iOSSim] Killing all iOS Simulators
[debug] [iOSLog] Stopping iOS log capture
[MJSONWP] Encountered internal error running command: Error: Could not navigate to webview; there are none!
at XCUITestDriver.spinHandles$ (lib/commands/context.js:506:13)
at tryCatch (/Users/asihizkiahu/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as next
at GeneratorFunctionPrototype.invoke (/Users/asihizkiahu/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[HTTP] <-- POST /wd/hub/session 500 305866 ms - 183
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not navigate to webview; there are none! (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 306.28 seconds
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: 'Asis-Mac-mini.local', ip: '192.168.1.194', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.7.0_79'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:158)
at com.ui.service.drivers.Drivers$Appium.createIOSDriver(Drivers.java:474)
at com.ui.service.drivers.Drivers$Appium.setDriver(Drivers.java:420)
at com.ui.service.drivers.Drivers.setDriver(Drivers.java:59)
at com.test.BaseTest$StaticRouter.before(BaseTest.java:80)
at appium.messaging.MessagingSanityTest.setUp(MessagingSanityTest.java:123)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
My goal is to load the Appium server (version 1.6.0) via code, and to load the XCUITEST driver as well.
My code is...
Appium server load:
public static void startServer() {
CommandLine command = new CommandLine(
"node");
command.addArgument(
"/Users/asihizkiahu/node_modules/appium/build/lib/main.js",
false);
command.addArgument("--address", false);
command.addArgument("127.0.0.1");
command.addArgument("--port", false);
command.addArgument("4723");
// command.addArgument("---no-reset", true);
DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();
DefaultExecutor executor = new DefaultExecutor();
executor.setExitValue(1);
try {
ColorLog.println(ColorLog.Level.DEBUG, command.toString());
executor.execute(command, resultHandler);
Thread.sleep(10000);
System.out.println("Appium server started.");
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
driver load:
public class AppiumIOS {
private final static Logger logger = Logger.getLogger(AppiumIOS.class);
static WebDriver driver;
public static void main(String[] args) throws MalformedURLException, InterruptedException {
String hubUrl = "http://127.0.0.1:4723/wd/hub";
String iOSDeviceName = "iPhone Simulator";
String iOSVersion = "10.0";
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName", iOSDeviceName);
capabilities.setCapability("platformName", "iOS");
capabilities.setCapability("platformVersion", iOSVersion);
capabilities.setCapability("app", /Users/asihizkiahu/Library/Developer/Xcode/DerivedData/Vi-chglmmqrkfgvuoflipawibkmabgs/Build/Products/Debug-iphonesimulator/Vi-Dev.app);
capabilities.setCapability("automationName", "XCUITest");
driver = new RemoteWebDriver(new URL(hubUrl), capabilities);
}

NullPointerException when using AndroidDriver and calling WebDriverWait

My code below tries to wait until our native app loads. But it receives NPE:
RemoteWebDriver driver =
new AndroidDriver<MobileElement>//this gets NPE below
//new RemoteWebDriver //this works!!
(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
new WebDriverWait(driver, 30).until(
ExpectedConditions.presenceOfElementLocated(
By.xpath("//*[contains(#text, 'Tan')]")));
When I replace AndroidDriver with RemoteDriver, everything works as expected! Our app launches and our test code waits until the app loads. The problem is, we cannot use mobile device specific API using RemoteDriver.
Appium GUI v1.4.16.1 (Ophiuchus). Please tell if any other version info is needed, as I'm not good at npm etc. But I downloaded all of the stuff last week.
Here is the stack trace:
java.lang.NullPointerException
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:152)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:636)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:40)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:369)
at io.appium.java_client.DefaultGenericMobileDriver.findElement(DefaultGenericMobileDriver.java:56)
at io.appium.java_client.AppiumDriver.findElement(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.findElement(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:474)
at io.appium.java_client.DefaultGenericMobileDriver.findElementByXPath(DefaultGenericMobileDriver.java:134)
at io.appium.java_client.AppiumDriver.findElementByXPath(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.findElementByXPath(AndroidDriver.java:1)
at org.openqa.selenium.By$ByXPath.findElement(By.java:361)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:361)
at io.appium.java_client.DefaultGenericMobileDriver.findElement(DefaultGenericMobileDriver.java:52)
at io.appium.java_client.AppiumDriver.findElement(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.findElement(AndroidDriver.java:1)
at org.openqa.selenium.support.ui.ExpectedConditions.findElement(ExpectedConditions.java:895)
at org.openqa.selenium.support.ui.ExpectedConditions.access$000(ExpectedConditions.java:41)
at org.openqa.selenium.support.ui.ExpectedConditions$6.apply(ExpectedConditions.java:181)
at org.openqa.selenium.support.ui.ExpectedConditions$6.apply(ExpectedConditions.java:178)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:238)
Here is what I see on Appium GUI:
> info: [debug] Appium session started with sessionId 4153c447-cfba-45db-a23a-1e603a3e0e7c
> info: <-- POST /wd/hub/session 303 17598.310 ms - 74
> info: --> GET /wd/hub/session/4153c447-cfba-45db-a23a-1e603a3e0e7c {}
> info: [debug] Responding to client with success: {"status":0,"value":{"platform":"LINUX","browserName":"Android","platformVersion":"4.4.2","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"app":"C:\\Temp\\appium\\akbank-release.apk","appActivity":"com.akbank.akbankdirekt.ui.prelogin.SplashActivity","platformName":"Android","deviceName":"OJOBUCIBGEKNTKYS"},"app":"C:\\Temp\\appium\\akbank-release.apk","appActivity":"com.akbank.akbankdirekt.ui.prelogin.SplashActivity","platformName":"Android","deviceName":"OJOBUCIBGEKNTKYS"},"sessionId":"4153c447-cfba-45db-a23a-1e603a3e0e7c"}
> info: <-- GET /wd/hub/session/4153c447-cfba-45db-a23a-1e603a3e0e7c 200 4.362 ms - 667 {"status":0,"value":{"platform":"LINUX","browserName":"Android","platformVersion":"4.4.2","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"app":"C:\\Temp\\appium\\akbank-release.apk","appActivity":"com.akbank.akbankdirekt.ui.prelogin.SplashActivity","platformName":"Android","deviceName":"OJOBUCIBGEKNTKYS"},"app":"C:\\Temp\\appium\\akbank-release.apk","appActivity":"com.akbank.akbankdirekt.ui.prelogin.SplashActivity","platformName":"Android","deviceName":"OJOBUCIBGEKNTKYS"},"sessionId":"4153c447-cfba-45db-a23a-1e603a3e0e7c"}
> info: --> POST /wd/hub/session/4153c447-cfba-45db-a23a-1e603a3e0e7c/element {"using":"xpath","value":"//*[contains(#text, 'Tan')]"}
> info: [debug] Waiting up to 0ms for condition
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"xpath","selector":"//*[contains(#text, 'Tan')]","context":"","multiple":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//*[contains(#text, 'Tan')]","context":"","multiple":false}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: find
> info: [debug] [BOOTSTRAP] [debug] Finding //*[contains(#text, 'Tan')] using XPATH with the contextId: multiple: false
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"Could not find an element using supplied strategy. ","status":7}
> info: [debug] Condition unmet after 8397ms. Timing out.
> info: [debug] Responding to client with error: {"status":7,"value":{"message":"An element could not be located on the page using the given search parameters.","origValue":"Could not find an element using supplied strategy. "},"sessionId":"4153c447-cfba-45db-a23a-1e603a3e0e7c"}
> info: <-- POST /wd/hub/session/4153c447-cfba-45db-a23a-1e603a3e0e7c/element 500 8402.114 ms - 230
I've put a sleep before wait and now I don't get NPE:
RemoteWebDriver driver =
new AndroidDriver<MobileElement>//this gets NPE below
//new RemoteWebDriver //this works!!
(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
Thread.sleep(15000);
new WebDriverWait(driver, 30).until(
ExpectedConditions.presenceOfElementLocated(
By.xpath("//*[contains(#text, 'Tan')]")));
NPE was thrown as soon as the app was first loaded. I think this is an internal Appium problem.

Responding to client with error "An unknown server-side error occurred while processing the command"

Can anyone explain what is the error in this????
Responding to client with error: {"status":13,"value":{"message":"An unknown server-side error occurred while processing the command.","origValue":"Coordinate [x=800.0, y=619.0] is outside of element rect: [0,0][800,1205]"},"sessionId":"d19ce74a-bc57-4b86-bac4-0a63c9471c0b"}
info: <-- POST /wd/hub/session/d19ce74a-bc57-4b86-bac4-0a63c9471c0b/touch/perform 500 16.024 ms - 242
info: [debug] [BOOTSTRAP] [debug] Display bounds: [0,0][800,1205]
info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":13,"value":"Coordinate [x=800.0, y=619.0] is outside of element rect: [0,0][800,1205]"}

error: cannot bind to socket: Address already in use

I run appium script parallel on 39 emulators, some times appium throw exception while creating the appium session for few emulator(3 or 4 out of 39 emulator). please find the following error for more details.
I'm using Appium 1.4.14 and Ubuntu 14.04 LTS.
**Error details:**
2015-11-27 17:29:21:492 - info: [debug] Using fast reset? true
2015-11-27 17:29:21:492 - info: [debug] Preparing device for session
2015-11-27 17:29:21:493 - info: [debug] Not checking whether app is present since we are assuming it's already on the device
2015-11-27 17:29:21:494 - info: Retrieving device
2015-11-27 17:29:21:495 - info: [debug] Trying to find a connected android device
2015-11-27 17:29:21:496 - info: [debug] Getting connected devices...
2015-11-27 17:29:21:501 - info: [debug] executing cmd: /home/user/Android/Sdk/platform-tools/adb devices
2015-11-27 17:29:21:530 - info: [debug] 39 device(s) connected
2015-11-27 17:29:21:531 - info: Found device emulator-5590
2015-11-27 17:29:21:531 - info: [debug] Setting device id to emulator-5590
2015-11-27 17:29:21:532 - info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
2015-11-27 17:29:21:533 - info: [debug] executing cmd: /home/user/Android/Sdk/platform-tools/adb -s emulator-5590 wait-for-device
2015-11-27 17:29:21:555 - info: [debug] executing cmd: /home/user/Android/Sdk/platform-tools/adb -s emulator-5590 shell "echo 'ready'"
2015-11-27 17:29:21:620 - info: [debug] Starting logcat capture
2015-11-27 17:29:21:712 - info: [debug] Getting device API level
2015-11-27 17:29:21:713 - info: [debug] executing cmd: /home/user/Android/Sdk/platform-tools/adb -s emulator-5590 shell "getprop ro.build.version.sdk"
2015-11-27 17:29:21:833 - info: [debug] Device is at API Level 19
2015-11-27 17:29:21:834 - info: Device API level is: 19
2015-11-27 17:29:21:835 - info: [debug] Extracting strings for language: default
2015-11-27 17:29:21:836 - info: [debug] Apk doesn't exist locally
2015-11-27 17:29:21:836 - info: [debug] Could not get strings, but it looks like we had an old strings file anyway, so ignoring
2015-11-27 17:29:21:837 - info: [debug] executing cmd: /home/user/Android/Sdk/platform-tools/adb -s emulator-5590 shell "rm -rf /data/local/tmp/strings.json"
2015-11-27 17:29:22:135 - info: [debug] Not uninstalling app since server not started with --full-reset
2015-11-27 17:29:22:137 - info: [debug] Skipping install since we launched with a package instead of an app path
2015-11-27 17:29:22:138 - info: [debug] Forwarding system:37036 to device:4724
2015-11-27 17:29:22:140 - info: [debug] executing cmd: /home/user/Android/Sdk/platform-tools/adb -s emulator-5590 forward tcp:37036 tcp:4724
2015-11-27 17:29:22:164 - info: [debug] Stopping logcat capture
2015-11-27 17:29:22:167 - info: [debug] Logcat terminated with code null, signal SIGTERM
2015-11-27 17:29:22:168 - info: [debug] Sent shutdown command, waiting for UiAutomator to stop...
2015-11-27 17:29:29:173 - warn: UiAutomator did not shut down fast enough, calling it gone
2015-11-27 17:29:29:174 - info: [debug] Cleaning up android objects
2015-11-27 17:29:29:177 - info: [debug] Cleaning up appium session
2015-11-27 17:29:29:180 - error: Failed to start an Appium session, err was: Error: Command failed: /bin/sh -c /home/user/Android/Sdk/platform-tools/adb -s emulator-5590 forward tcp:37036 tcp:4724
error: cannot bind to socket: Address already in use
error: cannot bind to socket: Address already in use
2015-11-27 17:29:29:193 - info: [debug] Error: Command failed: /bin/sh -c /home/user/Android/Sdk/platform-tools/adb -s emulator-5590 forward tcp:37036 tcp:4724
error: cannot bind to socket: Address already in use
error: cannot bind to socket: Address already in use
at ChildProcess.exithandler (child_process.js:203:12)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:818:16)
at Socket.<anonymous> (internal/child_process.js:319:11)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at Pipe._onclose (net.js:469:12)
2015-11-27 17:29:29:195 - info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Command failed: /bin/sh -c /home/user/Android/Sdk/platform-tools/adb -s emulator-5590 forward tcp:37036 tcp:4724\nerror: cannot bind to socket: Address already in use\nerror: cannot bind to socket: Address already in use\n)","killed":false,"code":1,"signal":null,"cmd":"/bin/sh -c /home/user/Android/Sdk/platform-tools/adb -s emulator-5590 forward tcp:37036 tcp:4724","origValue":"Command failed: /bin/sh -c /home/user/Android/Sdk/platform-tools/adb -s emulator-5590 forward tcp:37036 tcp:4724\nerror: cannot bind to socket: Address already in use\nerror: cannot bind to socket: Address already in use\n"},"sessionId":null}
2015-11-27 17:29:29:203 - info: <-- POST /wd/hub/session 500 7944.285 ms - 709
please help me fix this issue..
Thank you in advance for your support,
Tirupathi Rao

Log capture did not start in a reasonable amount of time - Error when trying to run iOS tests on a remote appium server - appium log attached

I am trying to run appium tests on iPhones using a remote appium server.
When I run the tests locally they pass but when I just send the remote server's ip and try to execute the test I get the following errors in my log:
info: Client User-Agent string: Apache-HttpClient/4.3.3 (java 1.5)
info: [debug] App is an iOS bundle, will attempt to run as pre-existing
info: [debug] Creating new appium session 87610d1a-b873-46e5-96b0-b54b412f10a0
info: [debug] Removing any remaining instruments sockets
info: [debug] Cleaned up instruments socket /tmp/instruments_sock
info: [debug] Setting Xcode folder
info: [debug] Setting Xcode version
info: [debug] Setting iOS SDK Version
info: [debug] Getting sdk version from xcrun with a timeout
info: [debug] iOS SDK Version set to 8.1
info: [debug] Not checking whether simulator is available since we're on a real device
info: [debug] Detecting automation tracetemplate
info: [debug] Not auto-detecting udid, running on sim
info: [debug] Could not parse plist file (as binary) at /usr/local/lib/node_modules/appium/com.viber.testing/en.lproj/Localizable.strings
info: Will try to parse the plist file as XML
info: [debug] Could not parse plist file (as XML) at /usr/local/lib/node_modules/appium/com.viber.testing/en.lproj/Localizable.strings
warn: Could not parse app Localizable.strings; assuming it doesn't exist
info: [debug] Creating instruments
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir: /Users/Desktop-QA/Library/Application Support/appium/bootstrap
info: [debug] Dynamic env: {"nodePath":"/usr/local/bin/node","commandProxyClientPath":"/usr/local/lib/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js","instrumentsSock":"/tmp/instruments_sock","interKeyDelay":null,"justLoopInfinitely":false,"autoAcceptAlerts":false,"sendKeyStrategy":"grouped"}
...o: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!
info: [debug] Dynamic bootstrap path: /Users/Desktop-QA/Library/Application Support/appium/bootstrap/bootstrap-d0f21a5b61bb08af.js
info: [debug] Reusing dynamic bootstrap: /Users/Desktop-QA/Library/Application Support/appium/bootstrap/bootstrap-d0f21a5b61bb08af.js
info: [debug] Getting device string from opts: {"forceIphone":false,"forceIpad":false,"xcodeVersion":"6.1.1","iOSSDKVersion":"8.1","deviceName":"none","platformVersion":"8.0.2"}
info: [debug] fixDevice is on
info: [debug] Final device string is: 'none (8.0.2 Simulator)'
info: [debug] Not setting device type since we're on a real device
info: [debug] Checking whether we need to set app preferences
info: [debug] Not setting iOS and app preferences since we're on a real device
info: [debug] Reset not set, not ending sim or cleaning up app state
info: [debug] Not setting locale because we're using a real device
info: [debug] No iOS / app preferences to set
info: [debug] Starting iOS device log capture via deviceconsole
error: Log capture did not start in a reasonable amount of time
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Log capture did not start in a reasonable amount of time
info: [debug] Error: Log capture did not start in a reasonable amount of time
at null.onTimeout (/usr/local/lib/nodemodules/appium/lib/devices/ios/ios-log.js:139:10)
at Timer.listOnTimeout as ontimeout
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Log capture did not start in a reasonable amount of time)","origValue":"Log capture did not start in a reasonable amount of time"},"sessionId":null}
info: <-- POST /wd/hub/session 500 11148.632 ms - 234
I tried newer devices ,cleaning the logs from the device and restarting it but all of these didn't help.
Any help will be more then welcome.
Thanks in advance!
A temporary solution for me was to run appium from source,replacing Deviceconsole with devicesyslog (the previous one) and now it works and i can get the logs from the device even when i am running on a remote appium with a remote device

Resources