Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build Agent is Offline

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() 
like image 562
fandro Avatar asked Jan 05 '23 00:01

fandro


2 Answers

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.

like image 124
Jeremy Thompson Avatar answered Jan 13 '23 12:01

Jeremy Thompson


  1. Make sure you deploy the Windows build agent by exactly following this article.

  2. Make sure the account that the agent is run under is in the "Agent Pool Service Account" role.

  3. 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.

like image 23
Cece Dong - MSFT Avatar answered Jan 13 '23 10:01

Cece Dong - MSFT