Build Agent is Offline

fandro picture fandro · Nov 23, 2016 · Viewed 18.5k times · Source

I m using TFS 2015, I saw that my build Agent is Offline :

I launch the VsoWorker.exe to see the logs and understand the error, Here is what I get but I found nothing from the internet : Any Idea please ?

16:07:57.649004 Sending trace output to log files: C:\Users\Administrator\Downloads\agent\_diag
16:07:57.649004 vsoWorker.exe was run with the following command line:
"C:\Users\Administrator\Downloads\agent\Agent\Worker\VsoWorker.exe" 
16:07:57.649004 VsoWorker.Main(): Create AgentLogger
16:07:57.649980 VsoWorker.Main(): Parse command line
16:07:57.655848 ---------------------------------------------------------------------------
16:07:57.657635 System.Exception: The /name command line option is required and must have a value.

16:07:57.657635    at VsoWorker.CommandLine.ValidateCommandLine()

16:07:57.657635    at VsoWorker.CommandLine..ctor(String[] args)

16:07:57.657635    at VsoWorker.Program.Main(String[] args)
16:07:57.657635    at VsoWorker.CommandLine.ValidateCommandLine()

16:07:57.657635    at VsoWorker.CommandLine..ctor(String[] args)

16:07:57.657635    at VsoWorker.Program.Main(String[] args)
16:07:57.657635 ---------------------------------------------------------------------------
16:07:57.658878 BaseLogger.Dispose() 

Answer

Jeremy Thompson picture Jeremy Thompson · May 16, 2017

When you install the Build Agent you are instructed to make a C:\Agents folder:

enter image description here

If you have not first configured the Build Agent, open Powershell and run this command:

PS C:\agent> .\config.cmd

In the config setup there is an option to run the Build Agent as a Window Service. This way you don't need to start it each time the machine reboots.

If you've found the BuildAgent has been installed but is offline, it's probably not been configured to run as a Service and you will need execute this command to run the Build Agent or just double click the file:

PS C:\agent> .\run.cmd

This should bring the Build Agent online.

Note: The 1st time I tried this and it worked. The second time it didn't and I ran the C:\agent\bin\Agent.Listener.exe instead. I tried a 3rd time running the run.cmd and this time I waited a minute or 2 and it worked:

enter image description here

Note: You're better off making the agent run as a Service, this way you only need to run the config.cmd once and never need to run the run.cmd.