Error during SonarQube Scanner execution


(Vandanpathak Gep) #1

Hello Guys,
In VSTS Build CI , I am using Sonar for Code Analysis and i am getting below error . I am using Git as Source Control Version and Octopus for deployment

ERROR: Error during SonarQube Scanner execution
ERROR: Pull request with branch does not exist on server: HOTFIX
The SonarQube Scanner did not complete successfully
08:48:30.162 Post-processing failed. Exit code: 1
G:\VSTS_A1_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.3.2\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe failed with return code: 1

Can anyone help me to resolve this as i am stuck where to check.

(Amaury Levé) #2

Hi @vandanpathak-gep,

It seems like the long living branch HOTFIX doesn’t exist on your SonarQube instance. Could you check whether or not it appears on your project homepage of SonarQube (in the dropdown next to the project name)? In case it doesn’t, SonarQube requires the target branch to exist (i.e. be analyzed) before analyzing a PR.


(Vandanpathak Gep) #3

Hi @Ammo

Thanks Bro for your reply . Will check this and let you . But had another question , For every new branch i have to keep on adding into Project or is there some work around where it automatically captures all new branch.

(Amaury Levé) #4

If you do use the extension for VSTS that we provide and you do build branches and PRs there should be nearly no configuration required on your side to handle that correctly.

If you are calling the scanner manually, sadly you will have to handle the right parameters depending on whether this is a PR or branch analysis.