Bug 27805 - Certain storyboards lead to "The connection was closed unexpectedly" build server disconnect during IBToolTask
Summary: Certain storyboards lead to "The connection was closed unexpectedly" build se...
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 3.9
Hardware: PC Windows
: High critical
Target Milestone: 3.11
Assignee: mag@xamarin.com
URL:
Depends on:
Blocks:
 
Reported: 2015-03-09 20:17 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2015-04-08 05:51 UTC (History)
11 users (show)

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


Attachments
Log files (37.45 KB, application/zip)
2015-03-09 20:17 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Details
Reduced testcase (4.84 KB, application/octet-stream)
2015-03-16 11:22 UTC, Alan McGovern
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) 2015-03-09 20:17:43 UTC
Created attachment 10234 [details]
Log files

Certain storyboards lead to "The connection was closed unexpectedly" build server disconnect during IBToolTask


The storyboards in the attached test case appear to reproduce the primary problem on bug 25551 (build server disconnect) quite consistently both on my machine and on the original customer's machine. Hopefully this "lucky" test case will be helpful for the investigation of bug 25551. I am filing the bug separately (a) to create a clean stating point based on this new simple test case, and (b) because this might in fact be a slightly different problem than bug 25551.



## Regression status: regression between XVS 3.8.150 (10cfd17) + XI 8.4.0.43 (840a925) and XVS 3.9.347 + XI 8.6.3.3

Failures using 3.9.347: 6/6

Failures using 3.8.150: 0/6



## Steps to reproduce

1. Delete the build cache (`~/Library/Caches/Xamarin/mtbs/builds`) on the Mac build host (just in case there might be any conflicting files left over from other projects).

2. Open the attached test case in Visual Studio.

3. Ensure Visual Studio is connected to the build host.

4. Build the project in the "Debug|iPhoneSimulator" configuration.



## Results

The build fails during the IBToolTask because the connection to the build host is "closed unexpectedly."

Unlike my previous attempts to reproduce bug 25551, I was able to hit the error _every_ time when using this particular test case (I tried at least 6 times).


### Excerpt from the diagnostic build output (from "Trial2" in the attached logs files)

>   Copying Info.plist... (TaskId:11)
>   Copying MainStoryboard.storyboard... (TaskId:11)
>   Copying MainStoryboardIPad.storyboard... (TaskId:11)
>   IBToolTask: 2015-03-09T19:18:02.8415507-04:00 - Serializing intputs (TaskId:11)
>   IBToolTask: 2015-03-09T19:18:02.8593921-04:00 - Executing (TaskId:11)
>   Executing task: Xamarin.MacDev.Tasks.IBToolTask (TaskId:11)
>   Server returned an error. The underlying connection was closed: The connection was closed unexpectedly.
>    (TaskId:11)
>   Remote task execution failed. (TaskId:11)
>   IBToolTask: 2015-03-09T19:18:23.3406931-04:00 - Finished (TaskId:11)
> Done executing task "IBToolTask" -- FAILED. (TaskId:11)


### Excerpt from the devenv*.log file (from "Trial2" in the attached logs files)

> Xamarin.VisualStudio.IOS.XamarinIOSPackage Information: 0 : [2015-03-09 19:18:21.7] [09-Mar-2015 19:18:21] Request handled in 2.307ms
> Xamarin.VisualStudio.IOS.XamarinIOSPackage Information: 0 : [2015-03-09 19:18:22.2] [09-Mar-2015 19:18:21] Request handled in 2.345ms
> Xamarin.VisualStudio.IOS.Utilities.BuildServer Error: 0 : [2015-03-09 19:18:25.2] Build server control connection failed
> Xamarin.VisualStudio.IOS.Utilities.BuildServer Error: 0 : [2015-03-09 19:18:25.4] Server 192.168.209.1 returned no data. Hanging up.)
> Xamarin.VisualStudio.IOS.BuildHostEvents Information: 0 : [2015-03-09 19:18:26.2] The build host has been disconnected
> Xamarin.VisualStudio.IOS.BuildHost Information: 0 : [2015-03-09 19:18:26.7] Trying to connect to the build server 1/20
> Xamarin.VisualStudio.IOS.Utilities.BuildServer Error: 0 : [2015-03-09 19:18:26.9] Error establishing connection to Xamarin.iOS build server
> Xamarin.VisualStudio.IOS.Utilities.BuildServer Error: 0 : [2015-03-09 19:18:27.2] Exception caught.
> Xamarin.VisualStudio.IOS.MonoTouchDeviceProvider Error: 0 : [2015-03-09 19:18:27.4] Server returned an error. Unable to connect to the remote server
> 
> Xamarin.VisualStudio.IOS.Utilities.BuildServer Error: 0 : [2015-03-09 19:18:27.9] Exception caught.
> Xamarin.VisualStudio.IOS.MonoTouchDeviceProvider Error: 0 : [2015-03-09 19:18:28.2] Server returned an error. Unable to connect to the remote server
> 
> Xamarin.VisualStudio.IOS.BuildHost Information: 0 : [2015-03-09 19:18:28.5] Trying to connect to the build server 2/20



## Additional notes

- "Trial1" apparently fails during the _second_ `ibtool` command, while "Trial2" fails during the _first_ `ibtool` command.

- Simplifying the storyboards seems to reduce the chances of hitting the problem. For example, after I deleted all of the view controllers except for the root view controller in the "Ipad" storyboard, I was able to build the app successfully (at least the one time I tried it).

- As seen in `Trial1/BuildHostLogs/ClassicSingleViewUniversal1_2ccc65d07d2df39fc7024ff4bdf3ad2e.log`, the iPhone storyboard is compiled first, and it emits several warnings. Perhaps these warnings contribute to the problem.
> Warning: Prototype table cells must have reuse identifiers
> Warning: Prototype table cells must have reuse identifiers
> Warning: Prototype table cells must have reuse identifiers
> Warning: Prototype table cells must have reuse identifiers
> Warning: Prototype table cells must have reuse identifiers
> Warning: Scene is unreachable due to lack of entry points and does not have an identifier for runtime access via -instantiateViewControllerWithIdentifier:.
> Warning: Prototype table cells must have reuse identifiers



## Version info

### Windows 8.1 64-bit, in VMWare Fusion 6.0.5 (2209127)
Microsoft Visual Studio Professional 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.51641

Xamarin   3.9.347.0 (056cf9e)
Xamarin.Android   4.20.0.37 (9e05e39f02bafe8fc0b7ab025d99f3b446835ad4)
Xamarin.iOS   8.6.3.0 (90e32d01b5960ef8487d3b0a865cb3301dfd95f4)


### OS X 10.9.5, MacBook Air
Xamarin.iOS 8.6.3.3 (Business Edition)
Hash: 90e32d0
Build date: 2015-03-06 12:27:17-0500

Xcode 6.1.1 (6611), Build 6A2008a
Comment 4 Rustam Zaitov 2015-04-02 09:46:50 UTC
I am able to reproduce it too.
About VS https://gist.github.com/rzaitov/fb5ad43ff37e3ce5c2cb
Build Host: Xamarin.iOS 8.10.0.190 | 3.11.0.257
Comment 8 Arpit Jha 2015-04-08 05:51:49 UTC
I have checked this issue with XVS 3.11.321.0 + XI 8.10.0.216  and now application build successfully without any error in build output.

Screencast: http://www.screencast.com/t/CXSE7uMtuc

Environment Info: 
Xamarin.iOS : 8.10.0.216 
Build Host: 3.11.0.257
Microsoft Visual Studio Professional 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.5.50938

Installed Version: Professional
Xamarin   3.11.321.0 (38e8a0a)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   5.1.0.103 (eef156866db6c74c02013938103258b739709bfc)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.Forms Intellisense   1.0
Provides intellisense for Xamarin.Forms in the XML editor.

Xamarin.iOS   8.10.0.0 (3abf86b113ef9dd7c6aaf53c4c47bdb39ae526b9)
Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.iOS Unified Migration   1.0
Automated migration for Xamarin iOS Classic projects to Unified

Xamarin.TestCloud.Integration   1.0
Early preview of Xamarin Test Cloud integration