Bug 49110 - Suddenly unable to connect to the Mac
Summary: Suddenly unable to connect to the Mac
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: XMA ()
Version: 4.3.0 (C9)
Hardware: PC Windows
: --- normal
Target Milestone: 4.3.0 (C9)
Assignee: Kyle White
Depends on:
Reported: 2016-12-06 17:11 UTC by Kyle White
Modified: 2016-12-20 13:08 UTC (History)
3 users (show)

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

Zip logs last 7 days (586.43 KB, application/x-zip-compressed)
2016-12-06 17:11 UTC, Kyle White

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 Kyle White 2016-12-06 17:11:28 UTC
Created attachment 18793 [details]
Zip logs last 7 days

## Summary

I am working in cycle9 with many iOS projects and XMA was successfully connected and successfully reconnecting every time I closed/opened a project/Visual Studio. But suddenly, it stopped being able to connect. All I did was, close VS (which was successfully connected), open a new instance, and then it was no longer able to connect.

I have attached ZipLogs from last 7 days... it looks like:
- 2016-12-06_10-27-41.10804.Ide.log is from the last VS instance that was able to connect successfully
- 2016-12-06_10-33-07.10344.Ide.log is from the first instance that couldn't connect

## Version info

Microsoft Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01586

Xamarin (7c3dcf2)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android (72366f7)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS (d93ae7e)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 1 mag@xamarin.com 2016-12-06 19:23:27 UTC
Locally I can't reproduce the issue. It looks like an issue opening sockets against that specific Mac.
According to the logs, you are getting refused by the Mac when establishing the SSH connection:

System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it
   at Renci.SshNet.Abstractions.SocketAbstraction.Connect(IPEndPoint remoteEndpoint, TimeSpan connectTimeout)

If you are still experiencing this issue, I recommend the following to diagnose the problem better:

1 - To confirm any issue or overhead on the sshd instances, just check if there are any orphan sshd instances by running this terminal command (having no VS instance connected to the Mac): ps -A | grep sshd

2 - If you get this error connecting with VS consistently, try connecting with Putty to exactly the same address that VS is connecting to, and see if with Putty you can connect fine (this is to verify if the SSH deamon in the Mac is the one causing troubles or not)

3 - In case you can't connect with Putty, just restart the SSH daemon on the Mac (usually unchecking and checking again the Remote Login option under System Preferences > Sharing is enough)

Please let us know how the tests went.
Comment 2 Kyle White 2016-12-06 21:55:20 UTC
Hey, coincidentally just bumped into the issue again so I'm able to answer these questions..

1) no orphans, `ps -A | grep sshd` returns only `29318 ttys002 0:00.00 grep sshd`

2) Cannot connect with Putty - "Connection refused"

3) After restarting the daemon I was able to connect.
Comment 3 Jose Gallardo 2016-12-12 15:22:30 UTC
Hi Kyle,

This issue was caused by a hang/failure on the Mac OS SSH daemon, which seems unrelated to Xamarin VS / XMA.

I'll mark the bug as resolved - answered, however, if you find a pattern of XVS causing that issue in a consistent way, we can investigate further.