Device farm (iOS) run failure - Unable to start WebDriverAgent session because of xcodebuild failure

0

Our device farm runs just suddenly stopped working overnight since Aug 25 (thursday) (Without us changing any line of code in our automation project / anywhere else) Before this date all our runs were working, and since that we get errors for iOS only.

Any help would be welcome if something change and we should align our tests or it's an amazon DF issue

This is the errormessage we get: ( I replaced the name of our app here)

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: An unknown server-side error occurred while processing the command. Original error: Unable to start WebDriverAgent session because of xcodebuild failure: A new session could not be created. Details: Cannot launch io.{replaced_app_name} application. Make sure the correct bundle identifier has been provided in capabilities and check the device log for possible crash report occurrences Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device. 

Since we did not change any code and it broke overnight it feels to me that it's not an issue on our side, however i cant even find a way how to check or verify this. (Of course locally it works) However this part of the logs seems fishy as it does not really contain any capabilities besides iOS:

Host info: host: 'ip-192-168-11-5.us-west-2.compute.internal', ip: 'fe80:0:0:0:87f:fbd3:cc7d:7555%en0'
Build info: version: '4.8.3', revision: 'e5e76298c3'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.16', java.version: '12.0.2'
Driver info: io.appium.java_client.ios.IOSDriver
Command: [null, newSession {capabilities=[{platformName=IOS}], desiredCapabilities=Capabilities {platformName: IOS}}]
Capabilities {platformName: IOS}

We use Appium 2 and our testpec file for appium should already have the referenes for the capabilities The appium server also starts succesfully

phases:
  install:
    commands:
      - export NVM_DIR=$HOME/.nvm
      - . $NVM_DIR/nvm.sh
      - nvm install --lts

      - npm i -g appium@2.0.0-beta.71
      - appium -v
      - appium driver install xcuitest
  pre_test:
    commands:
      - echo "Start appium server"
      - >-
        appium --log-timestamp
        --default-capabilities "{\"appium:usePrebuiltWDA\": true, \"appium:derivedDataPath\":\"$DEVICEFARM_WDA_DERIVED_DATA_PATH\",
        \"appium:deviceName\": \"$DEVICEFARM_DEVICE_NAME\", \"platformName\":\"$DEVICEFARM_DEVICE_PLATFORM_NAME\", \"appium:app\":\"$DEVICEFARM_APP_PATH\",
        \"appium:automationName\":\"XCUITest\", \"appium:udid\":\"$DEVICEFARM_DEVICE_UDID_FOR_APPIUM\", \"appium:platformVersion\":\"$DEVICEFARM_DEVICE_OS_VERSION\",
        \"appium:language\":\"en\"}"
        >> $DEVICEFARM_LOG_DIR/appiumlog.txt 2>&1 &

Update: After changing the predefined appium version, to the latest that was release 5 days ago (2.1.3) We experience the same issue

So far the only diff I found between the working/not working run logs is this line: The working one installed this version of xcutest:

Driver xcuitest@4.34.1 successfully installed

While the failing one has a higher version:

Driver xcuitest@4.35.0 successfully installed

Found a way to install specifix XCUITest driver via:

appium driver install xcuitest@4.34.1

After adding this command, we still see same xcodebuild failure

Other things I tried so far: Also tried to turn off the usePrebuiltWDA capability to false and make it build it's own that gives xcodebuild failure 65 as well (which is the config you should do locally for your webdriver )

When tried the useNewWDA capability then it runs into an error too

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: An unknown server-side error occurred while processing the command. Original error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65
xcodebuild error message:

2023-08-28 05:57:30.393 xcodebuild[1822:6499]  DVTDownloadable: Unexpected error attempting to parse downloadable from index: Error Domain=DVTDownloadableErrors Code=16 "Unable to read in downloadable data. See underlying errors for details."
Janos
asked 8 months ago618 views
1 Answer
0

So far nothing I tried have worked, But it seems that I found a workaround...

If I change the iOS device from the device pool to a different one, then there the tests are working again ( hence it could build the webdriverAgent against that new device )

Perhaps an original solution would be a proper way to delete and rebuild the WebdriverAgent on DF side once this happens ( I just could not find a solution that would work and do this).

For context, I've used an iPhone 13 with iOS 16.0.2 where this issue appeared, and changed to an iOS 16.6 device. Tests are green again

Janos
answered 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions