Xcode Build Server failed. The devices configured for testing were not found
Asked Answered
C

2

13

Our Xcode Build Server fails and does not perform any tests anymore. Version 8.3 (8e162)

It simply fails with the Statement:

Build Service Issue

Error The devices configured for testing were not found.

enter image description here

When I do select "Fix it" one gets simply redirected to "Edit Bot" -> "Devices" in the bot's settings. Sometimes the iOS Device lists now loads way longer (~15seconds) than it used to be (immediately).

So, when the devices finally show up (if they even show up) and are selected, the following error prompt appears: Internal Error Updating Bot, please try configuring the bot again

The provided solutions here, was no issue for me, as I am logged in at the bot: xcode bots edit failed

Has anyone found

  1. a reason for this, why this error seams to suddenly occur
  2. a solution for this? Downgrading to an older xCode version is unfortunately no option for me as suggested here: https://forums.developer.apple.com/thread/76453 as I already got the version, to which the user downgraded.

Is something suddenly wrong with shared schemes or something or was misconfigured that might lead to the problem?

Before I do create the bot over again, I would really like to fix the bot, to keep the history of the builds etc.

Coniology answered 27/4, 2017 at 11:56 Comment(3)
I have the same issue with the following versions: macOS server: 5.3 (16S4123), Xcode: 8.3.2 (8E2002)Glaring
@Glaring I provided a link to forums.developer.apple.com where someone had the issue when upgrading from 8.3 to 8.3.2 - could a potential downgrade maybe fix the issue at least for you?Coniology
Unfortunately it turned out my MacMini had also hardware issues, which could be the root of the problem.Glaring
S
4

Found a solution provided by user @juce on github. Link to original response in Apple Developer Forum

Here' is a link to github post explained a details by @juke:

Copy of script:

--- deviceClass.js  2017-05-05 07:10:40.000000000 -0700
+++ deviceClass.js.NEW  2017-05-05 07:13:36.000000000 -0700
@@ -12,6 +12,7 @@
     dbCoreClass = require('./dbCoreClass.js'),
     xcsutil = require('../util/xcsutil.js'),
     logger = require('../util/logger.js'),
+    fs = require('fs'),
     redisClass = require('./redisClass.js');

 /* XCSDeviceClass object */
@@ -141,12 +142,11 @@
         query.endkey = [unitTestUUID, {}];
     }

-    redisClass.getDynamicQuery(req, doc_type, function DEVListRedisGetDynamicQuery(err, docs) {
-        if (err) {
-            opFailed(err);
-        } else if (docs) {
+    var devicesFile = '/Library/Developer/XcodeServer/Logs/xcs_devices.json';
+    fs.readFile(devicesFile, 'utf8', function (err,docs) {
+        if (docs) {
             docs = JSON.parse(docs);
-            log.info('Found', docs.length, 'devices in Redis.');
+            log.info('Found', docs.length, 'devices in file-system cache.');
             opSucceeded(docs);
         } else {
             log.debug('No devices found in Redis. Falling back to CouchDB.');
@@ -167,9 +167,12 @@
                 } else {
                     log.info('Found', docs.length, 'devices in CouchDB.');

-                    redisClass.setDynamicQuery(req, doc_type, JSON.stringify(docs), function DEVListRedisSetDynamicQuery(err, wasSaved) {
-                        if (wasSaved) {
-                            log.debug('Successfully cached devices to Redis.');
+                    fs.writeFile(devicesFile, JSON.stringify(docs), 'utf8', function(err) {
+                        if (err) {
+                            log.debug('Problem saving devices into ' + devicesFile);
+                        }
+                        else {
+                            log.debug('Successfully cached devices to file.');
                         }
                         // Even if there's an error (i.e. Redis suddenly went down), we can still continue since
                         // the next request would be redirected to CouchDB.

How to apply. Download or copy this script, and path existing file like this:

[sudo] cd /Library/Developer/XcodeServer/CurrentXcodeSymlink/Contents/Developer/usr/share/xcs/xcsd/classes
    patch deviceClass.js /path/to/xcs-tweaks/xcs-devices-patch.diff

Then restart the simulator and possibly restart your machine (that was my case). Then check if it's working by: sudo xcrun xcscontrol --list-simulators

Big thanks @juke whoever you are :)

Sheepcote answered 12/6, 2017 at 8:3 Comment(0)
M
0

My problem with this was that I had set up the bot on an earlier version of Xcode (with only 11.2 simulators installed).

I upgraded the version of Xcode on the machine I use to run bots, which only had 11.4 simulators installed. Changing the simulators to these latest versions fixed it.

Montanez answered 4/7, 2018 at 8:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.