Azure DevOps (ADO) Verification Errors

I’m getting errors from Azure DevOps trying to connect to SonarQube Cloud.

I’m re-adding my service connection. I just got a new token and I get Verification Failed.

I tried switching to the .us URL, but that gives a different error.

Failed to query service connection API: 'https://sonarqube.us/api/organizations/search?member=true'. Status Code: 'Unauthorized', Response from server: ''

I then switch back to Global (https://sonarcloud.io) and it worked.

After I reset this up, I’m getting errors from the SonarCloudAnalyze task, both @2 and @3.

INFO: Load project branches (done) | time=3616ms
INFO: Check ALM binding of project 'myproject_key'
INFO: Detected project binding: BOUND
INFO: Check ALM binding of project 'myproject_key' (done) | time=122ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=599ms
INFO: Load branch configuration
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 20.251s
INFO: Final Memory: 34M/99M
INFO: ------------------------------------------------------------------------
##[error]ERROR: Error during SonarScanner execution
ERROR: Error during SonarScanner execution
##[error]ERROR: Something went wrong while trying to get the pullrequest with key '90'
ERROR: Something went wrong while trying to get the pullrequest with key '90'
##[error]ERROR: Caused by: Error 500 on https://sonarcloud.io/api/alm_integration/show_pullrequest?project=myproject_key&pullrequestKey=90 : {"errors":[{"msg":"An unexpected error occurred. Please try again later."}]}
ERROR: Caused by: Error 500 on https://sonarcloud.io/api/alm_integration/show_pullrequest?project=myproject_key&pullrequestKey=90 : {"errors":[{"msg":"An unexpected error occurred. Please try again later."}]}
##[error]ERROR:
ERROR: 
##[error]The SonarScanner did not complete successfully
The SonarScanner did not complete successfully
##[error]23:58:08.312  Post-processing failed. Exit code: 1
23:58:08.312  Post-processing failed. Exit code: 1
##[warning]Can't find loc string for key: LIB_ProcessExitCode
##[warning]Error while executing SonarCloud:Analyze task: LIB_ProcessExitCode D:\a\_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\2.3.4\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe 1
##[error]LIB_ProcessExitCode D:\a\_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\2.3.4\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe 1
Finishing: SonarCloudAnalyze

We also just moved from Bitbucket to GitHub following this: Our organization is bound to BitBucket and we migrated to GitHub, looking for best practices - #8 by brian_CL

Hey @aaron-fp

  • Your first point we’re already tracking at SONARAZDO-475. It should be unrelated to the second.

In the backend, I can see this error:

Unable to contact Bitbucket Cloud servers: 401

Have you completed the process of rebinding this specific project to a GitHub repo?

I think I found the remaining Bitbucket binding in General Settings → Pull Requests. I don’t see an option for GitHub in the Provider dropdown, so I just cleared it (removing Bitbucket). I’m testing now.

The above isn’t enough. I’ll double check the docs.

I double checked the following.

  1. Organization Administration > Organization settings > Organization Binding (not Repository Binding here). Confirmed that this shows our SonarQube Cloud organization is bound to our GitHub organization.

  2. For each of our 4 projects **Administration > General Settings > Repository binding **, shows “GitHub repository binding” and the “Current binding” repository is correct. Save is disabled unless I change it to an incorrect repository.

  3. For each of our 4 projects **Administration > General Settings > Pull Requests **, Provider is empty. There isn’t a GitHub option on this list. Should there be?

  4. All Bitbucket members have been removed from our SonarQube Cloud organization.

Is there anything else we can double check? Is there a way to unbind from GitHub and rebind?

As an experiment, I changed the Repository binding for a single project to an incorrect one, hit Save, then changed it back. I started a new build and now it looks like SonarCloudAnalyze is working for all projects. I don’t know if someone fixed it on the backend or if my Save and re-Save flushed out some bad settings.

I jumped the gun saying this is working. What I’m seeing now is:
I create a PR in GitHub. This triggers the Pipeline in ADO. This build fails.
From ADO, if I open the pipeline run and click Run new, and run it with all of the same parameters, then it works. I have no idea why that would be.

It will sound weird, but it’s best just to leave sonar.pullrequest.provider as null. This is some old, legacy config that we plan to remove. I think it’s just useless, but it might actively be harmful if you try and configure it.

Would you be able to provide DEBUG level logs from both runs (add sonar.verbose=true). Happy to open a private message if that’s easier for you to share them that way.

Here’s a fresh failure with verbose=true.


I can send you the full raw logs if you open a private message.