Azure DevOps Pipeline Not Displaying All Runs

1.5k views Asked by At

I'm having issues when trying to display all runs for one of my Pipelines. I'm running on premise Azure Devops 2020 and I get a perpetual spinning Loading dialogue. I don't have this issue in any of my other pipelines. It seems that if I filter by run state in the problematic pipeline I am able to get past this and view some of the runs but for other states in my case "Succeeded" and "Succeeded with Issues" I continue to get the spinning loading symbol. Any advice?

1

There are 1 answers

0
Jane Ma-MSFT On BEST ANSWER

Here are some suggestions:

Suggestion 1

Clean the cache or load the page from a different brower and restart the Azure DevOps Server and the SQL Server machine.

Suggestion 2

Create a new pipeline that has the same settings as the affected pipeline.

Suggestion 3

You can use the REST API Builds - List to get all runs of your pipeline.

GET https://dev.azure.com/{organization}/{project}/_apis/build/builds?api-version=6.0

Because the cause of this question may be that the runs list is too long. You can use the REST API Builds-Delete to delete some of the runs you don't need to see whether the question can be solved.

DELETE https://dev.azure.com/{organization}/{project}/_apis/build/builds/{buildId}?api-version=6.0

Suggestion 4

You can refer to a similar question on the Developer Community. The Jan Selbach's comment offers a solution.

1.Run the following SQL script to find the LeaseId of duplicate rows. Please change collection Db name according to your’s.

SELECT LeaseId
FROM [AzureDevOps_DefaultCollection].[Build].[tbl_RetentionLease] 
 WHERE
partitionId > 0 AND
LeaseId NOT IN (
SELECT MIN(LeaseId) as LeaseId
  FROM [AzureDevOps_DefaultCollection].[Build].[tbl_RetentionLease]
    WHERE PartitionId > 0
    GROUP BY OwnerId,RunId
)

2.Concatenate the LeaseIds into a comma separated list

3.Run the following PowerShell script by filling in the org, project, pat, and leaseId by passing in the comma separated list of LeaseIds (remember if on-prem change the https://dev.azure.com in the $uri to your on-prem server)

$org = "";
$project = "";
$pat = "";
$encoded = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes([string]::Format("{0}:{1}", "", $pat)));
$accessToken = "Basic $encoded";
$leaseId = "";
$uri = "https://dev.azure.com/$org/$project/_apis/build/retention/leases?ids=$leaseId&api-version=6.0-preview";
try {
$response = Invoke-RestMethod -uri $uri -method DELETE -Headers @{ Authorization = $accessToken } -ContentType "application/json"
$response
}
catch {
$errorDetails = ConvertFrom-Json $_.ErrorDetails
Write-Host "StatusCode: $($_.Exception.Response.StatusCode)`nExceptionType: $($errorDetails.typeKey)`nExceptionMessage: $($errorDetails.message)"
#StackTrace: $($errorDetails.stackTrace)" 
}