Bug 35971 - Mac Agent Not Working - Can't Connect
Summary: Mac Agent Not Working - Can't Connect
Status: RESOLVED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: XMA ()
Version: 4.0.0 (C6)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Adrian Alonso
URL:
Depends on:
Blocks:
 
Reported: 2015-11-18 00:12 UTC by Wednesday Wolf
Modified: 2016-12-22 17:34 UTC (History)
8 users (show)

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


Attachments
logfiles. (3.16 KB, application/x-zip-compressed)
2015-11-18 12:38 UTC, Wednesday Wolf
Details
Logfile - Post 4.0.0.1692 Update (3.24 KB, application/x-zip-compressed)
2015-11-20 16:02 UTC, Wednesday Wolf
Details
Logfile - Working Connection (11.51 KB, application/x-zip-compressed)
2015-12-01 04:05 UTC, Wednesday Wolf
Details
Logfile - not working connection (68.00 KB, text/plain)
2016-08-15 11:44 UTC, Holger
Details


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:
Status:
RESOLVED FIXED

Description Wednesday Wolf 2015-11-18 00:12:22 UTC
I updated everything to 4.0 today. I can see my Macbook using the Mac Agent - but when entering my credentials, the following error is given:

Couldn't connect to [Mac Name].local. Please try again

I have followed every step of the troubleshooting guide:
https://developer.xamarin.com/guides/ios/getting_started/installation/windows/xamarin-mac-agent/xma-troubleshooting/

Here is what I know:

- I am using the correct username, verified with whoami
- I am using the correct password 
- Mac Agent is using the correct IP address for my macbook
- I have updated every component, on each machine, to the latest release - they're all on the Stable channel
- Port 22 is open, as ensured by a custom rule in inbound/outbound for Windows Firewall
- I can ping my macbook
- I can ssh to my macbook, using port 22, using Putty

Odd things:

- Library/Caches/Xamarin/ does not exist

Logdump:

<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>0</EventID><Type>3</Type><SubType Name="Error">0</SubType><Level>2</Level><TimeCreated SystemTime="2015-11-18T04:01:51.8428822Z" /><Source Name="Xamarin.VisualStudio.IOS.Messaging.State.ServerStateContext" /><Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" /><Execution ProcessName="devenv" ProcessID="8052" ThreadID="77" /><Channel /><Computer>MOON</Computer></System><ApplicationData>Couldn't connect to Wednesdays-MacBook-Pro.local. Please try again.</ApplicationData></E2ETraceEvent>
Comment 1 Enzo Heredia 2015-11-18 11:53:16 UTC
can you please provide logs?

help-> Xamarin -> zip logs.


Thanks.
Comment 2 Jose Gallardo 2015-11-18 12:00:35 UTC
Also, we're aware of issues if your Windows username contains non-ascii characters (https://bugzilla.xamarin.com/show_bug.cgi?id=35859).
That issue was fixed and the patch will be public soon.

Can you please confirm if that's the case? In any case please attach the logs for further investigation.

Thanks!
Comment 3 Wednesday Wolf 2015-11-18 12:38:47 UTC
Created attachment 13873 [details]
logfiles.
Comment 4 Wednesday Wolf 2015-11-18 12:43:15 UTC
whoami for windows is moon/wednesday, all ascii characters. The Windows username/login credentials uses my email, also all ascii.

I'm on a Windows 10 machine attempting to connect to a OSX 10.11 machine. Logfiles have been attached.
Comment 5 Adrian Alonso 2015-11-18 12:55:34 UTC
Did you try to add the Mac by specifying the IP address explicitly? Open Xamarin Mac Agent -> Add Mac -> Enter the local IP Address (192.168.1.109?)
Comment 6 Wednesday Wolf 2015-11-18 13:01:26 UTC
Tried that, yes. And again just now, with the same error. Also tried changing the computer name to ensure XMA was updating that sort of information, which it is.
Comment 7 Brendan Zagaeski (Xamarin Team, assistant) 2015-11-18 19:56:57 UTC
A small observation in case it might be helpful:

In all 4 trials shown in the log files from comment 3, the "transition from SshConnectingState to DisconnectedState" message occurs exactly 10 seconds after the "transition from DisconnectedState to SshConnectingState" message.

## Edited excerpt from the log files in comment 3

>  [23:01:41] MacServer State transition from DisconnectedState to SshConnectingState on Wednesdays-MacBook-Pro.local (192.168.1.109)
>  [23:01:51] MacServer State transition from SshConnectingState to DisconnectedState on Wednesdays-MacBook-Pro.local (192.168.1.109)
>  [23:01:51] Couldn't connect to Wednesdays-MacBook-Pro.local. Please try again.
>  [23:01:51] Disconnected from Mac Wednesdays-MacBook-Pro.local (192.168.1.109)
> 
>  [23:11:50] MacServer State transition from DisconnectedState to SshConnectingState on Wednesdays-MacBook-Pro.local (192.168.1.109)
>  [23:12:00] Couldn't connect to Wednesdays-MacBook-Pro.local. Please try again.
>  [23:12:00] MacServer State transition from SshConnectingState to DisconnectedState on Wednesdays-MacBook-Pro.local (192.168.1.109)
>  [23:12:01] Disconnected from Mac Wednesdays-MacBook-Pro.local (192.168.1.109)
> 
>  [23:12:31] MacServer State transition from DisconnectedState to SshConnectingState on Wednesdays-MacBook-Pro.local (192.168.1.109)
>  [23:12:41] Couldn't connect to Wednesdays-MacBook-Pro.local. Please try again.
>  [23:12:41] MacServer State transition from SshConnectingState to DisconnectedState on Wednesdays-MacBook-Pro.local (192.168.1.109)
>  [23:12:42] Disconnected from Mac Wednesdays-MacBook-Pro.local (192.168.1.109)
> 
>  [23:24:14] MacServer State transition from DisconnectedState to SshConnectingState on Wednesdays-MacBook-Pro.local (192.168.1.109)
>  [23:24:24] Couldn't connect to Wednesdays-MacBook-Pro.local. Please try again.
>  [23:24:24] MacServer State transition from SshConnectingState to DisconnectedState on Wednesdays-MacBook-Pro.local (192.168.1.109)
>  [23:24:24] Disconnected from Mac Wednesdays-MacBook-Pro.local (192.168.1.109)




This reminds me of Bug 34932 (the log messages are separated by approximately 10 seconds in that case too), but from [1], it sounds like the customer already tested the `UseDNS no` workaround from Bug 34932 with no luck. Perhaps there are other similar conditions where `sshd` on the Mac will refuse the connection after 10 seconds?

> [1] http://forums.xamarin.com/discussion/comment/165759/#Comment_165759


## [NOT FROM THIS BUG] Edited excerpt from Bug 34932, purely for comparison

[01:10:59] MacServer State transition from DisconnectedState to SshConnectingState on XSU-39A.local (192.168.1.101)
[01:11:11] Couldn't connect to XSU-39A.local. Please try again.
[01:11:12] MacServer State transition from SshConnectingState to DisconnectedState on XSU-39A.local (192.168.1.101)
[01:11:12] Disconnected from Mac XSU-39A.local (192.168.1.101)



Brendan
Xamarin Customer Support
Comment 8 Brendan Zagaeski (Xamarin Team, assistant) 2015-11-18 20:17:58 UTC
> where `sshd` on the Mac will refuse the connection after 10 seconds

... or maybe some logic where XamarinVS automatically aborts if the connection takes longer than 10 seconds?
Comment 9 Wednesday Wolf 2015-11-19 17:38:30 UTC
Additional info:
I enabled the mac's firewall. The mac was able to recognise that a ssh connection was attempting to be established. It brought up the mono-sgen prompt. I allowed the connection, and the same error message occurred in Visual Studio.
Comment 11 Wednesday Wolf 2015-11-20 16:02:54 UTC
Created attachment 13922 [details]
Logfile - Post 4.0.0.1692 Update
Comment 12 Wednesday Wolf 2015-11-20 16:03:38 UTC
Can do - the logs are attached.
Comment 13 Adrian Alonso 2015-11-23 09:30:15 UTC
Thanks,

It seems that you're not being able to reach the Mac using SSH. Could please tell us if you're using Parallel and the network configuration?

You're also saying that you're able to connect to the Mac via ssh using a Putty client and execute some commands, right?

We have seen this behavior using a Bridge configuration with Parallels. But in that case, we're not able to connect with Putty either.

Adrian
Comment 14 Wednesday Wolf 2015-11-23 18:47:27 UTC
Adrian,

I'm not using Parallel - the machine I am attempting to connect to is just a off-the-shelf Macbook Pro. The machine I am trying to connect from is a Windows 10 device.

The network configuration is completely standard - Mac is wifi, PC is wired. The wifi is a WPA AES encryption, with WPA2-Personal security at 2.4 GHz and 5 GHz frequency. The router is ASUS RT-AC66U, if that's helpful at all. When trying to figure out a solution to the issue, I also enabled port forwarding on port 22 on the router.

I can connect to the Mac via Putty, and execute commands, yes.

And as I said - I am able to reach the Mac via SSH - when I enable the Mac firewall, and enter in my credentials for the Mac Agent in Visual Studio, it detects an incoming connection and brings up the mono-sgen prompt. It is something after that point that fails.
Comment 15 Wednesday Wolf 2015-12-01 04:05:45 UTC
Created attachment 14050 [details]
Logfile - Working Connection
Comment 16 Wednesday Wolf 2015-12-01 04:08:26 UTC
I managed to make the connection work - the logfile is attached.

What I changed:
- wired the macbook with a LAN cable, rather than connecting to the WiFi network
- manually entered in the IP (which shows on the XMA connected list as a distinct machine)


So it looks like the breakdown has something to do with the WiFi connection.
Comment 17 Holger 2016-08-15 11:40:53 UTC
I have the same issue. Was the bug solved?
Comment 18 Holger 2016-08-15 11:44:06 UTC
Created attachment 17026 [details]
Logfile - not working connection

I have added my log file.
I can connect to the Mac using git-bash.
Comment 19 Brendan Zagaeski (Xamarin Team, assistant) 2016-08-15 17:35:50 UTC
@Holger, I'd recommend filing your own new bug report.  The information in your log files looks somewhat different from the original logs on this older bug.

I'd recommend following all of the steps up through step 9 of the connection troubleshooting guide:
https://developer.xamarin.com/guides/ios/getting_started/installation/windows/connecting-to-mac/troubleshooting/

Do be sure to check each of the "Known Issues and Limitations" and then be sure to attach the verbose log files on the bug report as described in step 9.  Thanks in advance!
Comment 20 adrianknight89 2016-12-03 15:56:16 UTC
I have this issue as well. 

When I start VS and a window pops up to connect to a Xamarin Mac Agent, I cannot connect to the one that is found automatically. So, if the list of mac agents has something like:

myusername.local.
192.168.0.104

I cannot connect to it. The workaround seems to be adding an agent manually and typing in 192.168.0.104. This is happening not just in C9 but also older versions.

My PC is connected to the Internet through ethernet cable whereas the Mac is WiFi connected.
Comment 21 Bogdan Tepordei 2016-12-14 05:14:40 UTC
Ditto.

Similar configuration, the PC I'm trying to connect from is wired, MacBook wireless. I am able to remote ssh using the same user&credentials, however Connect to Mac throws a "couldn't connect, try again" message.

Would be happy to help investigate, you can reach me internally at MS
Comment 22 Bogdan Tepordei 2016-12-14 05:23:58 UTC
I managed to unblock myself so here's a potential solutions for others.

I was able to connect after deleting id_rsa and id_rsa.pub from %LOCALAPPDATA%\Xamarin\MonoTouch, instructions I found at the bottom of this page: https://support.macincloud.com/support/solutions/articles/8000040392-visual-studio-cannot-to-connect-to-xamarin-studio
Comment 23 Adrian Alonso 2016-12-22 17:34:20 UTC
Marking the bug as resolved since most of the issues are already fixed. Please fill another bug if you can't still connect. Thanks, Adrian