Azure DevOps quality gate hanging

Hello,

We’ve been using SonarQube for a while now and rarely have issues so this is a bit of a surprise and has us stumped. Around 4pm yesterday our Azure DevOps PRs started hanging waiting on the quality gate. We’ve had this before and the PAT had expired, but we’ve checked this and it’s not the issue. In our pipeline we’ve updated all the Sonar tasks to latest and enabled verbose logging to see if that fixes it or at least gives more information. Nothing suggest a problem yet the PRs aren’t budging. These are repos that have been PR’d before without issue.

I’ve checked the background tasks in Sonar and they ran successfully. The pre-build step also runs to completion. In the pre-build pipeline I see this (we’re always getting warnings about SCM):

Starting: SonarCloud Publish
==============================================================================
Task         : Publish Quality Gate Result
Description  : Publish SonarQube Cloud's Quality Gate result on the Azure Pipelines build result. To be used after the actual analysis.
Version      : 3.4.1
Author       : sonarsource
Help         : [More Information](https://docs.sonarcloud.io/advanced-setup/ci-based-analysis/sonarcloud-extension-for-azure-devops/)
==============================================================================
[INFO]  SonarQube Cloud: Server version: 8.0.0.66238
[INFO]  SonarQube Cloud: Task AZin80jhMOs2vkkhFaa1 completed
[INFO]  SonarQube Cloud: Analysis succeeded with warning: SCM provider autodetection failed. Please use "sonar.scm.provider" to define SCM of your project, or disable the SCM Sensor in the project settings.
[INFO]  SonarQube Cloud: Overall Quality Gate status: ok
Finishing: SonarCloud Publish

I’ve looked at similar posts but it has not helped. I hate to say it, but this was all working yesterday morning and now it doesn’t…

Any ideas? Can somebody from Sonar look at back end logs and see anything?

Thanks

Hi,

Welcome to the community and thanks for this report!

Can you share your org Id?

 
Thx,
Ann

I think it’s “mercuryxteam”, at least that’s what I have under organisations.

1 Like

Hi,

Thanks for that. I’ve flagged this for the folks with log access.

 
Ann

1 Like

Hey there.

In the background, I see The Azure DevOps access token is not valid.

The logs also tell me that the token that’s being used is being set at the project-level (project-level Administration > General Settings > Pull Requests).

You should most likely just remove this token and rely on what is set at the organization level.

1 Like

I have to eat some humble pie. The token had expired. I wasn’t aware that our org token and project tokens are different, neither did the admin person who confirmed the org token is valid. Lesson learned, project token renewal put on the calendar.

Thanks

1 Like

No worries. The project-level token exists primarily for legacy reasons and not well integrated. We plan to eventually remove it, but doing so will require significant effort to ensure that users’ workflows are not disrupted.

1 Like