Unable to parse code using SonarQube scanner for MSBuild -remote error returned 403 forbidden

sonarcloud

(Ben Meneses Sosa) #1

Hi, we are using sonarqube analyser for MSBuild nuget package = MSBuild.SonarQube.Runner.Tool.4.0.2.1

We are running the analysis on bamboo build server (version 6.7.1 build 60705)

In a particular project named gateway, we get an error when running the analysis step before the build:

The remote server returned an error: (403) Forbidden.

Bamboo log as follows

"

build 14-Feb-2019 10:17:14 Executing .\Src\packages\MSBuild.SonarQube.Runner.Tool.4.0.2.1\tools\MSBuild.SonarQube.Runner.exe
build 14-Feb-2019 10:17:14 SonarQube Scanner for MSBuild 4.0.2
build 14-Feb-2019 10:17:14 Default properties file was found at C:\build\STRUSE-SG-JOB1\Src\packages\MSBuild.SonarQube.Runner.Tool.4.0.2.1\tools\SonarQube.Analysis.xml
build 14-Feb-2019 10:17:14 Loading analysis properties from C:\build\STRUSE-SG-JOB1\Src\packages\MSBuild.SonarQube.Runner.Tool.4.0.2.1\tools\SonarQube.Analysis.xml
build 14-Feb-2019 10:17:14 Pre-processing started.
build 14-Feb-2019 10:17:14 Preparing working directories…
build 14-Feb-2019 10:17:14 10:17:14.991 Updating build integration targets…
build 14-Feb-2019 10:17:14 10:17:14.999 Fetching analysis configuration settings…
build 14-Feb-2019 10:17:17 stderr: 10:17:16.802 Failed to request and parse ‘https://sonarcloud.io/api/settings/values?component=Gateway’: The remote server returned an error: (403) Forbidden.

"

Do you have information of what could possibly be causing the error?

We analyse many other projects using the same api key.

cheers


(Fabrice Bellingard) #2

Given that the scanner fails with an HTTP 403 when trying to get settings for the “Gateway” project, I’d say that the token that you are using does not have enough credentials to access this project.