Bug 59367 - Mac Connection Errors Since Latest Xamarin VS Updates
Summary: Mac Connection Errors Since Latest Xamarin VS Updates
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: XMA (show other bugs)
Version: 4.8.0 (15.5)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-09-09 00:49 UTC by Daniel
Modified: 2017-10-27 11:39 UTC (History)
12 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
zip logs (1.59 MB, application/x-zip-compressed)
2017-09-11 10:28 UTC, Daniel
Details
connection error screenshot (47.80 KB, image/png)
2017-09-11 22:43 UTC, Daniel
Details
Zip logs take directly after last connection error (1.59 MB, application/x-zip-compressed)
2017-09-11 22:44 UTC, Daniel
Details

Description Daniel 2017-09-09 00:49:56 UTC
Since updating to Xamarin 4.6.0, Xamarin.iOS 10.12.0.20 and Visual Studio 15.3.3, there have been build errors related to the Mac build server connection. Here are some example errors from the Output window:

Unable to connect to Mac Server with Address='Mac-mini.local.' and User='Me'. An active connection is required to perform the build

The client build27768OEM has been disconnected while waiting a post response to topic xvs/Build/4.6.0.299/execute-task/MyProject.iOS/bd2cf5a%2FCreateDebugSettings

When these errors happen, Visual Studio is still showing an active connection (i.e. the Xamarin Mac Agent icon is showing as Green in the connected state). The only way to build again is to restart Visual Studio.

These problems usually happen after a period of inactivity (i.e. no builds for about an hour or more). This only started happening after updating Xamarin and Visual Studio. Before that the connection might drop out about once a week but now it is happening every day.

Environment details (Windows):
Visual Studio - 15.3.3
Xamarin - 4.6.0.299 (b63523e27)
Xamarin.iOS and Xamarin.Mac SDK - 10.12.0.20 (80b8487)

Environment details (Mac build host):
Xamarin.iOS - 10.12


Thanks.
Comment 1 Michael Warnes 2017-09-09 14:39:02 UTC
this is a duplicate of the error seen in #39723

This has broken my build for a week now, and I am very concerned that I do not even have a work around
Comment 2 Michael Warnes 2017-09-09 14:42:08 UTC
have added prashant to email list
Comment 3 Michael Warnes 2017-09-09 15:48:43 UTC
@Daniel is your application a Xamarin.Forms app using a PCL?
Comment 4 Michael Warnes 2017-09-09 15:49:22 UTC
is your application a Xamarin.Forms app using a PCL?
Comment 5 Daniel 2017-09-09 22:13:20 UTC
@Micheal - Our app is Xamarin.iOS (native) and the project does reference a PCL. The same problem happens in two different projects of the same type.
Comment 7 Prashant [MSFT] 2017-09-11 05:25:58 UTC
@Daniel,

This bug sounds similar to the already reported bug #39723. I am investigating this issue right now.

Are you using VS 2015/2017?
Could you share the following details? It will help us to troubleshoot the issue

- Detailed reproduction steps
-Version information
Windows: Help → About Microsoft Visual Studio → Copy Info and
Mac: Visual Studio → About Visual Studio → Show Details → Copy Information [button]
- Logs (Help → Xamarin → Zip Logs (last 7 days))
Comment 8 Daniel 2017-09-11 10:28:30 UTC
Created attachment 24675 [details]
zip logs

zip logs as requested
Comment 9 Daniel 2017-09-11 10:32:50 UTC
Zip logs attached with previous comment.

The other info:

Windows:

Microsoft Visual Studio Community 2017 
Version 15.3.3
VisualStudio.15.Release/15.3.3+26730.12
Microsoft .NET Framework
Version 4.7.02046

Installed Version: Community

Visual Basic 2017   00369-60000-00001-AA268
Microsoft Visual Basic 2017

Visual C# 2017   00369-60000-00001-AA268
Microsoft Visual C# 2017

Visual F# 4.1   00369-60000-00001-AA268
Microsoft Visual F# 4.1

Application Insights Tools for Visual Studio Package   8.8.00712.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2017   15.0.30726.0
ASP.NET and Web Tools 2017

ASP.NET Core Razor Language Services   1.0
Provides languages services for ASP.NET Core Razor.

ASP.NET Template Engine 2017   15.0.30726.0
ASP.NET Template Engine 2017

ASP.NET Web Frameworks and Tools 2012   4.0.20601.0
For additional information, visit https://www.asp.net/

ASP.NET Web Frameworks and Tools 2017   5.2.50601.0
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   15.0.30728.0
Azure App Service Tools v3.0.0

Azure Data Lake Node   1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio   2.2.9000.1
Microsoft Azure Data Lake Tools for Visual Studio

Azure Data Lake Tools for Visual Studio   2.2.9000.1
Microsoft Azure Data Lake Tools for Visual Studio

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Fabric.DiagnosticEvents   1.0
Fabric Diagnostic Events

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript UWP Project System   2.0
JavaScript UWP Project System

JetBrains ReSharper Ultimate 2017.1.1    Build 108.0.20170407.122957
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2017 JetBrains, Inc.

Merq   1.1.17-rc (cba4571)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Microsoft Azure HDInsight Azure Node   2.2.9000.1
HDInsight Node under Azure Node

Microsoft Azure Hive Query Language Service   2.2.9000.1
Language service for Hive query

Microsoft Azure Service Fabric Tools for Visual Studio   1.7
Microsoft Azure Service Fabric Tools for Visual Studio

Microsoft Azure Stream Analytics Language Service   2.2.9000.1
Language service for Azure Stream Analytics

Microsoft Azure Stream Analytics Node   1.0
Azure Stream Analytics Node under Azure Node

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.50719.1

Microsoft Continuous Delivery Tools for Visual Studio   0.3
Simplifying the configuration of continuous build integration and continuous build delivery from within the Visual Studio IDE.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio   4.6.8-pre (ec7034f)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   4.3.1
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

SlowCheetah - XML config transforms   1.0
This package enables you to transform your app.config or any other XML file based on the build configuration. It also adds additional tooling to help you create XML transforms.

SQL Server Data Tools   15.1.61707.200
Microsoft SQL Server Data Tools

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript   2.3.4.0
TypeScript tools for Visual Studio

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for Universal Windows Apps   15.0.26730.08
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

WebJobs Tools v1.0.0   __RESXID_PRODUCTVERSION__
WebJobs Tools v1.0.0

Xamarin   4.6.0.299 (b63523e27)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android SDK   7.4.0.21 (2851083)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK   10.12.0.20 (80b8487)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.



Mac:

=== Visual Studio Community 2017 for Mac ===

Version 7.1 (build 1297)
Installation UUID: c26cc9cc-794e-413a-81d9-80d705056115
Runtime:
	Mono 5.2.0.215 (d15-3/da80840) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 502000215

=== NuGet ===

Version: 4.3.0.2418

=== .NET Core ===

Runtime: Not installed
SDK: Not installed
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.5.5
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 8.3.3 (12175.1)
Build 8E3004b

=== Xamarin.iOS ===

Version: 10.12.0.20 (Visual Studio Community)
Hash: 80b8487d
Branch: d15-3
Build date: 2017-08-18 16:07:26-0400

=== Xamarin.Mac ===

Version: 3.6.0.19 (Visual Studio Community)

=== Xamarin.Android ===

Version: 7.4.0.21 (Visual Studio Community)
Android SDK: /Users/danjackson/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)

SDK Tools Version: 24.4.1
SDK Platform Tools Version: 23.0.1
SDK Build Tools Version: 23.0.1

Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Inspector ===

Version: 1.2.2
Hash: b71b035
Branch: d15-1
Build date: Fri, 21 Apr 2017 17:57:12 GMT

=== Build Information ===

Release ID: 701001297
Git revision: 9c5299666538b2f8baf501418a5c064d784d64da
Build date: 2017-08-07 11:29:35-04
Xamarin addins: 3bb0c32a14f1b7e368bf5ac53a84c3581c019391
Build lane: monodevelop-lion-d15-3

=== Operating System ===

Mac OS X 10.12.6
Darwin 16.7.0 Darwin Kernel Version 16.7.0
    Thu Jun 15 17:36:27 PDT 2017
    root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64
Comment 11 Daniel 2017-09-11 22:43:29 UTC
Created attachment 24689 [details]
connection error screenshot

Ok, thanks for looking into this. The problem just happened again and like mentioned in my first post, this was after a period of inactivity (no builds for about 30 mins this time). Also, I had another instance of Visual Studio open earlier so perhaps that contributed to the problem. However The second instance was closed when the problem happened this time.

I have attached a screenshot from Visual Studio. You will see that despite there being a build error that says "Unable to connect to Mac", the green connection status icon still says that the connection is active. That in itself is a problem.

I will upload the zip logs soon.
Comment 12 Daniel 2017-09-11 22:44:30 UTC
Created attachment 24690 [details]
Zip logs take directly after last connection error
Comment 13 Daniel 2017-09-17 07:38:08 UTC
This problem still exists after updating to Visual Studio 15.3.4.

Full environment details after VS update:

Microsoft Visual Studio Community 2017 
Version 15.3.4
VisualStudio.15.Release/15.3.4+26730.15
Microsoft .NET Framework
Version 4.7.02046

Installed Version: Community

Visual Basic 2017   00369-60000-00001-AA268
Microsoft Visual Basic 2017

Visual C# 2017   00369-60000-00001-AA268
Microsoft Visual C# 2017

Visual F# 4.1   00369-60000-00001-AA268
Microsoft Visual F# 4.1

Application Insights Tools for Visual Studio Package   8.8.00712.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2017   15.0.30726.0
ASP.NET and Web Tools 2017

ASP.NET Core Razor Language Services   1.0
Provides languages services for ASP.NET Core Razor.

ASP.NET Template Engine 2017   15.0.30726.0
ASP.NET Template Engine 2017

ASP.NET Web Frameworks and Tools 2012   4.0.20601.0
For additional information, visit https://www.asp.net/

ASP.NET Web Frameworks and Tools 2017   5.2.50601.0
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   15.0.30728.0
Azure App Service Tools v3.0.0

Azure Data Lake Node   1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio   2.2.9000.1
Microsoft Azure Data Lake Tools for Visual Studio

Azure Data Lake Tools for Visual Studio   2.2.9000.1
Microsoft Azure Data Lake Tools for Visual Studio

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Fabric.DiagnosticEvents   1.0
Fabric Diagnostic Events

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript UWP Project System   2.0
JavaScript UWP Project System

JetBrains ReSharper Ultimate 2017.1.1    Build 108.0.20170407.122957
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2017 JetBrains, Inc.

Merq   1.1.17-rc (cba4571)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Microsoft Azure HDInsight Azure Node   2.2.9000.1
HDInsight Node under Azure Node

Microsoft Azure Hive Query Language Service   2.2.9000.1
Language service for Hive query

Microsoft Azure Service Fabric Tools for Visual Studio   1.7
Microsoft Azure Service Fabric Tools for Visual Studio

Microsoft Azure Stream Analytics Language Service   2.2.9000.1
Language service for Azure Stream Analytics

Microsoft Azure Stream Analytics Node   1.0
Azure Stream Analytics Node under Azure Node

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.50719.1

Microsoft Continuous Delivery Tools for Visual Studio   0.3
Simplifying the configuration of continuous build integration and continuous build delivery from within the Visual Studio IDE.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio   4.6.8-pre (ec7034f)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   4.3.1
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

SlowCheetah - XML config transforms   1.0
This package enables you to transform your app.config or any other XML file based on the build configuration. It also adds additional tooling to help you create XML transforms.

SQL Server Data Tools   15.1.61707.200
Microsoft SQL Server Data Tools

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript   2.3.4.0
TypeScript tools for Visual Studio

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for Universal Windows Apps   15.0.26730.08
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

WebJobs Tools v1.0.0   __RESXID_PRODUCTVERSION__
WebJobs Tools v1.0.0

Xamarin   4.6.3.4 (0841c2aaf)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android SDK   7.4.3.1 (18558b4)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK   10.12.3.3 (8a39106)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Comment 14 Pierce Boggan [MSFT] 2017-10-03 16:40:15 UTC
Information provided, moving back to NEW.
Comment 15 mag@xamarin.com 2017-10-18 16:49:13 UTC
Hi @Daniel,
Some clarifications related to your comments:

1 - "When these errors happen, Visual Studio is still showing an active connection (i.e. the Xamarin Mac Agent icon is showing as Green in the connected state)".

That's not a problem itself. The green icon that you see, together with the XMA Server selector dialog are part of the connection process that Visual Studio does to establish a connection against a Mac. If you connect through the UI and see the icon in green, that means that Visual Studio (devenv process) is successfully connected to the Mac.
What that doesn't mean is that also MSBuild, which is a different process from devenv, has also been connected successfully.

Each connection to the Mac represents an XMA client, so in the case of Visual Studio we have one client and in the case of MSBuild we have another client. The only client that has UI is VS, because it's the IDE. Also, the MSBuild connection is not established from the time you open VS, create the application or connects to the Mac in VS. It's established the first time is needed, which is the first time you build and iOS app.

2 - "Also, I had another instance of Visual Studio open earlier so perhaps that contributed to the problem"

Each VS instance and MSBuild instance that you launch establishes its own connection to the Mac to its own port. This means that two VS instances will have each one a different client and connection to the Mac, to different ports. The same happens for MSBuild, which will connect to the same port that the corresponding VS instance is connected.
This means that connecting to the Mac with more than one VS instance shouldn't affect the connection experience at all.



This is important for you to understand better how this works and to be able to detect which part is failing or having problems.

That said, from the next 15.5 release, we are introducing several fixes and changes around the XMA connection process, the reconnection mechanism against unexpected disconnections, build timeouts, better UI feedback when connecting with VS, better diagnostics and UI experience so far.

Based on those changes, the experience around disconnections because of periods of inactivity should improve because now we are able to re connect silently and successfully, so you shouldn't even notice that there was a disconnection for the most of the cases.
Also, you shouldn't experience more build timeouts randomly or because of building large iOS apps or with slow networks.
Finally, there will be no need to restart VS in order to get rid of connection or reconnection issues.

I recommend you to give it a try to the upcoming 15.5 previews and release and compare the experience to see if any of the reported issues still persists.
Also, if you find something not fixed yet, please feel free to re open this issue or open a new one with the details.

By now I mark the bug as Resolved for the 15.5 release.
Thanks

Note You need to log in before you can comment on or make changes to this bug.