Xcode 11.x Build Service Error: Integration results could not be uploaded.

Hello folks,


since we've upgraded our Catalina build server to Xcode 11.x, one of our projects seems to build without any specific error, but then the bot bails out with this error message:


Build Service Error: Integration results could not be uploaded. Test attachments and integration logs may be unavailable.


As the message says, there are no other logs available which could give any more hints. Also no other build results are available (like IPA or Xcarchive). There also seems to be zero information available anywhere about what exactly causes this error or how it could be remedied, so we are stuck right now. Does anybody of you maybe have an idea about how to solve this error?


Cheers!

Accepted Reply

Replying to myself here:


tl;dr: Duplicate the problematic bot, delete the old one. Simple as that.


Long explaination:

Of course, right after sending off the above call for help, it struck me and I did some more investigations.

I found that it must be some permission issue with the bots artifacts directory over at /Library/Developer/XcodeServer/IntegrationAssets/ .. There you can actually find the logs, which Xcode claimed before would be not available 😐 And of course, in those logs you can find more hints about this issue. In my case, Xcode was not able to perform a mkdir call du to some permission issues with the bots assets directory.


So basically, the above error message means just that copying the artifacts failed for some reason. Knowing what to look for, you can also find in the systems log corresponding entries, where the Xcode build service performed a PUT request to the server, which failed to due the missing or wrong permissions.


Ok, so the upgrade of Xcode somehow screwed up the permissions of the artifact directory. Instead of fiddling with directory permissions, I figured just deleting the directory and let the Xcode bot recreate it would be the easiest way. And by duplicating the bot and deleting the old one in your Xcode client, you can do that even without touching a shell at all. Of course, if you still need older build artifacts, do not delete the old bot, but just deactivate it.



Hope this will also help others.



Cheers!

Replies

Replying to myself here:


tl;dr: Duplicate the problematic bot, delete the old one. Simple as that.


Long explaination:

Of course, right after sending off the above call for help, it struck me and I did some more investigations.

I found that it must be some permission issue with the bots artifacts directory over at /Library/Developer/XcodeServer/IntegrationAssets/ .. There you can actually find the logs, which Xcode claimed before would be not available 😐 And of course, in those logs you can find more hints about this issue. In my case, Xcode was not able to perform a mkdir call du to some permission issues with the bots assets directory.


So basically, the above error message means just that copying the artifacts failed for some reason. Knowing what to look for, you can also find in the systems log corresponding entries, where the Xcode build service performed a PUT request to the server, which failed to due the missing or wrong permissions.


Ok, so the upgrade of Xcode somehow screwed up the permissions of the artifact directory. Instead of fiddling with directory permissions, I figured just deleting the directory and let the Xcode bot recreate it would be the easiest way. And by duplicating the bot and deleting the old one in your Xcode client, you can do that even without touching a shell at all. Of course, if you still need older build artifacts, do not delete the old bot, but just deactivate it.



Hope this will also help others.



Cheers!

I'm seeing this problem after upgrading to Xcode12, but it is intermittent. Duplicating all my bots did not work. Looking in the logs, it seems to be a timeout (30 seconds) in the command to copy the integration assets.

I tried supressing the error in the build report, but the overall bot status still shows 'failed'. How can this be fixed? I'm pulling my hair out with frustration. I have post-build/test scripts that only run on 'bot success' and won't ever be called even though there are no build errors and all the tests pass.
I have not found that "duplicating the offending bot" works. I have a fresh install of Xcode 12.2 beta 2 (now 3) and deleted all bots and rebuilt them from scratch. Still see the issue with fresh bots, from time to time.

Also seeing strangely long build times that seem to stall on "uploading log files"... to itself? I guess? Which eventually completes, but it adds minutes to each integration run.

Also, seeing a weird issue with bots that are instructed to build an .xcarchive after unit tests just refusing to do the work. Nothing in the log, no errors, it just ignores the request to build an archive. Re-run the integration, sometimes twice, and magically Xcode agrees to do what I specified in the bot definition. After that, Xcode 12 seems consistent with providing me with archives

Highly annoying, these intermittent failures.
(Xcode 12.0.1 and 12.2 beta 3 on macOS 10.15.6, both versions of Xcode exhibit all of the above issues)

EDIT: Just noticed OP was referring to Xcode 11. Oddly enough, I never saw OP's issue on Xcode 11 even once, but I see it very often on Xcode 12