Publish Quality Gate Result task fails with "Error retrieving analysis"

Hi there,

we are running a SonarQube version 8.2.
I am adding a new project and running all 3 tasks for SonarQube. While 2 tasks are executed with no issues the “Publish Quality Gate Result” task fails with:

##[error][SQ] Error retrieving analysis: [SQ] API GET '/api/qualitygates/project_status' failed, status code was: 403
##[error][SQ] Could not fetch analysis for ID 'AXHQYEqjZ7c9iEHKPm5r'

Where if I go and check the link manually I can get the results:

https://SERVER/api/qualitygates/project_status?analysisId=AXHQYEqjZ7c9iEHKPm5r

with this inside:
{
“projectStatus”: {
“status”: “OK”,
“conditions”: [{
“status”: “OK”,
“metricKey”: “new_reliability_rating”,
“comparator”: “GT”,
“periodIndex”: 1,
“errorThreshold”: “1”,
“actualValue”: “1”
},
{
“status”: “OK”,
“metricKey”: “new_security_rating”,
“comparator”: “GT”,
“periodIndex”: 1,
“errorThreshold”: “1”,
“actualValue”: “1”
},
{
“status”: “OK”,
“metricKey”: “new_maintainability_rating”,
“comparator”: “GT”,
“periodIndex”: 1,
“errorThreshold”: “1”,
“actualValue”: “1”
}],
“periods”: [{
“index”: 1,
“mode”: “PREVIOUS_VERSION”,
“date”: “2020-05-01T11:15:43+0200”
}],
“ignoredConditions”: false
}
}

Any advise on how to troubleshoot this?
Thanks.

Hi,

This look like a permissions error. (HTTP 403)

The first thing to do is double-check the credentials you’re making the request with. Make sure they belong to a user who has Browse or Administer on the project.

 
HTH,
Ann

Hi Ann,

Right! I excluded the user under which token we are running the service connection.
Added the user back with permission “Browse” and we are all good.
Thanks!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.