Forum Visual Studio

Unable to activate the Mac - MacAgent

Hello,

Im having issues compiling my iOS project from Visual Studio 2013 Xamarin iOS 4.9.
My PC setup is as follows:

Mac OS X Yosemite (host) via Parallels running Windows 10 VM
The config is using a Shared Network connection.

Xamarin is unable to activate the Mac from witihin VS. I can SSH and establish actual connections
from the Windows VM to OS X.

NOTE
I have had a successful connection, however, if i shutdown the VM either by shutting down the host or suspending the VM i cannot regain a successful connection.

NOTE
mono-sgen has appropriate firewall rules applied to allow connections to it.

NOTE
I have followed this link to the tee, however, it does not solve my problem.
https://developer.xamarin.com/guides/ios/getting_started/installation/windows/xamarin-mac-agent/xma-troubleshooting/

Below is the VS console output for the Xamarin stream.

Starting Broker 4.0.0.1717 in port 54267...
SSH Connection established with the Mac 10.211.55.2:22:54267
Starting agents on Mac MacAgent.local (10.211.55.2)
Activating the Mac...
Unable to activate the Mac. See the logs for more details (Help->Xamarin->Open Logs...)
Failed to update iOS license: The request timed out
Disconnected from Mac MacAgent.local (10.211.55.2)

As you can see Xamarin makes a successful connection to the host. Thus the issue seems to stem from communication between Xamarin and the Broker. The logs aren't much help either. The output is below.

Xamarin Information: 0 : [2016-01-06 08:38:16.1394] Xamarin - 4.0.0.1717-cycle6-xcode7.2+1390b70
Xamarin.VisualStudio.Shell.XamarinShellPackage Information: 0 : [2016-01-06 08:38:17.2175] Initial entitlements: iOS Business 2016-07-17 06:09:36Z
Xamarin.VisualStudio.Shell.XamarinShellPackage Information: 0 : [2016-01-06 08:38:17.3270] Running license sync for iOS
Xamarin.VisualStudio.Shell.XamarinShellPackage Information: 0 : [2016-01-06 08:38:18.0144] Initial entitlements: Android Business 2016-07-17 06:09:36Z
Xamarin.VisualStudio.Shell.XamarinShellPackage Information: 0 : [2016-01-06 08:38:18.1552] Running license sync for Android
Xamarin.VisualStudio.Shell.XamarinShellPackage Information: 0 : [2016-01-06 08:38:22.9988] Updated license: Android Business 7/17/2016 6:09:36 AM
Xamarin.VisualStudio.Shell.XamarinShellPackage Information: 0 : [2016-01-06 08:38:23.1394] Updated license: iOS Business 7/17/2016 6:09:36 AM
Xamarin.VisualStudio.TastyPackage Information: 0 : [2016-01-06 08:38:24.3279] Hooked up SDB tracing adapter
Xamarin.VisualStudio.TastyPackage Information: 0 : [2016-01-06 08:38:24.4831] Initialization finished
Xamarin.VisualStudio.IOS.XamarinIOSPackage Warning: 0 : [2016-01-06 08:38:24.6394] Initializing Xamarin.VisualStudio.IOS.XamarinIOSPackage.
Xamarin.VisualStudio.IOS.XamarinIOSPackage Information: 0 : [2016-01-06 08:38:24.7959] MDAddinsHash: 83e91c86bddb2ffbe2451c8c21936dcf74982459

Xamarin.VisualStudio.IOS.Messaging.State.ServerStateContext Information: 0 : [2016-01-06 08:38:28.9832] MacServer State transition from DisconnectedState to SshConnectingState on MacAgent.local (10.211.55.2)
Xamarin.Messaging.VisualStudio.MessagingService Information: 0 : [2016-01-06 08:38:33.2239] Starting Broker 4.0.0.1717 in port 54267...
Xamarin.Messaging.VisualStudio.MessagingService Information: 0 : [2016-01-06 08:38:35.4110] SSH Connection established with the Mac 10.211.55.2:22:54267
Xamarin.Messaging.VisualStudio.MessagingService Information: 0 : [2016-01-06 08:38:35.6454] MacServer State transition from SshConnectingState to SshConnectedState on MacAgent.local (10.211.55.2)
Xamarin Information: 0 : [2016-01-06 08:38:35.7704] MacServer State transition from SshConnectedState to AgentsStartingState on MacAgent.local (10.211.55.2)
Xamarin.VisualStudio.IOS.Messaging.State.ServerStateContext Information: 0 : [2016-01-06 08:38:35.9266] Starting agents on Mac MacAgent.local (10.211.55.2)
Xamarin.VisualStudio.IOS.MacServer Information: 0 : [2016-01-06 08:38:36.1299] Activating the Mac...
Xamarin.Messaging.Client.MessagingClient Error: 0 : [2016-01-06 08:38:46.0214] An error occured on client vs5596Aiden while executing a post for topic xvs/Activation/4.0.0.1717/activate
System.TimeoutException: The operation has timed out.
   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.Messaging.Client.MessagingClient.<PostAsync>d__22.MoveNext()
Xamarin.Messaging.VisualStudio.MessagingService Error: 0 : [2016-01-06 08:38:46.2079] Unable to activate the Mac. See the logs for more details (Help->Xamarin->Open Logs...)
Xamarin.Messaging.Exceptions.MessagingException: An error occured on client vs5596Aiden while executing a post for topic xvs/Activation/4.0.0.1717/activate ---> System.TimeoutException: The operation has timed out.
   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.Messaging.Client.MessagingClient.<PostAsync>d__22.MoveNext()
   --- End of inner exception stack trace ---
   at Xamarin.Messaging.Client.MessagingClient.<PostAsync>d__22.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 Xamarin.Messaging.Client.MessagingClient.<PostAsync>d__12.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 Xamarin.Messaging.Client.MessagingClient.<PostAsync>d__52.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 Xamarin.VisualStudio.IOS.MacServer.<ActivateMacAsync>d__1.MoveNext() in C:\Users\builder\data\lanes\2599\1390b70a\source\XamarinVS\src\Core\VisualStudio.IOS\Messaging\MacServer.cs:line 405
Xamarin.VisualStudio.IOS.Messaging.State.ServerStateContext Information: 0 : [2016-01-06 08:38:46.5830] MacServer State transition from AgentsStartingState to DisconnectingState on MacAgent.local (10.211.55.2)
Xamarin.VisualStudio.IOS.LogHandler Warning: 0 : [2016-01-06 08:38:46.6924] Failed to update iOS license: The request timed out
Xamarin.VisualStudio.IOS.LogHandler Information: 0 : [2016-01-06 08:38:46.8173] The underlying client has been closed
Xamarin.VisualStudio.IOS.Messaging.State.ServerStateContext Information: 0 : [2016-01-06 08:38:46.9580] MacServer State transition from DisconnectingState to DisconnectedState on MacAgent.local (10.211.55.2)
Xamarin.VisualStudio.IOS.Messaging.State.ServerStateContext Information: 0 : [2016-01-06 08:38:47.0830] Disconnected from Mac MacAgent.local (10.211.55.2)

If I run the Broker directly from the terminal - i get the following. After a duration of time Broker.exe fails with the same output as the logs.

macagent:XMA aiden$ mono Broker/4.0.0.1717/Broker.exe
Xamarin Information: 0 : Xamarin - 4.0.0.1717-cycle6-xcode7.2+1390b70
Xamarin.Messaging.Broker.BrokerServer Information: 0 : Starting broker...
Xamarin.Messaging.Broker.BrokerAgent Information: 0 : Starting Agent: Broker 4.0.0.1717
Xamarin.Messaging.Broker.BrokerAgent Information: 0 : Broker 4.0.0.1717 agent started
COMPONENTS INFO: Initial entitlements: iOS Business 2016-07-17 08:09:36Z
Xamarin.Messaging.Activation.ActivationAgent Information: 0 : Starting Agent: Activation 4.0.0.1717
Xamarin.Messaging.Activation.ActivationAgent Information: 0 : Activation 4.0.0.1717 agent started
Initialized

Any help would be greatly appreciated

Regards

Aiden

Best Answer

Answers

  • AidenStrydomAidenStrydom USMember

    Hi Brendan

    I assumed that Activating the Mac implied establishing a connection between VS and the iOS build host, and thus activating the Mac ie. registering the instance of VS with it. That being said...

    My mac is behind a proxy (#ugh corporatism) so whenever the instance of VS tries to 'Activate the Mac' I guess it really is trying to activate the mac with Xamarin's activation server (as you implied).

    So if i disable my proxy before i attempt a connection to the build host, the connection to the Mac Build Host is successful.

    That being said, is there a reason none of Xamarin's software successfully reaches the Internet from behind a proxy?
    (not Xamarin Studio, nor Xamarin Updater, nor any of the Xamarin components)

    Regardless, thank you for the reply. Seems like there was nothing wrong with the actual MacAgent - just how network access is handled on OS X (?).

    Thanks

    Aiden

  • BrendanZagaeskiBrendanZagaeski USForum Administrator, Xamarin Team Xamurai

    is there a reason none of Xamarin's software successfully reaches the Internet from behind a proxy

    I know at least the Xamarin Studio activation process on Mac does support certain proxies. The most common type of proxy that I know does not work with that activation process are proxies that use PAC files.

    If you know that your proxy does not use PAC configuration files, and you would be able to provide additional details about the proxy server configuration, feel free to send in an email via "Business & Enterprise Support". The engineers are interested in improving the proxy support to cover more proxy configurations where possible.

  • guys true, I have found the problem.
    If your Visual studio has a open xamarin solution, then u are changing some proxy or network settings.
    the Mac agent doesn't get the latest settings.
    so answer is
    close VS 2013 or 2015, make the network / proxy changes in IE
    Open VS and open the Xamarin solution again..
    wao the mac agent works like a charm and auto connects to Mac

Sign In or Register to comment.