Search code examples
sonarqubejenkins-pipeline

Sonarqube stage in jenkins pipeline fails with 403 error


I have a pipeline job which keeps failing on Sonar Quality Gate stage with the below error:

[Bitbucket] Build result notified
org.sonarqube.ws.client.HttpException: Error 403 on http://illinXXXX:XXXXX/api/qualitygates/project_status?analysisId=XXXXXXXX
    at org.sonarqube.ws.client.BaseResponse.failIfNotSuccessful(BaseResponse.java:34)

What's more strange, another pipeline from the same MS, is passing that stage. They both are using the same Sonarquebe user and token, and the same stage syntax.

Sonarqube version: 6.7.1 (build 35068).


Solution

  • Problem: The execution user/group had permissions to run “Execute Analysis” Solution: Update the default template with permissions and push to projects (Bulk Apply Template)