Build Agent is Offline

19,872

Solution 1

  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.

Solution 2

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.

Solution 3

Don't run the VsoWorker.exe application directly. Use the RunAgent.cmd file.

Share:
19,872
fandro
Author by

fandro

Student

Updated on June 04, 2022

Comments

  • fandro
    fandro almost 2 years

    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() 
    
  • fandro
    fandro over 7 years
    Where do you find it ?
  • Daniel Mann
    Daniel Mann over 7 years
    In the root of the folder. In your case, C:\Users\Administrator\Downloads\agent.
  • fandro
    fandro over 7 years
    I have a ConfigureAgent that's it ?
  • Daniel Mann
    Daniel Mann over 7 years
    There are two files. ConfigureAgent.cmd and RunAgent.cmd. If you've already configured the agent, you don't need to run ConfigureAgent.cmd again.
  • fandro
    fandro over 7 years
    Where can I configure the agent ?
  • Daniel Mann
    Daniel Mann over 7 years
    With the ConfigureAgent.cmd batch file. I strongly recommend you look up the documentation for the build agent.