SonarCloud Project Dashboard Empty After Running Dotnet SonarScanner

  • ALM used (GitHub)
  • CI system used (N/A)
  • Scanner command used when applicable (private details masked)

dotnet sonarscanner begin /k:"[redacted]" /o:"[redacted]" /d:sonar.login="[redacted]" /d:sonar.host.url=“https://sonarcloud.io
dotnet build CyberAlert_Collector.sln
dotnet sonarscanner end /d:sonar.login="[redacted]"

  • Languages of the repository
    C# .Net framework

  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
    No errors.

Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 15.79 ms for /home/[redacted]/Projects/git/CyberAlert_Collector_NetCore/CyberAlert_Collector.csproj.
  CyberAlert_Collector -> /home/[redacted]/Projects/git/CyberAlert_Collector_NetCore/bin/Debug/netcoreapp2.2/CyberAlert_Collector.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

The private SonarCloud dashboard remains empty, no background tasks, running. I have generated multiple login tokens and retried using the new ones as well as organizational owner master tokens that work for any project. I have used multiple combinations of properties (including sonar.host on end command, including language specification property etc.)

I’m running on Ubuntu 19.04, SonarScanner is version 4.7.1, dotnet version 3.0.100. I have also tried .NET Core 2.1.606

Hi,

Could you please send us the logs of the dotnet sonarscanner end command please ?

Thanks.

Mickaël

@mickaelcaro, this is unfortunately the extent of the logs. I have tried using -x and -X as arguments to provide debug but neither seem to work with the dotnet sonarscanner. Is there another way to provide this information?

You can try to pass the following :

/d:sonar.verbose=true

No logs are provided. I’m not receiving any at all with the above argument on the dotnet sonarscanner begin and dotnet sonarscanner end commands. I’ve already re-installed .Net and dotnet-sonarscanner, same thing.

At least the “begin” command should output something like this :

SonarScanner for MSBuild 4.7.1

xxx
Pre-processing started.
Preparing working directories...
12:27:34.296 Updating buildintegration targets...
12:27:34.327 Fetching analysis configuration settings...
12:27:40.168 Provisioning analyzer assemblies for cs...
12:27:40.184 Installing required Roslyn analyzers...
12:27:40.858 Provisioning analyzer assemblies for vbnet...
12:27:40.858 Installing required Roslyn analyzers...
12:27:40.904 Pre-processing succeeded.

Otherwise that might be something else.

Yes, well using either version of .Net there are no logs for sonarscanner with or without the verbose argument. Only the .Net build command provides logs.

Which commandline tool are you using for that ?

Same as in the original post. I’ve tried several variations
dotnet sonarscanner begin
dotnet sonarscanner end
dotnet sonarscanner begin /k:"[redacted]" /o:"[redacted]" /d:sonar.login="[redacted]" /d:sonar.host.url=“https://sonarcloud.io”
I’ve tried replacing portions of the above with dotnet-sonarscanner instead (segmentation fault error due to incorrect command I’m guessing) and duplicated these steps with .Net 3.0 and .Net 2.1 with many more and less argument combinations.

Edit: This is just through Ubuntu terminal
Edit: Also attempted with dotnet-sonarscanner 4.6.2 with the same results, no logs.

Please note that without any --roll-forward=“Major” flag on the command, the Scanner for MSBuild is not yet compatible with .NET Core 3 (but as long as you have at least 2.1+ installed, should be no problem)

I tried on a debian 9, i get logs, event with only dotnet-sonarscanner invoked.

Do you have correct path set to dotnet global tools on your PATH env variable ?

1 Like