Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception while fetching SQ config #891

Closed
epiphany20 opened this issue Sep 30, 2020 · 0 comments
Closed

Exception while fetching SQ config #891

epiphany20 opened this issue Sep 30, 2020 · 0 comments
Milestone

Comments

@epiphany20
Copy link

Description

When running on Ubuntu 20.04:

dotnet sonarscanner begin /k:"HelloWorld" /d:sonar.host.url=http://localhost:9000 /d:sonar.login=admin /d:sonar.password=admin

I receive the following exception:

20:04:10.057 Fetching analysis configuration settings...
20:04:21.859 Failed to request and parse 'http://localhost:9000/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params&ps=500&activation=false&qprofile=AXTgCizl8dTovacH3i-F&p=21&languages=cs': The remote server returned an error: (400) .

Unhandled Exception: System.Net.WebException: The remote server returned an error: (400) .
at System.Net.HttpWebRequest.GetResponse()
at System.Net.WebClient.GetWebResponse(WebRequest request)
at System.Net.WebClient.DownloadBits(WebRequest request, Stream writeStream)
at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
at System.Net.WebClient.DownloadString(Uri address)
at SonarScanner.MSBuild.PreProcessor.SonarWebService.<>c__DisplayClass7_1.b__0()
at SonarScanner.MSBuild.PreProcessor.SonarWebService.DoLogExceptions[T](Func1 op, String url, Action1 onError)
at SonarScanner.MSBuild.PreProcessor.SonarWebService.GetInactiveRules(String qprofile, String language)
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.BootstrapperClass.PreProcess()
at SonarScanner.MSBuild.BootstrapperClass.Execute()
at SonarScanner.MSBuild.Program.Execute(String[] args, ILogger logger)
at SonarScanner.MSBuild.Program.Main(String[] args)

Apparently a page beyond some internal limit is loaded to retrieve config data. It says on the SQ page when opening the URL in a browser:

"Can return only the first 10000 results. 10500th result asked."

It looks like GetInactiveRules() in sonar-scanner-msbuild/src/SonarScanner.MSBuild.PreProcessor/SonarWebService.cs is not resilient errors. As a workaround, maybe it could just always return an empty list. I couldn't get this to build, however.

Related information

  • SonarScanner for MSBuild version: 4.10
  • SonarQube server version: 8.4.1
  • Languages in your solution C#

Happy to provide additional info, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants