azure-devopsyamlazure-pipelinesgitversionbuild-agent

Azure DevOps Pipeline Error: No Agent Found with Version Greater Than 2.220.0


I recently started encountering an error in my Azure DevOps pipeline that previously built without any issues. The error message is as follows:

No agent found in pool Default which satisfies the following demand: Agent.Version. All demands: Agent.Version -gtVersion 2.220.0

Our build agent version is currently 2.170.1.

I am certain that no changes have been made to the pipeline configuration or the project that would cause this issue. Could this be due to a recent software update on the build server or any changes from Azure DevOps itself?

Here are the steps I've taken to troubleshoot the issue:

Verified the agent version in the Default pool, which is 2.170.1. Checked for recent updates or changes in the project and pipeline configuration. I would appreciate any insights or suggestions on resolving this issue. Is there a way to force the pipeline to use the existing agent version, or should I update the agent to a newer version? If updating the agent is the recommended approach, what are the steps to do so?


Solution

  • As we has discussed in above comments, it is recommended to update the agents in your pool to be the latest version.

    1. You can open the agent pool and then click "Update all agents" button to upgrade all the agents in the pool.

      enter image description here

    2. You can enable the option "Allow agents in this pool to automatically update" in the pool. When a new agent version is available, it will automatically upgrade the agent before starting to run the pipeline jobs.

      enter image description here


    In addition, as @Max CHien mentioned, Azure DevOps has released Agent version 3.x. We recommend you consider to upgrade your self-hosted agents to version 3.x. You need to download the installation package of Agent version 3.x and install it on yourself machines. If you no longer need the version 2.x agents, you can uninstall them.

    enter image description here


    EDIT:

    If you are using Azure DevOps Server/TFS (on-premises), the the Agent version 3.x is available starting in Azure DevOps Server 2022.1. The lower versions are not available. See "Agent version 3.x"

    enter image description here

    Since you are using Azure DevOps Server 2020 with a quite old Update/Patch version (Version Dev18.M170.8), the Agent version 3.x is not available. You can consider to download the latest Agent version 2.x from the GitHub repository (v2.220.0).

    In addition, according to the statement in "Azure DevOps Server 2020 Release Notes", if you upgrade to latest Update/Patch version (Update 0.2 Patch 6) of Azure DevOps Server 2020, you should be able to use Agent version 3.x.


    EDIT_2:

    fatal: not a git repository (or any of the parent directories)

    Ensure you have correctly set the checkout task and disabled shallow clone on the task.

    steps:
    - checkout: self
      fetchDepth: 0  # Disable shallow clone.
    

    Error: Unable to locate executable file: 'dotnet-gitversion'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable.

    Before the Execute GitVersion (gitversion/execute) task, you need to run the Setup GitVersion (gitversion/setup) task, otherwise the Execute step will fail with this error. See "GitVersion Tasks Usage Examples".

    enter image description here

    steps:
    - checkout: self
      fetchDepth: 0
    
    - task: gitversion/setup@1
      displayName: 'Install GitVersion'
      inputs:
        versionSpec: '5.x'
        preferLatestVersion: true
    
    - task: gitversion/execute@1
      displayName: 'Generate Version'