Bug 52264 - "Couldn't connect ... Please try again" due to "Failed to execute 'find ... '" when the "Login shell" aka the "UserShell" is set to `/bin/csh`, `fish`, or another shell that doesn't use `bash` syntax
Summary: "Couldn't connect ... Please try again" due to "Failed to execute 'find ... '...
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: XMA ()
Version: 4.3.0 (C9)
Hardware: PC Windows
: --- normal
Target Milestone: 15.1
Assignee: Brendan Zagaeski (Xamarin Team, assistant)
URL:
Depends on:
Blocks:
 
Reported: 2017-02-03 04:34 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2017-03-21 12:28 UTC (History)
5 users (show)

Tags: BZRC7SR1S1_C6SR4S1
Is this bug a regression?: Yes
Last known good build: Cycle 7 SR 1 (XamarinVS 4.1.2.18)


Attachments
Xamarin IDE log files from VS 2017 RC + Cycle 9 + csh (1.77 KB, application/zip)
2017-02-03 04:34 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Details
Attaching Logs and Screenshot generated during verification of defect (81.17 KB, application/zip)
2017-03-21 12:28 UTC, Prasad Raghorte
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:
VERIFIED FIXED

Description Brendan Zagaeski (Xamarin Team, assistant) 2017-02-03 04:34:50 UTC
Created attachment 19706 [details]
Xamarin IDE log files from VS 2017 RC + Cycle 9 + csh

"Couldn't connect ... Please try again" due to "Failed to execute 'find ... '" when the "Login shell" aka the "UserShell" is set to `/bin/csh`, `fish`, or another shell that doesn't use `bash` syntax

This is a follow-up to Bug 34585.




##  Regression status: regression between Cycle 6 SR 4 (XVS 4.0.4.4) and Cycle 7 SR 1 (XVS 4.1.2.18)


### VS 2017 RC, 15.0.26127.0 D15REL

> BAD:  XamarinVS 4.3.0.598 (95cf4d3) + Xamarin.iOS 10.4.0.97 (cycle9: 2bcf787)     + csh        , "Failed to execute 'find ...'" 
(Unfortunately I wasn't able to ensure the `fish` showed precisely the same error in the log file for this scenario due to an unrelated (and I believe already resolved) issue that XamarinVS stopped writing IDE logs after my initial test.)


### VS 2015, 14.0.25431.01 Update 3 

> BAD:  XamarinVS 4.3.0.609 (ae22b61) + Xamarin.iOS 10.4.0.97 (cycle9: 2bcf787)     + csh or fish, "Failed to execute 'find ...'"
> BAD:  XamarinVS 4.1.2.18  (fcbe082) + Xamarin.iOS 9.8.2.22  (cycle7-sr1: f37444a) + csh or fish, "Failed to execute 'grep ...'"
> GOOD: XamarinVS 4.0.4.4   (a9c7826) + Xamarin.iOS 9.6.2.4   (cycle6-xi: d8bedd0)  + csh or fish



## Steps to replicate

1. On the Mac, navigate to "System Preferences > Users & Groups".

2. Control-click the user name that you use to log in to the Mac from Visual Studio, and select "Advanced Options".

3. Under the "Login shell" drop-down menu, select "/bin/csh".  (Just for reference, note that this setting corresponds to the "UserShell" entry for the user in the "/Local/Default" Open Directory.  You can browse that directory with the "/System/Library/CoreServices/Applications/Directory Utility.app" app.)

4. Click OK to save the changes.

5. On Windows, open a Xamarin.iOS project in Visual Studio.

6. Attempt to connect to the Mac using the "Xamarin Mac Agent" connection dialog.




## BAD Results (with recent versions of XamarinVS)

### Error in the dialog

The connection fails.  The user is presented with the generic that matches the following format:

> Couldn't connect to MacBuildHost.local.. Please try again.


### Errors in the IDE log files

The log files from "Help > Xamarin > Zip Logs" reveal that the underlying problem is a syntax error for one of the remote shell commands that's being run over the SSH connection:

> Xamarin.Messaging.Ssh.SshCommandRunner|Warning|0|Failed to execute 'find "/Users/macuser/Library/Caches/Xamarin/XMA/Broker/4.3.0.598/" -type f | while read line ; do md5 -q "$line" ; done': ExitStatus = 1
> Xamarin.Messaging.Ssh.SshCommandRunner|Warning|0|while: Expression Syntax.
> line: Undefined variable.
> 
> Xamarin.Messaging.Ssh.XmaCommands|Error|0|An



## GOOD Results (with Cycle 6 Service Release 4, XamarinVS 4.0.4.4)

The connection succeeds, and all the agents start successfully.




## Testing environment info (brief)

US English locale, US Eastern time zone on both systems



### Mac

Xamarin.iOS 10.4.0.97 (cycle9: 2bcf787)
Mono 4.8.0 (mono-4.8.0-branch/084f912)

Mac OS 10.11.6

fish 2.4.0 (54360d8)
(https://github.com/fish-shell/fish-shell)



### Windows

Microsoft Visual Studio Enterprise 2017 RC
Version 15.0.26127.0 D15REL
Microsoft .NET Framework
Version 4.6.01586

XamarinVS 4.3.0.598 (95cf4d3)

Windows 10 (64-bit) Version 1607 (OS Build 14393.321)
Comment 2 mag@xamarin.com 2017-02-13 17:07:09 UTC
Brendan,

This issue is already fixed on master branch, from this commit of 9th January: 93ef4801c18d326cb3dc68b79a28802e6df3e216. Given that this bug is reported to be fixed from C9SR1, I mark this as Resolved.
Comment 3 Prasad Raghorte 2017-03-21 12:28:24 UTC
Created attachment 20510 [details]
Attaching Logs and Screenshot generated during verification of defect

Verified in following configuration


Microsoft Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01586

Installed Version: Enterprise

Architecture and Modeling Tools   00322-80000-00000-AA436
Microsoft Architecture and Modeling Tools
    
UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

LightSwitch for Visual Studio 2015   00322-80000-00000-AA436
Microsoft LightSwitch for Visual Studio 2015

Visual Basic 2015   00322-80000-00000-AA436
Microsoft Visual Basic 2015

Visual C# 2015   00322-80000-00000-AA436
Microsoft Visual C# 2015

Visual C++ 2015   00322-80000-00000-AA436
Microsoft Visual C++ 2015

Visual F# 2015   00322-80000-00000-AA436
Microsoft Visual F# 2015

Windows Phone SDK 8.0 - PLK   00322-80000-00000-AA436
Windows Phone SDK 8.0 - PLK

Application Insights Tools for Visual Studio Package   7.18.00214.2
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1 (Beta8)   14.1.11107.0
ASP.NET and Web Tools 2015.1 (Beta8)

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.40314.0
For additional information, visit http://www.asp.net/

Clang with Microsoft CodeGen   14.0.25516
Clang with Microsoft CodeGen

Common Azure Tools   1.8
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

GitHub.VisualStudio   2.2.0.8
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

KofePackagePackage Extension   1.0
KofePackagePackage Visual Studio Extension Detailed Info

Merq   1.1.14-alpha (21c13c9)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Mono Debugging for Visual Studio   Mono.Debugging.VisualStudio
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   3.4.4
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Office Developer Tools for Visual Studio 2015 ENU   14.0.23025
Microsoft Office Developer Tools for Visual Studio 2015 ENU

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

Python Tools for Visual Studio   2.2.50113.00
Python Tools for Visual Studio provides IntelliSense, projects, templates, Interactive windows, and other support for Python developers.

Python Tools for Visual Studio - Django Integration   2.2.50113.00
Provides templates and integration for the Django web framework.

Python Tools for Visual Studio - Profiling Support   2.2.50113.00
Profiling support for Python projects.

SQL Server Data Tools   14.0.60519.0
Microsoft SQL Server Data Tools

TypeScript   1.8.36.0
TypeScript tools for Visual Studio

Visual C++ for Cross Platform Mobile Development (Android)   14.0.25401.00
Visual C++ for Cross Platform Mobile Development (Android)

Visual C++ for Cross Platform Mobile Development (iOS)   14.0.25401.00
Visual C++ for Cross Platform Mobile Development (iOS)

Visual Studio Tools for Apache Cordova   Update 10
Visual Studio Tools for Apache Cordova

Visual Studio Tools for Universal Windows Apps   14.0.25527.01
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

Workflow Manager Tools 1.0   1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin   4.4.0.6 (eeb1b63)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   7.2.0.6 (b8e3884)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   10.8.0.26 (0e9e791)
Visual Studio extension to enable development for Xamarin.iOS.