Bug 61156 - Random build crash with “The Build Agent is not running on the Mac”
Summary: Random build crash with “The Build Agent is not running on the Mac”
Status: NEW
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS (show other bugs)
Version: 4.8.0 (15.5)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2018-01-15 08:31 UTC by Alexandre Defalque
Modified: 2018-01-25 08:59 UTC (History)
4 users (show)

Tags: iOs MsBuild SayHello
Is this bug a regression?: Yes
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 61156 on Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.
Related Links:
Status:
NEW

Description Alexandre Defalque 2018-01-15 08:31:16 UTC
On our continuous integration environment (Windows server + Mac Mini), more than 30% of our Xamarin.Ios project build fails randomly.

Steps:
1. Have a MsBuild script with a target to build a solution containing a Xamarin iOs project like:
<Target Name="BuildIOS" Condition=" '$(SkipIOSBuild)' == 'false' ">

    <!-- Build iOS package (IPA) -->
    <MSBuild Projects="$(IOSProjectPath)" Targets="$(IOSMsbuildTargets)" Properties="$(IOSMsbuildProperties)" />

    ...
  </Target>

2. Script is launched periodically, typically on each commit (we're using CCNet for this)


Actual results:
Randomly we get the following message:
The Build Agent 'Build 4.8.0.753' is not running on the Mac. Please ensure that the assembly versions between the XMA Agents and the XMA clients matches. A compatible Build Agent is needed in order to finish the build.
Statistically, about 30% of our builds fails which is huge.

Expected results:
100% of the build shoud pass except if we have a real compilation error.

On the Mac build log, here is what we get:
Xamarin.Messaging.Build.BuildAgent: Information: 0: Stopping Agent: Build: 2018-01-09 10:12:44Z
System.Net.Mqtt.Sdk.MqttClientImpl: Error: 0: No session has been found for the client
at System.Net.Mqtt.Sdk.MqttClientImpl.CloseClientSession () [0x00098] in <65aadb65fa...>
at System.Net.Mqtt.Sdk.MqttClientImpl+d__34.MoveNext () [0x00035] in <65aadb65fa...>
System.Net.Mqtt.Sdk.MqttClientImpl: Information: 0: Client - Disposing. Reason: Error:

Extracted from the Windows build log:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Windows.After.targets(63,5): warning : Failed to execute 'which mono64': ExitStatus = 1
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Windows.After.targets(63,5): error : The Build Agent 'Build 4.8.0.753' is not running on the Mac. Please ensure that the assembly versions between the XMA Agents and the XMA clients matches. A compatible Build Agent is needed in order to finish the build.

Xamarin.iOS.Windows.After.targets line 63 runs the following MSBuild target:
<SayHello
SessionId="$(BuildSessionId)"
...>

So it looks like SayHello MSBuild task randomly fails even tough the connection to the Mac is alive and running.