Bug 40007 - Xamarin iOS app build fails intermittently when large files are copied to the output directory
Summary: Xamarin iOS app build fails intermittently when large files are copied to the...
Status: RESOLVED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 4.0.0 (C6)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-03-31 00:42 UTC by Rich Zwaap
Modified: 2016-12-23 02:37 UTC (History)
6 users (show)

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


Attachments
Solution and Xamarin iOS app to reproduce the issue (7.50 KB, application/x-zip-compressed)
2016-03-31 00:42 UTC, Rich Zwaap
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:
RESOLVED FIXED

Description Rich Zwaap 2016-03-31 00:42:18 UTC
Created attachment 15565 [details]
Solution and Xamarin iOS app to reproduce the issue

When a Xamarin iOS app includes a large file that is set to copy to the output directory, the build intermittently fails with the error "The CopyFilesToBuildServer task failed unexpectedly."  To repro, open the attached solution and attempt to build it.  If the build succeeds, simply retry it - it should fail within two or three tries.

NOTE: The project contains a pre-build command that will create a 4GB file in the project directory.

Stack trace for the error:

Xamarin.Messaging.Exceptions.MessagingException: An error occured on client build7252rich5 while executing a post for topic xvs/Build/4.0.1.147/compare-items ---> 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__23`2.MoveNext() in C:\Users\builder\data\lanes\2972\1cc3a999\source\XamarinVS\src\Messaging\Xamarin.Messaging.Client\MessagingClient.cs:line 157
   --- End of inner exception stack trace ---
   at Xamarin.Messaging.Client.MessagingClient.<PostAsync>d__23`2.MoveNext() in C:\Users\builder\data\lanes\2972\1cc3a999\source\XamarinVS\src\Messaging\Xamarin.Messaging.Client\MessagingClient.cs:line 202
--- 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__22`2.MoveNext() in C:\Users\builder\data\lanes\2972\1cc3a999\source\XamarinVS\src\Messaging\Xamarin.Messaging.Client\MessagingClient.cs:line 0
--- 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__26`2.MoveNext() in C:\Users\builder\data\lanes\2972\1cc3a999\source\XamarinVS\src\Messaging\Xamarin.Messaging.Client\MessagingClient.cs:line 0
--- End of stack trace from previous location where exception was thrown ---
   at Xamarin.Messaging.Client.IMessagingClientExtensions.Execute[T](Func`1 postFunction) in C:\Users\builder\data\lanes\2972\1cc3a999\source\XamarinVS\src\Messaging\Xamarin.Messaging.Client\Extensions\IMessagingClientExtensions.cs:line 216
   at Xamarin.Messaging.Client.IMessagingClientExtensions.Post[TRequest,TResponse](IMessagingClient client, TRequest message, Boolean retain, Int32 timeoutSecs) in C:\Users\builder\data\lanes\2972\1cc3a999\source\XamarinVS\src\Messaging\Xamarin.Messaging.Client\Extensions\IMessagingClientExtensions.cs:line 170
   at Xamarin.VisualStudio.Build.BuildClient.CompareItems(IEnumerable`1 items) in C:\Users\builder\data\lanes\2972\1cc3a999\source\XamarinVS\src\MSBuild\Xamarin.VisualStudio.Build\BuildClient.cs:line 88
   at Xamarin.VisualStudio.Build.TaskRunner.FilterFilesThatShouldBeCopied(List`1 items) in C:\Users\builder\data\lanes\2972\1cc3a999\source\XamarinVS\src\MSBuild\Xamarin.VisualStudio.Build\TaskRunner.cs:line 233
   at Xamarin.VisualStudio.Build.TaskRunner.CopyRequiredInputFiles(Task task) in C:\Users\builder\data\lanes\2972\1cc3a999\source\XamarinVS\src\MSBuild\Xamarin.VisualStudio.Build\TaskRunner.cs:line 210
   at Xamarin.iOS.Tasks.CopyFilesToBuildServer.Execute() in C:\Users\builder\data\lanes\2972\1cc3a999\source\XamarinVS\src\MSBuild\Xamarin.iOS.Tasks\Tasks\CopyFilesToBuildServer.cs:line 18
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()	LargeFileCopyTestApp
Comment 1 Enzo Heredia 2016-04-07 19:19:05 UTC
Hi Rich,
can not reproduce using the attached solution, can you tell me about your configuration?

is it windows VM running on MAC or windows machine being connected to MAC using a network?
if second case, is it LAN? 

Thanks
Comment 2 Rich Zwaap 2016-05-24 15:44:53 UTC
This is with a VM running Windows 10 on a MacBook Pro with El Capitan.  I just tried with Xamarin for VS 4.0.4 and am still able to easily repro the issue.

We have seen identical behavior on several similarly configured machines.  We initially ran into this because we have large static libraries that need to be copied to the output directory on the Mac for linking against apps that consume them.  Before implementing a workaround that breaks apart the static libraries, everyone on our side that was working on this project was running into this frequently.
Comment 3 Jose Gallardo 2016-12-23 02:37:03 UTC
Hi,
As we've added several improvements to our build system and deploying/debugging mechanism since the bug was reported, I'm resolving it tentatively as Fixed.
That said, if you're still facing this issue with current bits, please feel free to reopen the bug.
Thanks