Timeouts uploading bits to drop folder from on-prem build controller connected to VSO

Had an interesting case recently. Customer was using an on-prem build controller connected to VSO. His Team Project was backed by Git and he had a team build using the GitTemplate.12.xaml Build Template. Problem was the build definition was failing about 78% of the time. The build itself completed, but the final phase failed.  The error was:

Exception Message: The HTTP request timed out after 00:01:40. (type TimeoutException)
Exception Stack Trace: at Microsoft.TeamFoundation.Build.Workflow.Activities.FileContainerDropProvider.EndCopyDirectory(IAsyncResult result)
   at Microsoft.TeamFoundation.Build.Workflow.Activities.CopyDirectory.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
   at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
 
Inner Exception Details:
 
Exception Message: A task was canceled. (type TaskCanceledException)
Exception Stack Trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Microsoft.VisualStudio.Services.Common.VssHttpMessageHandler.<SendAsync>d__0.MoveNext()

 

- We tested building a simple Hello World VS project and that built 100% (no errors).
- The failing build had the “Copy build output to the server” option selected on the “Build defaults” tab. We changed this to both “Copy build output to the following drop folder“ and “This build does not copy output files to a drop folder” and the build succeeded in each case.

FIX:

Finally came to find a fix. In tfsbuildservicehost.exe.config* add the appSettings key of ServerDrop.MaxRequestTimeInSeconds with an int value for seconds. As an example add this... 

    <appSettings>
        <add key="ServerDrop.MaxRequestTimeInSeconds" value="300"/>
    </appSettings>

 

...and now the timeout is 5 minutes.

HTH,
Trevor

 

*C:\Program Files\Microsoft Team Foundation Server 12.0\Tools is where you’ll usually find tfsbuildservicehost.exe.config. You may need to turn on “FILE NAME EXTENSIONS” in File Explorer.

Comments

  • Anonymous
    May 25, 2014
    The comment has been removed

  • Anonymous
    June 09, 2014
    Great thanks, I also had the exact same problem!

  • Anonymous
    August 11, 2014
    Hi, I'm seeing this issue on the VSO Hosted build controller. Same exception message and setup (fairly close to the the default Azure website CI build configuration). Is there a way to modify this setting on VSO, or a configuration option. Happy to provide logs etc. My email address is my name @ my name dot net.

  • Anonymous
    August 11, 2014
    Thanks!!!! The same problem here using TFS Online! http://conube.com.br

  • Anonymous
    February 02, 2015
    Where in the file do I add this ? I gives an error when I try in the <configuration> part. Kind regards, Asser Fahrenholz