Encountered internal error running command: Error: appIdKey

Hi all. Need help. Running my tests for native iOS app, all was fine before the update to new java-client and latest server version 1.8.1. Now some tests are failing due to unknown server-side error. We have 40 tests and 20 random tests always failing because of this issue. Please help to figure out this situation.

org.openqa.selenium.WebDriverException:
An unknown server-side error occurred while processing the command. Original error: appIdKey (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: ‘3.12.0’, revision: ‘7c6e0b3’, time: ‘2018-05-08T14:04:26.12Z’
System info: host: ‘MacBook-Pro.local’, ', os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.13.5’, java.version: ‘1.8.0_112’
Driver info: io.appium.java_client.ios.IOSDriver
Capabilities {app: /Users/sergey/Downloads/Cen…, appiumVersion: 1.8.0, autoAcceptAlerts: true, automationName: XCUITest, avoidProxy: true, browserName: , clearSystemFiles: true, databaseEnabled: false, deviceName: iPhone 7, fullReset: false, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: false, newCommandTimeout: 3600, noReset: true, platform: MAC, platformName: MAC, platformVersion: 11.4, recordScreenshots: false, recordVideo: false, shouldUseSingletonTestManager: false, takesScreenshot: true, udid: 81E6F5CB-E3DB-412F-B99B-125…, unicodeKeyboard: true, useNewWDA: true, videoUploadOnPass: false, waitForQuiescence: false, wdaStartupRetryInterval: 1000, webStorageEnabled: false}
Session ID: 8689952f-2c39-4d67-8924-3c7e1d44f023

[W3C] Calling AppiumDriver.getSession() with args: [“8689952f-2c39-4d67-8924-3c7e1d44f023”]
[XCUITest] Executing command ‘getSession’
[JSONWP Proxy] Proxying [GET /] to [GET http://localhost:8100/session/B3CDC922-D364-48AE-A6B2-925118EE817D] with no body
[JSONWP Proxy] Got response with status 200: “{\n “value” : {\n “sessionId” : “B3CDC922-D364-48AE-A6B2-925118EE817D”,\n “capabilities” : {\n “device” : “iphone”,\n “browserName” : “appDEV”,\n “sdkVersion” : “11.4”,\n “CFBundleIdentifier” : “com.app.app-dev”\n }\n },\n “sessionId” : “B3CDC922-D364-48AE-A6B2-925118EE817D”,\n “status” : 0\n}”
[XCUITest] Merging WDA caps over Appium caps for session detail response
[JSONWP Proxy] Proxying [GET /wda/screen] to [GET http://localhost:8100/session/B3CDC922-D364-48AE-A6B2-925118EE817D/wda/screen] with no body
[JSONWP Proxy] Got response with status 200: “{\n “value” : {\n “statusBarSize” : {\n “width” : 375,\n “height” : 20\n },\n “scale” : 2\n },\n “sessionId” : “B3CDC922-D364-48AE-A6B2-925118EE817D”,\n “status” : 0\n}”
[JSONWP Proxy] Proxying [GET /wda/screen] to [GET http://localhost:8100/session/B3CDC922-D364-48AE-A6B2-925118EE817D/wda/screen] with no body
[JSONWP Proxy] Got response with status 200: “{\n “value” : {\n “statusBarSize” : {\n “width” : 375,\n “height” : 20\n },\n “scale” : 2\n },\n “sessionId” : “B3CDC922-D364-48AE-A6B2-925118EE817D”,\n “status” : 0\n}”
[RemoteDebugger] Executing ‘get_window_size’ atom in default context
[MJSONWP] Encountered internal error running command: Error: appIdKey
[MJSONWP] at RemoteDebugger.execute$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-remote-debugger/build/lib/remote-debugger.js:1456:19)
[MJSONWP] at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[MJSONWP] at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[MJSONWP] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[MJSONWP] at invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[MJSONWP] at enqueueResult (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:185:17)
[MJSONWP] at new Promise ()
[MJSONWP] at new F (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/core-js/library/modules/$.export.js:30:36)
[MJSONWP] at AsyncIterator.enqueue (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:184:12)
[MJSONWP] at AsyncIterator.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[MJSONWP] at Object.runtime.async (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:209:12)
[MJSONWP] at RemoteDebugger.execute (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-remote-debugger/build/lib/remote-debugger.js:1431:34)
[MJSONWP] at RemoteDebugger.executeAtom$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-remote-debugger/build/lib/remote-debugger.js:926:51)
[MJSONWP] at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[MJSONWP] at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[MJSONWP] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[MJSONWP] at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[MJSONWP] at
[HTTP] <-- GET /wd/hub/session/8689952f-2c39-4d67-8924-3c7e1d44f023 500 586 ms - 179
[HTTP]
[HTTP] --> POST /wd/hub/session/8689952f-2c39-4d67-8924-3c7e1d44f023/appium/app/close
[HTTP] {}
[W3C] Calling AppiumDriver.closeApp() with args: [“8689952f-2c39-4d67-8924-3c7e1d44f023”]
[XCUITest] Executing command ‘closeApp’