"Break build on quality gate failure" task for Azure Devops" failing with error

Must-share information (formatted with Markdown):

  • Which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension) : 9.9 LTS
  • how is SonarQube deployed: zip
  • what are you trying to achieve: wanted to implement. ““Break build on quality gate failure” task for Azure Devops”
  • What have you tried so far to achieve this :
  1. Added "“Break build on quality gate failure” addon added to Azure DevOps and added to pipeline after the tasks
    a) “Prepare analysis on SonarQube” b) Run Code Analysis c)Publish Quality Gate Result
    But it is failing with below error. I am running the ADO agent as service with domain user ( Ex :domain\admin). Looks like issue could be with permissions, if so how can i add the windows domain user to sonarQube ? Can you please suggest?
    ==============================================================================

##[error][SQ] API GET ‘/api/ce/task’ failed, status code was: 403

##[error][SQ] Could not fetch task for ID ‘AYZbpgcQVjW1Hz4YGirb’

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Hey there.

It looks like you’re using GitHub - simondel/sonar-buildbreaker-vsts: VSTS task to break your build when you failed the quality gate, which is not maintained in this Community. You might want to raise an issue with the maintainer.

And, if you want to break the build on Quality Gate failure, you could also consider using sonar.qualitygate.wait=true as documented here instead.

1 Like

Thanks for the response, Colin.

I am using " SonarQube build breaker" addon taks to " Break the build when the quality gate fails". I will check the document reference you provided.

Actually, i have generated new Global Analysis token in SonarQube and added a new SonarQube service endpoint to azure devops pipline and used that in my task " SonarQube build breaker" . Looks like this is resolved the issue. Now, i am not seeing the error “##[error][SQ] API GET ‘/api/ce/task’ failed, status code was: 403” . Need to check further and confirm the " SonarQube build breaker" is working properly or not.