Failed to request and parse 'https://sonarcloud.io/api/settings/values?component=

Have been using SonarCloud on my project for over a year with no issues and then last Friday, this issue started happening with my builds. Before I post the configuration of the task step in the build, has something changed in SonarCloud recently that would cause this error? Here is the error output.

  1. Starting: SonarCloudPrepare

==============================================================================

Task : Prepare Analysis Configuration

Description : Prepare SonarCloud analysis configuration

Version : 1.20.0

Author : sonarsource

Help : Version: 1.20.0. More Information

==============================================================================

/usr/bin/dotnet /home/vsts/work/_tasks/SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255/1.20.0/dotnet-sonar-scanner-msbuild/SonarScanner.MSBuild.dll begin /k:ePrescription /o:firstdatabank

SonarScanner for MSBuild 5.2.1

Using the .NET Core version of the Scanner for MSBuild

Pre-processing started.

Preparing working directories…

16:05:29.228 Updating build integration targets…

16:05:29.989 Fetching analysis configuration settings…

16:05:30.125 16:05:30.125 WARNING: To analyze private projects make sure the scanner user has ‘Browse’ permission.

##[error]16:05:30.129 Failed to request and parse 'https://sonarcloud.io/api/settings/values?component=ePrescription’: Response status code does not indicate success: 403 ().

16:05:30.129 Failed to request and parse 'https://sonarcloud.io/api/settings/values?component=ePrescription’: Response status code does not indicate success: 403 ().

##[error]Unhandled Exception:

##[error]System.Net.Http.HttpRequestException: Response status code does not indicate success: 403 ().

at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()

at SonarScanner.MSBuild.PreProcessor.WebClientDownloader.TryDownloadIfExists(String url, Boolean logPermissionDenied)

at SonarScanner.MSBuild.PreProcessor.SonarWebService.<>c__DisplayClass20_0.<b__0>d.MoveNext()

— End of stack trace from previous location where exception was thrown —

at SonarScanner.MSBuild.PreProcessor.SonarWebService.DoLogExceptions[T](Func`1 op, String url)

at SonarScanner.MSBuild.PreProcessor.SonarWebService.GetComponentProperties(String projectId)

at SonarScanner.MSBuild.PreProcessor.SonarWebService.GetProperties(String projectKey, String projectBranch)

at SonarScanner.MSBuild.PreProcessor.TeamBuildPreProcessor.FetchArgumentsAndRulesets(ISonarQubeServer server, ProcessedArgs args, TeamBuildSettings settings)

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)

at SonarScanner.MSBuild.Program.Main(String args)

at SonarScanner.MSBuild.Program.(String args)

System.Net.Http.HttpRequestException: Response status code does not indicate success: 403 ().

at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()

at SonarScanner.MSBuild.PreProcessor.WebClientDownloader.TryDownloadIfExists(String url, Boolean logPermissionDenied)

at SonarScanner.MSBuild.PreProcessor.SonarWebService.<>c__DisplayClass20_0.<b__0>d.MoveNext()

— End of stack trace from previous location where exception was thrown —

at SonarScanner.MSBuild.PreProcessor.SonarWebService.DoLogExceptions[T](Func`1 op, String url)

at SonarScanner.MSBuild.PreProcessor.SonarWebService.GetComponentProperties(String projectId)

at SonarScanner.MSBuild.PreProcessor.SonarWebService.GetProperties(String projectKey, String projectBranch)

at SonarScanner.MSBuild.PreProcessor.TeamBuildPreProcessor.FetchArgumentsAndRulesets(ISonarQubeServer server, ProcessedArgs args, TeamBuildSettings settings)

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)

at SonarScanner.MSBuild.Program.Main(String args)

at SonarScanner.MSBuild.Program.(String args)

##[error]The process ‘/usr/bin/dotnet’ failed with exit code null

Finishing: SonarCloudPrepare

Hey @naestrolay,

Are you sure that the user that token you use has the right to analyze the project? Can you double-check that and tell me what kind of permissions are assigned?

There were no changes on the SonarCloud side that could cause this issue.

Best,
Marcin