A.Sevi
A.Sevi

Reputation: 186

Queue jobs stuck in Azure Devops pipelines

I am facing a problem with the agent pools jobs in my Azure DevOps project.

I have the Azure Pipelines agent pool (not self-hosted) which says it is running 2 jobs and there are also 70 more in queue.

enter image description here

When I click on the Azure Pipelines agent pool, it shows all the jobs. All the jobs appear with the white circle icon, which means there are not really any jobs running.

enter image description here

I tried to cancel and delete all of these jobs and, now, when I click any of them, it shows the following message:

enter image description here

I've tried upgrading my user permissions in pipelines manage security options, disabling the agents of the azure pipelines agent pool, deleting the azure agent pool and re-adding it... and none worked for me. It does not change anything.

I've also seen that some people say that it could be a pipelines delay bug from Azure DevOps, and some of them get this bug fixed by itself after some hours/days, but I need to solve it quickly.

Upvotes: 3

Views: 2755

Answers (2)

David Jeeves
David Jeeves

Reputation: 13

For a self hosted agent do the following.

  1. Stop the agent process
  2. remove the work folder
  3. config.sh remove (to remove the agent from pool)
  4. Reconfigure the agent with the same name or a different name.

Upvotes: 0

wade zhou - MSFT
wade zhou - MSFT

Reputation: 8468

I've also seen that some people says that it could be a pipelines delay bug from Azure DevOps, and some of this people get solved this bug by itself after some hours/days, but I need to solve it urgent.

Yes, it could be recovered after some hours/days. But if it persists now, please try below options:

  1. purchase another parallel job, after it works(pipeline can grant the agent), delete the job purchased(link here).

  2. If it doesn't work, use rest api Agents - List to grant the pool status:

https://dev.azure.com/{organization}/_apis/distributedtask/pools/{poolId}/agents?api-version=6.0

check if the provisioningState in response is Deallocated. If it's not, update the value via below PowerShell script(change the pool id and agent id to yours):

Param(
   [string]$organization = "yourorgname",
   [string]$token = "PAT"  
)

$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $user,$token)))

$url="https://dev.azure.com/$organization/_apis/distributedtask/pools/9/agents/8?api-version=5.1"

$body = @"
{
    "Id": 8,
    "ProvisioningState": "Deallocated"
}
"@

Invoke-RestMethod -Uri $url -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)} -Body $body -ContentType "application/json" -Method PATCH

If the issue persists, it could be also caused by the Agent Pool Service (9) identity was removed from your [organization]/Security Service Group. Note the identity number(9) here could be different on your organization. Please check the link for the details.

If you need to resolve it urgent, first option is to raise a support request via the Azure portal. You need to have an Azure support plan associated with your subscription? Click here to create a support request. please share the build pipeline url and issue details in the support request description.

Upvotes: 1

Related Questions