1

I have configured a build server for TFS 2017 and vNext build for my web application. This was working fine until yesterday. Suddenly I started getting the message "Waiting for an available agent" when I try to queue the build. Even if I hit cancel, the build is stuck with the status 'cancelling'.

vNext build issue

  • Agent pool is green. All demands match with the build expectation.
  • Have restarted the Agent service on the build server.
  • Also tried restarting the "Visual studio backgroud agent job service" as suggested in this question
  • Agent doesn't have any log file after build stopped working.

Has anyone faced / solved similar issue?

Suresh
  • 21
  • 7
  • What about other agents? Have you ever changed the build definition? This will happen when the build definition is in an invalid state, i.e. it was saved without validation errors but some aspect of the configuration is wrong. – Andy Li-MSFT Mar 26 '18 at 06:56
  • I was migrating the xaml build to vNext, so there was constant update in build definition. Also, all other agents are in Green state. I need to try restarting "Visual studio backgroud agent job service" on TFS Server. Have to request as its corporate environment. – Suresh Mar 29 '18 at 17:37

1 Answers1

2

Just try below things to narrow down the issue:

  • Check if the agent machine is out of space.
  • Clean up the agent machine: Delete the file items under "_work" folder of the build agent.
  • Restart the TFS Server.
  • Restart the agent machine.
  • Change another available account for agent service, restart the service.
  • Re-configure the agent
  • Deploy a new agent. See Deploy an agent on Windows

UPDATE:

Based on your clarification, seems it's caused by "Visual studio Team Foundation backgroud job Agent" service.

Generally deploy new agent will work, if it's not working, then it more likely to be the service problem. So just try to restart the "Visual studio Team Foundation backgroud job Agent" service (try this several times).

If that still not work, just try to change another vailable account for the Agent service. Then try it again.

enter image description here

Andy Li-MSFT
  • 28,712
  • 2
  • 33
  • 55
  • Thanks @Andy. In my opinion this happens even before contacting agent. However, I tried all the points you mentioned, unfortunately didn't help. – Suresh Mar 29 '18 at 17:28
  • @Suresh Based on your clarification, seems it's caused by "`Visual studio Team Foundation backgroud job Agent`" service. Generally deploy new agent will work, if it's not working, then it more likely to be the service problem. So just try to restart the "`Visual studio Team Foundation backgroud job Agent`" service . See the updated answer. – Andy Li-MSFT Mar 30 '18 at 02:36
  • Andy, meanwhile IT team restarted TFS Server and the builds are back to normal. Have to wait and watch. – Suresh Mar 30 '18 at 16:26
  • @Suresh So, seems the problem was resolved, right? you can check that, if the issue was resolved, then please [Accept the reply as an Answer](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work), This can be beneficial to other community members reading this thread. – Andy Li-MSFT Apr 02 '18 at 01:45