Reputation: 1743
When I try to connect to the Mac Agent I get the following error: An unexpected error occurred while configuring SSH for the user [MY_USER] (full log below)
I've tried everything on the Troubleshooting page: https://developer.xamarin.com/guides/ios/getting_started/installation/windows/connecting-to-mac/troubleshooting/
Including "UseDNS no".
There are 3 Mac Minis on the network running Xamarin. We have another development machine that can connect to all 3 using the same credentials. From the Windows machine in question, I can ping the mac, I can SSH to it successfully using Putty and Git Bash. SSH seems to work fine. I've tried a different user account on the Windows machine (nothing) I've tried using the Mac from the list, entering the machine name manually, using the IP address. (nothing) The Mac has no firewall setup. I've tried disabling the firewall on the Windows machine. I can confirm, when I try to use bad credentials, Visual Studio will correctly alert me of that, but using the correct credentials gives me the "unexpected error". I am not sure what is different between the two machines.
I've restarted all machines involved multiple times. I've tried reinstalling Visual Studio on the Dev machine.
I am out of ideas.
Any help would be appreciated.
Full Log from Visual Studio:
Xamarin Information: 0 : [2016-06-13 18:19:35.0373] Xamarin - 4.1.0.530-cycle7-baseline+2e39740
Xamarin.VisualStudio.Activation.AccountManager Information: 0 : [2016-06-13 18:19:35.1813] VS2015 Professional
Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-06-13 18:19:35.2483] No license found for iOS
Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-06-13 18:19:35.3113] Running license sync for iOS
Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-06-13 18:19:35.3783] Not logged in, using iOS VSProfessional
Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-06-13 18:19:35.4803] No license found for Android
Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-06-13 18:19:35.6165] Running license sync for Android
Xamarin.VisualStudio.ActivationManager Information: 0 : [2016-06-13 18:19:35.7116] Not logged in, using Android VSProfessional
Xamarin.VisualStudio.IOS.MonoTouchDeviceSettings Verbose: 0 : [2016-06-13 18:21:35.3445] BeginEdit
Xamarin.VisualStudio.IOS.MonoTouchDeviceSettings Verbose: 0 : [2016-06-13 18:21:35.4495] EndEdit
Xamarin.VisualStudio.TastyPackage Information: 0 : [2016-06-13 18:21:35.5355] Hooked up SDB tracing adapter
Xamarin.VisualStudio.TastyPackage Information: 0 : [2016-06-13 18:21:35.6155] Initialization finished
Xamarin.VisualStudio.IOS.XamarinIOSPackage Warning: 0 : [2016-06-13 18:21:35.6975] Initializing Xamarin.VisualStudio.IOS.XamarinIOSPackage.
Xamarin.VisualStudio.IOS.XamarinIOSPackage Information: 0 : [2016-06-13 18:21:35.7815] MDAddinsHash: 33f406fa2dcf214012c78cb846585f062b2e1d24
Xamarin.VisualStudio.IOS.Messaging.State.ServerStateContext Information: 0 : [2016-06-13 18:21:56.2158] MacServer State transition from DisconnectedState to SshConnectingState on PLA-DEV-MAC03.local (MY.IP.ADDRESSS)
Xamarin.VisualStudio.IOS.Messaging.State.ServerStateContext Information: 0 : [2016-06-13 18:22:12.7090] MacServer State transition from SshConnectingState to DisconnectedState on PLA-DEV-MAC03.local (MY.IP.ADDRESSS)
Xamarin.VisualStudio.IOS.Messaging.State.ServerStateContext Error: 0 : [2016-06-13 18:22:12.8170] An unexpected error occurred while trying to log in. Please try again.
Xamarin.VisualStudio.IOS.Messaging.State.ServerStateContext Information: 0 : [2016-06-13 18:22:12.9140] Disconnected from Mac PLA-DEV-MAC03.local (MY.IP.ADDRESSS)
Xamarin.VisualStudio.IOS.Messaging.State.DisconnectedState Error: 0 : [2016-06-13 18:22:13.0160] An unexpected error occurred while configuring SSH for the user [MY_USER]
Xamarin.Messaging.Exceptions.MessagingException: An unexpected error occurred while configuring SSH for the user [MY_USER] ---> Renci.SshNet.Common.SshOperationTimeoutException: Session operation has timed out
at Renci.SshNet.Session.WaitOnHandle(WaitHandle waitHandle, TimeSpan timeout)
at Renci.SshNet.Session.WaitOnHandle(WaitHandle waitHandle)
at Renci.SshNet.KeyboardInteractiveAuthenticationMethod.Authenticate(Session session)
at Xamarin.Messaging.Client.Ssh.MessagingAuthenticationMethod.Authenticate(Session session)
at Renci.SshNet.AuthenticationMethod.Renci.SshNet.IAuthenticationMethod.Authenticate(ISession session)
at Renci.SshNet.ClientAuthentication.TryAuthenticate(ISession session, AuthenticationState authenticationState, ICollection`1 allowedAuthenticationMethods, SshAuthenticationException& authenticationException)
at Renci.SshNet.ClientAuthentication.Authenticate(IConnectionInfoInternal connectionInfo, ISession session)
at Renci.SshNet.ConnectionInfo.Authenticate(ISession session)
at Renci.SshNet.Session.Connect()
at Renci.SshNet.BaseClient.Connect()
at Xamarin.Messaging.Client.Ssh.SshMessagingConnection.ConnectSsh()
at Xamarin.Messaging.VisualStudio.MessagingService.<ConfigureHostAsync>d__70.MoveNext()
--- End of inner exception stack trace ---
at Xamarin.Messaging.VisualStudio.MessagingService.<ConfigureHostAsync>d__70.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Xamarin.VisualStudio.IOS.Messaging.State.DisconnectedState.<ConnectAsync>d__8.MoveNext() in C:\Users\builder\data\lanes\3345\2e397405\source\XamarinVS\src\Core\VisualStudio.IOS\Messaging\State\DisconnectedState.cs:line 64
Upvotes: 7
Views: 9532
Reputation: 347
The fix for me was to back-up and then delete the following files from %LOCALAPPDATA%\Xamarin\MonoTouch
.
After that, when I paired to my mac it asked me to reauthenticate and I no longer got the error.
Upvotes: 1
Reputation: 51
I killed Visual Studio on the mac and tried to pair and that did the trick.
Upvotes: -1
Reputation: 1751
I ran into this issue while developing ios app on xamarin. My wifi internet connection was lost so I switched to the internet on my phone and the error showed when trying to pair with my development mac. When my wifi internet came back on the error was gone and I could pair with my mac again. The root problem is that the original ip address entered on the mac needs to be changed if your host ip address changes.
Upvotes: 0
Reputation: 338
Make sure you are not connected to a VPN, if so, it will not be connected. I had similar issue.
Upvotes: 2
Reputation: 150
This solution worked in my environment when we had this issue. It's about 80% witchcraft, so bear with me. I'm assuming you've addressed all firewall concerns and can SSH from the windows machine in to the Mac, and that you've followed all troubleshooting guides from Xamarin
On the Mac, create a new user named 'rowdy', grant it administrator rights, and restart. When the Mac comes back up, log in to VNC on the Mac as the rowdy user and wait for all new user processes to end (don't worry about linking to an AppleID or any of the network storage). After the new user is logged in and the Mac is happy with it, attempt to connect from VS to the Mac.
You may want to note that in my case, other user names failed for unexplained reasons. Password complexity doesn't seem to have any bearing on results. I have no proposed root cause, I can just tell you what works and what fails. Users named "clint" and "dev04" both failed following this exact same process. If someone knows what the reason for this is, I'm curious.
Upvotes: 0
Reputation: 834
running mac build host under vmware
after SEVERAL retries i can eventually get it to connect and then it will survive a disconnect/connect as long as i don't reboot or otherwise reset the network interfaces.
it feels like a race condition kind of bug because it takes several login attempts before the same configuration finally successfully connects (i.e. without the dreaded timeout error)
i try many different things:
Upvotes: 1
Reputation: 2580
It worked for me after I entered IP Address manually in Add Mac in Xamarin Mac Agent Window (instead of using the default one with machine name).
Upvotes: 22