Getting session error when run appium with grid 4 on iOS farm

Hi,
I have automation with appium for Android and iOS, also have devices farm. I can locally run and it works, but when run with grid on remote machine it fails and not able to create session.

System info: os.name: ‘Mac OS X’, os.arch: ‘aarch64’, os.version: ‘15.5’, java.version: ‘21.0.6’, xcode: 16.4, iOS w18.3, appium 2.x+.

this is part of my connection_start.sh file

  cat <<EOF > "$appiumConfig"
server:
  port: $appiumPort
  default-capabilities:
    "appium:udid": "$device"
    "appium:deviceName": "$deviceName"
    "platformVersion" : "$version"
    "appium:automationName": "XCUITest"
    "appium:wdaLocalPort": $wdaLocalPort
    "appium:derivedDataPath": "/Users/$(id -un)/dev/WebDriverAgent/wdaBuild$((deriveDataPath))"
EOF
  echo "  Starting Appium server using $appiumConfig ..."
  appium --config "$appiumConfig" &> "/tmp/appium_${device}.log"```


this is my xcuioptions

         app = new File(APP_PATH, iosIpaName);
         System.out.println("app" + app.getAbsolutePath());
         iosOptions = new XCUITestOptions();
         iosOptions.setApp(app.getAbsolutePath());
         iosOptions.setBundleId(bundleId);
         iosOptions.setAppPushTimeout(Duration.ofMillis(300000));
         iosOptions.setIncludeDeviceCapsToSessionInfo(false);
         iosOptions.setShouldUseSingletonTestManager(false);
         iosOptions.setNoReset(true);
         iosOptions.setFullReset(false);
         iosOptions.setAppInstallStrategy("parallel");
         iosOptions.setUsePrebuiltWda(true);
         iosOptions.setNewCommandTimeout(Duration.ofSeconds(200));
         iosOptions.setAutoDismissAlerts(true);
         iosOptions.setAutoAcceptAlerts(false);
         serverLocation = appiumServerURL;


Installed new webDriveAgent and updated all corresponding applications but getting same

Full log please, would prefer it as a git gist.

Sorry this is private company repository and I cant provide it. This is jenkins job log failure
jenkins_log.txt (4.3 KB)
and this is device loges
appium_00008030-00196D593CF8C02E.log (9.3 KB)

No problem. Not much info to go on. My best guess would be that the server is somehow not getting instantiated before the client makes it’s request. Maybe some kind of timeout in your pipeline that guarantees that the server is up? Jenkins log has 0 information on server instantiation, just goes straight into, “can’t find server”, so that’s where I’d expect the problem to be.

The same functionality was working before and broke when one iOS device updated to 18.3.2. Nothing else was changed. Seems like it’s selenium grid not able to distribute as we tried with directly device appium url and its working. We also think that the webdriveragent install took to look and fails with timeout

@wreed maybe you have any other options?(

Oh, my apologies. I thought we had agreed on this:

Did you try a sleep/timeout? Here is some info to help if you haven’t:
https://stackoverflow.com/questions/13378185/possible-in-jenkins-to-add-sleep-time-between-build-actions

I set sleeping for 5 minutes after clearing webDriverAgent and reinstalling, but result is the same

14:52:12  14:45:05.702 [main] INFO am.config.ConfigUtils -- Getting property device.isSimulator: false
14:52:12  14:45:05.702 [main] INFO am.config.ConfigUtils -- Getting property branch.app.Build: master
14:52:12  14:45:05.702 [main] INFO am.config.ConfigUtils -- Getting property branch.automation.branch: master
14:52:12  14:45:05.703 [main] INFO am.config.ConfigUtils -- Getting property appium.remote.driver: true
14:52:12  14:45:05.703 [main] INFO am.config.ConfigUtils -- Getting property appium.url: http://192.168.116.5:4444

this is results from properties file where I build appium configs

Have you thought about adding tracing to Grid?

Full disclosure: I haven’t done this, but in your position I would certainly try.