Pull request decoration and gate failed while Personal Access Token (PAT) as valid permissions

  • ALM used Azure DevOps
  • CI Azure DevOps
  • Scanner command used when applicable (private details masked)
  • Languages of the repository: Java
  • Only if the SonarCloud project is public: Private
  • Error observed ‘’‘Pull request decoration failed because the token specified in the settings does not have sufficient rights. Please check the permissions of this token’’’

Problem: The sonarCloud decoration on PR and the PR’s sonarCloud gate is not working. We got the following warning: Pull request decoration failed because the token specified in the settings does not have sufficient rights. Please check the permissions of this token

Context: As documented, we have configured an Azure devops valid Personal Access Token with Code: read and write permission in SonarCloud pull-request. (SonarCloud: Administration -> General Settings -> Pull Requests.

We can make SonarCloud integration works in a sandbox environment.

Are there other things that can make the integration SonarCloud to Azure pull request failed: firewall, project’s permissions etc.

Thank you

Hi @Carol_Gagne

Can you please give us a background task id (In Administration menu of your project -> Background tasks), where this PR decoration failed ? We’ll have a look at our internal logs.

Thank you.

Thank you Mickaël for your reply.

As requested here’s a task ID: AXX2Q4mN9kNevqJN6jEa

Regards

Hi again @Carol_Gagne

Do you have any other project / repository by chance with that token, which are working ?

Normally the token is at organization level on Azure DevOps, but can you check that you can do some queries with it using postman for example ? It might be some permissions issues also.

HTH,
Mickaël

Hi!
I conclude that you did not find the issue from your log.
I will run some tests and make sure to use the same token and let you know.
I will try to do some queries with postman.

Thanks

Hi!

Do you have any other project / repository by chance with that token, which are working ?
I don’t have the exact scenario, however, yesterday 2020-11-30 I had some successes and today is not working anymore.
Can you kindly compare the following task IDs:
SUCCESS AXYZyBRofZedV4MeS2jn
SUCCESS AXYaDAR52DjU6eRoTrb_
WARNING AXYeQ4FF6B9NhJ9SpQjX

Thank you

Hi @Carol_Gagne

So indeed the same calls made 3 times only failed with the last one, i don’t understand why and it’s more likely to be a transient error on Azure DevOps side.

Have you been able to test some queries using Postman with your token multiple times to see if you can reproduce that behavior ?

Mickaël