VSTS/TFS Waiting for an enabled agent. All possible agents are disabled when using custom task conditions

Viewed 237
TFS: 2017.3
Agent version: 2.112.0

I have a really simple build with a single Powershell script task. All the task does is a Write-Host, and it works fine.

I'm testing the conditional execution of this task based on the following condition:

and(succeeded(), eq(variables['MyVariable'], 'SomeValue'))

As soon as I save this configuration and queue a build, it never starts and says:

Waiting for an enabled agent. All possible agents are disabled.

Config screenshot:

Custom condition config

Conditional tasks are a new feature since we upgraded. Is there something we need to enable?

Thanks

4 Answers

This issue should be related to the agent version, you need to download the latest build agent and configure it, then queue build with this agent.

Test environment :

TFS version: 2017.3

Agent version: 2.122.1

Build definition:

enter image description here

Result:

enter image description here

I suspect you're out of free build minutes and using a Hosted Agent. You get 1800 by default on the free tier within Azure DevOps.

I'd recommend checking your "Parallel Jobs" settings to see if you have any minutes remaining.

You can find your Parallel Jobs settings within the Project Settings, beneath Pipelines: Azure DevOps Parallel Jobs Settings

I could be way off here, but your post says that it's a build with a single Powershell task - succeeded() relies on the previous step succeeding, and for your example, there would be nothing that could succeed.

In your scenario, I might try putting another Powershell task with a different Write-Host before it, and put no condition on it, and then see if 1) the build finds an agent and runs, and 2) your second, conditional task runs successfully.

Related