Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Waiting for an available agent / Waiting for an agent to be requested

(26.07.2016)I am using TFS2015 Update3 in a VM. When I try to queue a build through the web interface or from Team Explorer, I get the following. Then I restart all services related to TFS in services.msc and then after some time it starts working again.

So this happens too often.

enter image description here

I have a custom pool running: enter image description here

Is there a way to debug this behaviour?

Examining the Log files

Link to Worker log file
Link to Agent log file

Exception occurs in this order here:

  1. Checking if artifacts directory exists C:\workspaces\agent\_work\2\a
  2. Deleting artifacts directory
  3. System.ComponentModel.Win32Exception (0x80004005): The directory is not empty
    at Microsoft.TeamFoundation.Common.FileSpec.DeleteDirectoryLongPath(String path, Boolean recursive, Boolean followJunctionPoints)

The weird thing is, queueing new build works most of the time, this happens only sporadically

It could be, that I have opened a file from that folder in notepad with many tabs open. Will observe if this issue persists and report.

like image 290
Legends Avatar asked Jul 26 '16 14:07

Legends


1 Answers

If this is happening sporadically, it might a long path exists here in artifacts:

C:\workspaces\agent_work\2\a

Or, there was a cancelled build which left the artifact directory half cleaned which exposed a bug in cleaning.

The 2.x agent isn't subject to long paths (net core) but only works with 2017+:

https://github.com/Microsoft/vsts-agent

We can troubleshoot but it would be good to get to 2017+ (2018 QU3 is out) with a 2.x agent.

If that's not an option, message me and we can dig into what I think is a cancel / state bug.

like image 91
bryanmac Avatar answered Nov 01 '22 04:11

bryanmac