Bug 50055 - Connection to Mac SSH Service Hangs
Summary: Connection to Mac SSH Service Hangs
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: XMA ()
Version: 4.3.0 (C9)
Hardware: PC Mac OS
: High major
Target Milestone: 15.3
Assignee: mag@xamarin.com
Depends on:
Reported: 2016-12-14 20:27 UTC by Jason Michas
Modified: 2017-06-23 10:56 UTC (History)
8 users (show)

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

Log Files (3.07 KB, application/zip)
2016-12-16 18:27 UTC, Jason Michas
XMA connections and re-connections IDE log file (6.65 KB, application/octet-stream)
2017-06-23 10:55 UTC, Tanmay Bhattacharjee

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 Jason Michas 2016-12-14 20:27:45 UTC
Occasionally I find that the Mac services have disconnected from Visual Studio and when I try to reconnect I can't because the dialog window is stuff with the progress wheel next to the Mac server address. Attempts to disconnect don't work, also attempts to connect to any other mac don't work because the process seems stuck trying to reconnect. Not sure if this is a known issue or not.

I am running VS 2015 with all the latest patches, Xam 4.3.x latest alpha on windows 10 on a Mac using Parallels under Mac OS 10.11.6 (el capitan).

Originally I thought this might only occur if my machine went to sleep but I just had it happen when it definitely did not sleep.

Oh, the only solution seems to be to quit VS and restart it. Maybe there is another work around? I don't know how to make the "connection process" quit.
Comment 1 Jason Michas 2016-12-16 05:18:23 UTC
Here is the xamarin log from the VS output window after this has occurred.

Starting connection to Mac
Installing Broker
Uploading Broker (720/7058 KB) 10%...
Uploading Broker (1424/7058 KB) 20%...
Uploading Broker (2128/7058 KB) 30%...
Uploading Broker (2832/7058 KB) 40%...
Uploading Broker (3536/7058 KB) 50%...
Uploading Broker (4240/7058 KB) 60%...
Uploading Broker (4944/7058 KB) 70%...
Uploading Broker (5648/7058 KB) 80%...
Uploading Broker (6368/7058 KB) 90%...
Uploaded Broker 100%
Starting Broker in port 59856...
Connection successfully established with the Mac
Starting agents on Mac (
Installing Agent IDB
Installing Agent Build
Uploading IDB (2384/23727 KB) 10%...
Uploading Build (992/9783 KB) 10%...
Uploading Build (1968/9783 KB) 20%...
Uploading Build (2944/9783 KB) 30%...
Uploading IDB (4752/23727 KB) 20%...
Uploading Build (3920/9783 KB) 40%...
Uploading Build (4896/9783 KB) 50%...
Uploading IDB (7120/23727 KB) 30%...
Uploading Build (5872/9783 KB) 60%...
Uploading Build (6864/9783 KB) 70%...
Uploading Build (7840/9783 KB) 80%...
Uploading IDB (9504/23727 KB) 40%...
Uploading Build (8816/9783 KB) 90%...
Uploaded Build 100%
Uploading IDB (11872/23727 KB) 50%...
Uploading IDB (14240/23727 KB) 60%...
Uploading IDB (16624/23727 KB) 70%...
Uploading IDB (18992/23727 KB) 80%...
Uploading IDB (21360/23727 KB) 90%...
Uploaded IDB 100%
Installing Agent Designer
Uploading Designer (21600/215874 KB) 10%...
Uploading Designer (43184/215874 KB) 20%...
Starting Agent Build
Uploading Designer (64768/215874 KB) 30%...
Starting Agent IDB
Uploading Designer (86352/215874 KB) 40%...
Uploading Designer (107952/215874 KB) 50%...
Agent Build is running
Uploading Designer (129536/215874 KB) 60%...
Uploading Designer (151120/215874 KB) 70%...
Uploading Designer (172704/215874 KB) 80%...
Uploading Designer (194288/215874 KB) 90%...
Uploaded Designer 100%
Agent IDB is running
Starting Agent Designer
Agent Designer is running
Connected to the Mac ( with Full support.
Disconnected from the Mac (
The underlying client has been disconnected by the remote host
Starting reconnection...
Starting connection to Mac
Disconnected from the Mac (
Starting connection to Mac
Starting Broker in port 55856...

Seems to be hanging on Broker starting, so the progress wheel just spins.
Comment 2 Ben Beckley 2016-12-16 17:42:53 UTC
Hello Jason,

Thank you for using the alpha channel and taking the time to file the issues that you come across. To get a better understanding _why_ the broker startup is hanging, could you please upload the Xamarin logs?

You can get these from "Help>Xamarin>Zip Logs".
Comment 3 Jason Michas 2016-12-16 18:27:37 UTC
Created attachment 18912 [details]
Log Files
Comment 4 Ben Beckley 2016-12-16 18:30:50 UTC
Thank you for the logs. Changing status back to NEW.
Comment 5 Jose Gallardo 2016-12-19 11:31:09 UTC
Hi Jason,

Unfortunately, the logs are not complete. The SSH issue is also making the process not able to copy the log files from the Mac successfully.

The error I see in your IDE logs is:
Xamarin.Messaging.Exceptions.MessagingException: Unable to connect to the Mac in order to execute the SSH command

It seems like our extension fails executing a basic SSH SCP command from that connection to retrieve the logs. Which might be pointing to an issue on the SSH infrastructure itself.

Please let me ask you for two more things:

1) Can you connect to your Mac from the Parallels VM with SSH using an external Windows client (like PuTTY), and try to copy the same log files using SCP over that SSH connection? If you see the same issue in this test, then it's something on your setup, probably on how the Mac SSH daemon is configured. But, if you can consistently copy those files with SCP without issues, then it can be something on our extension making the SSH connection to stop working, and we would need to ask you for some additional info to diagnostic that case.
2) In case there is something useful on the missing Mac log files, can you please attach the content of the following Mac folder (as the automatic process cannot do it by SSH)?


Thank you again!
Comment 6 Jason Michas 2016-12-21 21:50:35 UTC

I can SSH from Putty without an issue. I doubt that it is a config error on my Mac side because nothing has changed in a long time and it has always worked with the VS integration.

Can you give me the command to SCP the log files? I'm not well versed in SCP so rather than fumble around it would help to have something to cut and paste.

Comment 7 Jose Gallardo 2016-12-23 21:02:37 UTC
Hi Jason,

You will need Putty and PSCP.exe which might be not as simple if you're not that familiar with it. Probably you can just send us the logs from (2) in my comment 5, and hopefully that would give us enough information to get some progress.

Thanks again!
Comment 8 Jason Michas 2016-12-24 00:28:42 UTC
No, I have both installed and I was able to SSH via Putty to the Mac, but I could not SCP the files but maybe because of my lack of knowledge with SCP. I tried and was able to copy the files to another location on the Mac (by accident), seems I can't copy them to the windows machine but I don't know why. I tried something like scp -r user@x.x.x.x:~/Library/Logs/Xamarin-4.3 /Users/jmichas/desktop/xamarin-logs but it didn't copy them to the windows machine, it used the /User/jmichas path and made a directory on my Mac with the copied files in it.

How do I tell SCP to copy them to the local machine that SCP is running on?
Comment 9 Jose Gallardo 2016-12-26 15:11:53 UTC
Hi Jason, 

We were discussing about this issue, and it seems like the root cause is the reconnection mechanism itself.
I'm retargeting the issue to Cycle 10, where Mauro will be investigating it deeply.

If you can still share those Mac logs (no need to use SSH for that, you can just go to the Mac and zip them directly there) that would be helpful.

Comment 10 xamarin-release-manager 2017-03-21 16:34:47 UTC
Fixed in version (master)

Author: Mauro Agnoletti
Commit: 9d7a6faaac258c73517ad5e662532f165590a7ff (xamarin/XamarinVS)
Comment 11 Tanmay Bhattacharjee 2017-06-23 10:55:44 UTC
Created attachment 23076 [details]
XMA connections and re-connections IDE log file

Verified on 
Comment 12 Tanmay Bhattacharjee 2017-06-23 10:56:23 UTC
marking it verified fixed