Bug 36642 - [XVS 4.0] The .bashrc file in the user's home directory on the Mac can cause build host connection failures, and it shouldn't
Summary: [XVS 4.0] The .bashrc file in the user's home directory on the Mac can cause ...
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 4.0.0 (C6)
Hardware: PC Windows
: --- normal
Target Milestone: 4.1.0 (C7)
Assignee: Adrian Alonso
Depends on:
Reported: 2015-12-05 00:14 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2016-03-04 21:55 UTC (History)
6 users (show)

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

Log files and version info (12.48 KB, application/zip)
2015-12-05 00:14 UTC, Brendan Zagaeski (Xamarin Team, assistant)

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 Brendan Zagaeski (Xamarin Team, assistant) 2015-12-05 00:14:59 UTC
Created attachment 14131 [details]
Log files and version info

[XVS 4.0] The .bashrc file in the user's home directory on the Mac can cause build host connection failures, and it shouldn't

## Workaround

Move the `.bashrc` file to a backup location (or delete it if you know you don't need it) so that it is no longer present under "$HOME/.bashrc" on the Mac build host.

## Regressions status: new breakage caused by the SSH-based build host

## Steps to reproduce

1. Add a string to "$HOME/.bashrc" that does not match any existing command. For example, in my case I created a new file named ".bashrc" and added a single line containing the word "foo".

2. Attempt to pair Visual Studio to the Mac build host.

Note: in my case the `.bashrc` file isn't even mentioned in my `.profile` file, so the `.bashrc` file isn't even _loaded_ during a normal shell sesion via Terminal or SSH. I don't know how this file is managing to change the behavior of the SSH session when connecting via XamarinVS.

## Results

Visual Studio fails to connect to the Mac build host.

### Log files with an OS X 10.10 build host: no clues at all

None of the log files contain any clues. In particular, none of the files contain either the string ".bashrc" or the string "foo".

### Log files with an OS X 10.11 build host: key lines from Ide*.log

> Xamarin.Messaging.VisualStudio.MessagingService+UploadFileLogger Information: 0 : [2015-12-04 18:55:11.8239] Uploaded Broker 100%
> Xamarin.Messaging.VisualStudio.MessagingService Information: 0 : [2015-12-04 18:55:11.9809] Starting Broker in port 53131...
> Xamarin.Messaging.Client.Ssh.SshCommandRunner Warning: 0 : [2015-12-04 18:55:12.1419] Failed to execute 'ls /usr/bin/mono': ExitStatus=1
> Xamarin.Messaging.Client.Ssh.SshCommandRunner Warning: 0 : [2015-12-04 18:55:12.3248] /Users/macuser/.bashrc: line 1: foo: command not found
> ls: /usr/bin/mono: No such file or directory
> Xamarin.VisualStudio.IOS.Messaging.State.DisconnectedState Error: 0 : [2015-12-04 18:55:12.5338] Couldn't connect to XSU-39A-2.local. Please try again.

### Connection dialog error message

Couldn't connect to XSU-39A.local. Please try again.

### Contents of the "Output -> Xamarin" window 

> Installing Broker
> Uploading Broker (352/3495 KB) 10%...
> Uploading Broker (704/3495 KB) 20%...
> Uploading Broker (1056/3495 KB) 30%...
> Uploading Broker (1408/3495 KB) 40%...
> Uploading Broker (1760/3495 KB) 50%...
> Uploading Broker (2112/3495 KB) 60%...
> Disconnected from Mac XSU-39A.local (
> Uploading Broker (2448/3495 KB) 70%...
> Uploading Broker (2800/3495 KB) 80%...
> Uploading Broker (3152/3495 KB) 90%...
> Uploaded Broker 100%
> Starting Broker in port 58172...
> Couldn't connect to XSU-39A.local. Please try again.

## Expected results

Ideally, the `.bashrc` file should not be read by the SSH session _at all_. If that is not easily achievable, then at the least, errors that occur when reading the `.bashrc` file should be ignored for the purposes of establishing a connection with the build host.
Comment 5 xamarin-release-manager 2015-12-29 14:43:26 UTC
Fixed in version (xcode7.1)

Author: Adrian Alonso
Commit: 2a26166a3f058d1886bb7b494e56c748c3e8f987 (xamarin/XamarinVS)