3
votes

Background: Had builds working for the past three months. Then, after getting failures I figured out the license was not valid for the Visual Studio install on our in house build server.

Steps to correct: Fixed license issue. Along with installing all VS Updates and TFS Update 2.

Additional steps taken to correct the issue: Builds were still failing so I deleted the agent and the build pool. Recreated a new pool and downloaded the agent. Installed the agent on the server, using my network credentials as I'm an admin on the box and part of the agent pool admin and agent pool service account. Used my account to try an eliminate permission related issues.

Note: Everything else works with TFS. Can check in changes, can use the portal with full admin rights. Here is the final entry in the logs

19:39:28.762991 Failed to start the job, could not create the http client with the given credentials.

The builds fail under a minute with no logs or reason on the tfs http interface.

Here are the only exceptions on the build server logs.

19:39:18.411788 Microsoft.VisualStudio.Services.WebApi.VssServiceResponseException: Bad Request

19:39:18.411788 at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponse(HttpResponseMessage response)

19:39:18.411788 at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.d__79.MoveNext()

19:39:18.411788 --- End of stack trace from previous location where exception was thrown ---

19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

19:39:18.411788 at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.d__76`1.MoveNext()

19:39:18.411788 --- End of stack trace from previous location where exception was thrown ---

19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

19:39:18.411788 at Microsoft.VisualStudio.Services.Location.Client.LocationHttpClient.d__6.MoveNext()

19:39:18.411788 --- End of stack trace from previous location where exception was thrown ---

19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

19:39:18.411788 at Microsoft.VisualStudio.Services.Client.VssServerDataProvider.d__39.MoveNext()

19:39:18.411788 --- End of stack trace from previous location where exception was thrown ---

19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

19:39:18.411788 at Microsoft.TeamFoundation.DistributedTask.Agent.Common.ConnectionHelper.GetConnection(Uri serverUri, VssCredentials credentials)

19:39:18.411788 at Microsoft.TeamFoundation.DistributedTask.Agent.JobWriter.StartJob() 19:39:18.411788 at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponse(HttpResponseMessage response)

19:39:18.411788 at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.d__79.MoveNext()

19:39:18.411788 --- End of stack trace from previous location where exception was thrown ---

19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

19:39:18.411788 at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.d__76`1.MoveNext()

19:39:18.411788 --- End of stack trace from previous location where exception was thrown ---

19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

19:39:18.411788 at Microsoft.VisualStudio.Services.Location.Client.LocationHttpClient.d__6.MoveNext()

19:39:18.411788 --- End of stack trace from previous location where exception was thrown ---

19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

19:39:18.411788 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

19:39:18.427410 at Microsoft.VisualStudio.Services.Client.VssServerDataProvider.d__39.MoveNext()

19:39:18.427410 --- End of stack trace from previous location where exception was thrown ---

19:39:18.427410 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

19:39:18.427410 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

19:39:18.427410 at Microsoft.TeamFoundation.DistributedTask.Agent.Common.ConnectionHelper.GetConnection(Uri serverUri, VssCredentials credentials)

19:39:18.427410 at Microsoft.TeamFoundation.DistributedTask.Agent.JobWriter.StartJob() 19:39:18.427410 ---------------------------------------------------------------------------

1

1 Answers

0
votes
  1. Make sure the account that the agent is run under is in the "Agent Pool Service Account" role.
  2. Make sure the queue is provisioned in the collection ( https://your-tfs-server:8080/tfs/your-collection/_admin/_AgentQueue ). If not - select "New queue.." and select the existing queue.
  3. Make sure you deploy the Windows build agent by exactly following this article.
  4. Try to change a domain account which is a member of the Build Agent Service Accounts group and belongs to "Agent Pool Service Account" role, to see whether the agent would work or not.
  5. Check the Firewall inbound rule, check vNext build on TFS 2015 hangs on MSBuild step and produces no log files