Appium 1.6.5 - XCUITest - Cannot read property 'on' of undefined

Hello,

We have a large suite of tests that run over night. At some point some of them fail with the following stacktrace:

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Cannot read property ‘on’ of undefined (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 15 milliseconds
Build info: version: ‘2.53.0’, revision: ‘35ae25b1534ae328c771e0856c93e187490ca824’, time: ‘2016-03-15 10:43:46’
System info: host: ‘myserver’, ip: ‘myip’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.12.4’, java.version: ‘1.8.0_91’
Driver info: io.appium.java_client.ios.IOSDriver
Capabilities [{app=SomeApp.app, networkConnectionEnabled=false, databaseEnabled=false, deviceName=iPhone 5s, platform=MAC, newCommandTimeout=300, platformVersion=9.3, webStorageEnabled=false, locationContextEnabled=false, automationName=XCUITest, browserName=, takesScreenshot=true, javascriptEnabled=true, platformName=iOS, udid=419974E6-A221-4AAA-AF9F-5289DFF5D143}]
Session ID: 08eaa650-21e8-48a2-b1a7-c732a5849b0d
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
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 io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:40)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:235)
at io.appium.java_client.AppiumDriver.launchApp(AppiumDriver.java:276)

We’re using Appium 1.6.5 and the tests are running on iOS 9.3 simulator. I will check to see if the same issue occurs for iOS 10.3 simulator as well.

Any indication on why this is happening? We haven’t encounter this issue on Appium 1.6.4.

Regards,
Cosmin