appium: [iOS-RealDevice] Uncaught Error: Failed to receive any data within the timeout: 5000 error in some environment

The problem

I cannot execute in iOS Real Devices after my upgrade to Appium 2 due to a 500 error creating /wd/hub/session. After a long time investigating (appium and xcuitest reinstall, different combinations of Signing Capabilities for WebDriverAgentRunner compilation, rebooting mac and iPhones) I don’t know what is going wrong her. This is my client side error

Environment

  • Appium v2.0.0-beta.25
  • xcuitest@3.62.0 (automationName ‘XCUITest’)
  • relaxed-caps@1.0.3 (ACTIVE)
  • execute-driver@1.0.1
  • XCode version: 13.2.1
  • macOS 12.1 (21C52)
  • iOS 15.3 and iOS14.2

Link to Appium logs

no_cached_connections

Code To Reproduce Issue [ Good To Have ]

Please remember that with sample code it’s easier to reproduce the bug and it’s much faster to fix it.

Please git clone https://github.com/appium/appium and from the sample-code directory, use one of your favourite languages and sample apps to reproduce the issue.

In case a similar scenario is missing in sample-code, please submit a PR with one of the sample apps provided.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 48 (17 by maintainers)

Most upvoted comments

I downgrade the node version to 16.15.1 and it’s working fine for me

I’ve upgrade my node and openssl versions to:

eve:.appium qacdo$ node
Welcome to Node.js v17.8.0.
Type ".help" for more information.
> process.versions
{
  node: '17.8.0',
  v8: '9.6.180.15-node.16',
  uv: '1.43.0',
  zlib: '1.2.11',
  brotli: '1.0.9',
  ares: '1.18.1',
  modules: '102',
  nghttp2: '1.47.0',
  napi: '8',
  llhttp: '6.0.4',
  openssl: '3.0.2+quic',
  cldr: '40.0',
  icu: '70.1',
  tz: '2021a3',
  unicode: '14.0',
  ngtcp2: '0.1.0-DEV',
  nghttp3: '0.1.0-DEV'
}

and it is working now 😄 😄

Thanks @mykola-mokhnach @douniwan5788  @KazuCocoa you are my heroes 💪

The root cause is not so clear (since as appium/appium-ios-device succeeded to send a command, but no response by probably iOS while it is a blackbox), so what I can suggest is:

  1. Find another device or host machine
  2. Avoid using lookupApplications (since so far, the method did not get a proper response)
    1. Start a session without app and bundleId
    2. Install the app under test with https://github.com/appium/appium-xcuitest-driver#mobile-installapp or http://appium.io/docs/en/commands/device/app/install-app/
    3. Activate the app https://appium.io/docs/en/commands/device/app/activate-app/

The 2) may work if the only method that cannot get the response is lookupApplications related, but not sure only it is.

So far, I guess it is iOS side stuff. Appium succeeded to send commands over usbmux, but no response in some cases.

For example, getOSVersion worked in your env as well. It means appium <–> iOS communication path worked. But some commands such as lookupApplications had no response by iOS.

If you’d try something, maybe reboot the device may help. (re-install tools such as libimobiledevice does not help)

No that issue is unrelated