Azure DevOps quality gate stuck 'Waiting'

In my Azure DevOps organisation, the sonarcloud quality gate often gets stuck in a waiting state after the background task in Sonarcloud has finished.

This forum suggests the issue can be related to the organisation PAT set in Azure DevOps however the failures are intermittent.

The analysis ID is AYmwVtJztUD_NdI4OIzu

The quality gate status on the pull request in SonarCloud is passed however in Azure DevOps it’s waiting.

I have multiple pushes to this pull request with the option to reset status whenever a new commit is pushed

Can someone suggest what the issue here might be? I can’t seem to find any documentation around the status reset option on the quality gate so it’s unclear what this should be set to.

Thanks

Hello William,

I’ll have a look into your issue.

Are you using automatic analysis ? Or is the Sonarcloud analysis ran with your own CI ?

We are currently facing the same issue since version 1.42 of the SonarCloud extensions for Azure DevOps. The code analysis report is shown as “passed” in the pipeline run and within SonarCloud, but the quality gate keeps waiting.

Hello Kevin,

Ok I’ll be having a look in our logs. Can you share with me the most recent Analysis ID on which you have that issue ? And an approximate date/time when it happened ?
This will help me find what happened to it :slight_smile:

Ofcourse! The analysis ID is AYnkRzrA5w3SXRZcxhKn and it happened for this one at around 11 AM UTC time on 11 august 2023.

Thanks in advance!

1 Like

Thank you, I’ll have a look and update you there

1 Like
Are you using automatic analysis ? Or is the Sonarcloud analysis ran with your own CI ?

We’re using Sonarcloud analysis with our CI

Hello William and Kevin,

I can confirm it is not a token/configuration issue on your side.

It seems like a temporary issue with Azure DevOps, their API is sending us some timeout error code in this case.
Do you have this issue often/for a long time?
It seems we don’t have this issue anymore since the 12th of August.

Hello @quentin.chevrin ,

We are still experiencing this issue. This occurred on the 10th of august.

This analysis ID, AYn5TKw2eHqLgI1naP8X , is from 10 minutes ago (15 aug 2023 on 13:10 UTC) were the quality gate for the PR is again waiting. This is the issue on all the PR’s we open since the 10th.

Hello Kevin,

With the latest analysis id you shared, I can see that you actually have an issue with your access token.
The access token used is invalid.

Can you have a look at this tutorial and make sure you set up your access token correctly ?

Be mindful of what is explained in the yellow rectangle in that documentation.

Let me know if it helps

Hello Quentin!

Thanks for investigating this for us! The person whose PAT is used is now on holiday but will comeback next week.

I’ll let you know if it fixed our issue! I’ll keep you posted

Hi Quentin

I just observed this issue again with activity ID AYoXYjMQseHOVSuvsVrg

I would note as well that this branch policy is set to not ‘Reset status whenever there are new changes’ as I mentioned in the thread OP.

Could you check this for us?

Hello William,

As I can see there is still an issue with the access token, which is invalid.

Could you please set up the access token as suggested here?

Let me know if you need some help.

Hi Ivan

I’ve looked over the documentation and from what I can see the Azure DevOps PAT is configured as stated

  • At organisation level in SonarCloud
  • Within its expiration period
  • Contains the permissions ‘Code (Read & Write)’

The organisation setting Azure Active Directory Conditional Access Policy Validation (which has been renamed to Enable IP Conditional Access policy validation on non-interactive flows since the documentation was last updated) is also disabled.

I’ve addressed some warnings I can see in SonarCloud background tasks around shallow fetch being enabled by not setting the fetch depth and while those warnings are now gone, we still see issues with PR status’s not updating

Is there any more verbose logging you can share that will help find the root cause of this? Particularly around the PAT if that’s where you see errors.

Here is a more recent analysis ID from today that is impacted:
AYquCv2xPYZqBSNoJYvE