Bug 43927 - [XMA] Broken Initialization Timeout
Summary: [XMA] Broken Initialization Timeout
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: XMA ()
Version: 4.2.0 (C8)
Hardware: PC Mac OS
: High normal
Target Milestone: 4.3.0 (C9)
Assignee: Dominic N [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2016-08-31 23:12 UTC by Dominic N [MSFT]
Modified: 2016-09-29 18:10 UTC (History)
5 users (show)

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

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:
VERIFIED FIXED

Description Dominic N [MSFT] 2016-08-31 23:12:02 UTC
## Overview

User has been unable to connect to his Mac Build Host from XVS (using C8 4.2.0 bits) after it had previously been working. The first issue with error messages related to broker initialization timeout cropped up in 4.1.2.18 (stable build) and was not resolved after updating to the C8 beta build.

The user is able to successfully connect to the Mac using SSH. This bug is intended to track the information passing through an internal "Unable to connect Visual Studio to Mac Build machine" email and is being left public so that others in that thread may be able to view.

Mauro has already started analyzing this issue and has requested diagnostic logs (attached privately).


## Additional Information

We've asked the user to ensure the following:
- No XMA Broker zombie processes are running on the Mac at the time of connect ("PS -A | grep XMA" command on the Mac)
- No sshd orphan processes are running on the Mac at the time to connect  ("PS -A | grep sshd" command on the Mac)
- Kill any Broker or sshd orphan processes (if running) using "kill -9 <pid>"
 
Some additional workarounds were suggested while this is being looked into:
 
- With VS opened, forget and re add the Mac that you want to connect to (from the XMA Server selection dialog)

- Clean the SSH keys that VS uses to connect to the Mac (delete id_rsa, id_rsa.pub and passphrase.key files from %LOCALAPPDATA%\Xamarin\MonoTouch). This will force a credentials reentering and will generate a new SSH key pair.
- Try to run the Broker by hand with mono, to verify the initialization and any other error:
    - In the terminal, cd to: ~/Library/Caches/Xamarin/XMA/Broker/<version>
                - Execute: mono Broker.exe 55555 (55555 is just the port. You can put whatever you want there)
                - See the stdout and verify if it's initialized or thrown any error (you can also get the logs from ~/Library/Logs/Xamarin-xx)

- Try to run the Broker with launchctl, to verify the initialization and any other error:
    - In the terminal, cd to: /tmp/com.xamarin.**.broker
                - Execute: launchctl load -S Aqua app.plist
                - Verify that a Broker is running (do a "PS -A | grep XMA")
                - If not, check the logs at ~/Library/Logs/Xamarin-xx and also output.log at the current location (/tmp/com.xamarin.**.broker)

- Switch to alpha or beta channels to compare the behavior and see if the error persists (you can do some of the mentioned cleanup before switching)
Comment 2 mag@xamarin.com 2016-09-06 17:27:07 UTC
Some fixes and improvements were made around the issue in both master and cycle8 branches.

Commits:

master: cb7a35c107426ac32b709f4f4c593fa96e183651
cycle8: 7466c00eaec49516d6f62f0b001819fd712f3f39
Comment 5 Brendan Zagaeski (Xamarin Team, assistant) 2016-09-12 23:57:41 UTC
## Update for any users watching this bug

The candidate fixes from Comment 2 are included in the latest Beta channel [1] version XamarinVS 4.2.0.675 from September 8.

[1] https://developer.xamarin.com/recipes/cross-platform/ide/change_updates_channel/