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.
I am facing the same issue, when I am trying to analyse the dotnet project with MsBuild Plugin. I am doing this analysis via Jenkins, so I am using a token from admin user, technically has access to do everything in sonarqube.
However, I was able to do the analysis with sonarscanner CLI, but I am seeing issues only when I am trying this with Sonar Scanner MsBuild Plugin.
dotnet sonarscanner begin /k:Sample-dotnet-MsBuild
SonarScanner for MSBuild 4.10
Using the .NET Core version of the Scanner for MSBuild
Pre-processing started.
Preparing working directories…
11:27:43.566 Updating build integration targets…
11:27:43.653 Fetching analysis configuration settings…
11:27:44.176 Failed to request and parse ‘http://soanrqube.xyz.com/api/server/version’: The remote server returned an error: (403) Forbidden.
Unhandled exception. System.Net.WebException: The remote server returned an error: (403) Forbidden.
at System.Net.HttpWebRequest.GetResponse() in //src/System.Net.Requests/src/System/Net/HttpWebRequest.cs:line 1004
at System.Net.WebClient.GetWebResponse(WebRequest request) in //src/System.Net.WebClient/src/System/Net/WebClient.cs:line 249
at System.Net.WebClient.DownloadBits(WebRequest request, Stream writeStream) in //src/System.Net.WebClient/src/System/Net/WebClient.cs:line 818
at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request) in //src/System.Net.WebClient/src/System/Net/WebClient.cs:line 297
at System.Net.WebClient.DownloadString(Uri address) in //src/System.Net.WebClient/src/System/Net/WebClient.cs:line 684
at System.Net.WebClient.DownloadString(String address) in //src/System.Net.WebClient/src/System/Net/WebClient.cs:line 674
at SonarScanner.MSBuild.PreProcessor.WebClientDownloader.Download(String url)
at SonarScanner.MSBuild.PreProcessor.SonarWebService.<>c__DisplayClass15_0.b__0()
at SonarScanner.MSBuild.PreProcessor.SonarWebService.DoLogExceptions[T](Func1 op, String url, Action1 onError)
at SonarScanner.MSBuild.PreProcessor.SonarWebService.DownloadServerVersion()
at SonarScanner.MSBuild.PreProcessor.SonarWebService.GetServerVersion()
at SonarScanner.MSBuild.PreProcessor.SonarWebService.GetProperties(String projectKey, String projectBranch)
at SonarScanner.MSBuild.PreProcessor.TeamBuildPreProcessor.FetchArgumentsAndRulesets(ISonarQubeServer server, ProcessedArgs args, TeamBuildSettings settings, IDictionary2& serverSettings, List1& analyzersSettings)
at SonarScanner.MSBuild.PreProcessor.TeamBuildPreProcessor.DoExecute(ProcessedArgs localSettings)
at SonarScanner.MSBuild.PreProcessor.TeamBuildPreProcessor.Execute(String args)
at SonarScanner.MSBuild.BootstrapperClass.PreProcess()
at SonarScanner.MSBuild.BootstrapperClass.Execute()
at SonarScanner.MSBuild.Program.Execute(String args, ILogger logger)
at SonarScanner.MSBuild.Program.Execute(String args, Boolean showDeprecatedWarning)
at SonarScanner.MSBuild.Program.Main(String args)
[Pipeline] }
WARN: Unable to locate ‘report-task.txt’ in the workspace. Did the SonarScanner succeeded?