Bug 51521 - Issues with too many macs in the mac agent
Summary: Issues with too many macs in the mac agent
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: XMA ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Ben Beckley
Depends on:
Reported: 2017-01-13 19:50 UTC by Chris McBride
Modified: 2017-06-21 18:31 UTC (History)
10 users (show)

Is this bug a regression?: ---
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 on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Chris McBride 2017-01-13 19:50:19 UTC
Doing a clean build of my Xamarin Forms project and trying to install it on the iPhone I would get a message that indicated the build on the mac was out of sync and please rebuild.
Looking at the logs I discovered:

/Users/admin/Library/Caches/Xamarin/mtbs/builds/.../obj/iPhone/Debug/build-signature/signature' was not found on the Mac.

As this was working a few days prior, with no changes, I wasn't sure what was wrong.
The one thing I did do was add a new remote mac, that I wasn't using.
My Xamarin Mac Agent listed 4 devices.
One was my mac mini.local that I was currently connected to
Two local ips for the mac mini (one was the same ip, another was a different ip)
Plus the new remote mac I added a couple days ago.

I deleted the three macs that I was not currently using, restart VS, and rebuilt and everything worked correctly.

It looks like there is something that is confused when there are multiple macs attached.
Comment 1 Joaquin Jares 2017-01-16 12:26:32 UTC
Assigning to mag for investigation.
Comment 2 mag@xamarin.com 2017-01-16 13:56:57 UTC
Hi Chris,

This is a typical message when you were building and working against one Mac, then you connect to another Mac and forgot to rebuild, but try to launch the App in the simulator or device.

Is there any chance that, without noticing it, you did the previous build or clean against another Mac? We connect automatically to known Macs, so that could happen if you previously added new Macs.

Remember that VS works exclusively against a Mac, since all the things we can do requires it. And the relation is always 1:1, in the terms that if of you want to switch to another Mac, you have to start over with the connection, build, etc.

The signature check that you see in the log is an integrity check that we do in order to ensure that the state of the app between your local copy in Windows and the connected Mac is the same. So we compute and hash the content of the built app, we save it locally and then we do the same on the Mac. Then, before each launch or build action, we check the two signatures (local and remote) to determine if the app is ok or needs to be rebuilt.

So, given that you didn't attach the logs and it's not clear how you did the connection switch, etc, I encourage you to do the following steps, to verify if the behavior is a bug or if it's by design:

Scenario 1:

1 - Open VS
2 - Connect to a specific Mac
3 - Create a new iOS App (or use whichever you want)
4 - Build, launch, etc
5 - Now with the same VS instance and App, connect to another Mac
6 - Try to launch or deploy the App

Expected: You should see the build signature check failure
Action: You should rebuild in order to copy the app to the new connected Mac and then launch again

Scenario 2:

1 - Open VS
2 - Connect to a specific Mac
3 - Create a new iOS App (or use whichever you want)
4 - Build, launch, etc
5 - Do a Clean of the App
6 - Now with the same VS instance and App, connect to another Mac
6 - Try to launch or deploy the App

Expected: You should not get the build signature error and instead the app should be built and deployed or launched

Please attach the logs if you get any unexpected behavior.
Comment 3 Chris McBride 2017-01-16 18:33:34 UTC
The steps I did to repro the issue:

Restart Visual Studio
Wait for a connection to the Mac
Do a clean build
Do a rebuild solution.

I did this a half dozen times, all with the same result. During this repro I never tried to connect to any other macs, just the one that was automatically connected. 

I hope in Scenario 2 you aren't suggesting I have to do a clean against the mac I built against in order to avoid problems?

Which logs do you need, the visual studio ide logs?
Comment 4 Ben Beckley 2017-01-17 19:27:52 UTC
Hi Chris,

The Xamarin logs should suffice. You can retrieve them by going to "Help > Xamarin > Zip Logs".
Comment 5 mag@xamarin.com 2017-05-29 18:43:16 UTC
It this issue still reproducible with latest XVS versions? Assigning to Ben for verification, since we didn't get the XVS logs for the particular case and we weren't able to correlate the Macs in the network with the build consistency check issue
Comment 6 Jose Gallardo 2017-06-01 12:38:25 UTC

Please attach:

1. Xamarin Logs as Ben asked
Go to the menu "Help - Xamarin - Zip Logs". Please attach that zip file to the bug report.
Please run that command being connected to the Mac, that way we'll get the Mac logs as well.

2. Environment information
Go to the menu "Help - About Microsoft Visual Studio" and press "Copy Info". Please paste that info into a Bugzilla comment.

3. Diagnostic Build Output
Go to the menu "Tools - Options" and from the left panel: "Projects And Solutions - Build And Run" and change "MSBuild Output Verbosity" to "Diagnostic", and then build the solution. Copy the Build Output from the Output window and share it (maybe in a gist or as a zip file).

Comment 7 Dionis Silva 2017-06-05 16:27:16 UTC
Working for me:
 Disabling lightweight solution load fixed this issue.
Comment 8 Jose Gallardo 2017-06-21 18:31:05 UTC
Thanks Dionis for the information.
Marking as resolved answered.