Sonarqube 8.9.6 - code coverage not running

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • what are you trying to achieve
  • what have you tried so far to achieve this

we are experiencing issues some of the sonarscan code coverage is not updating, it shows 0% code coverage. can you please take a look and let me know how to resolve this issue. Attached logs.
Downloads.zip (4.8 MB)

Hi,

You’ve provided server logs. We need the analysis logs.

The analysis log is what’s output from the analysis command. Hopefully, the log you provide will include that command as well.

 
Ann

@ganncamp - FYI - Three issues

  1. Coverage is 0.0% - Still having issues
  2. The Project analysis has failed - This was resolved by deleting es7 folder and restarted sonar services
  3. Last run was on Jun 10 - Background task started running after above step 2.

for now workaround and your recommendation - for the past two days I’m clearing es7 folder daily as background task are not running automatically and please recommend how to resolve coverage report.

Hello,

I previously asked for your analysis report. No one will be able to diagnose a coverage reporting problem from your server logs.

Regarding your background task, please create a new thread & attach whatever errors you’re seeing in your background task log.

 
Ann

@ganncamp - I’m sorry, can you guide me how to share analysis report?

Hi,

Simply copy/paste the text into a reply here. Ideally you’ll code-format it by putting ``` on the line before the log and again on the line after.

 
Ann

@ganncamp Thanks, I never tried, let me try and share the report.

@ganncamp we use Atlassian Bamboo application to run the build plan. I’m guessing this issue mostly impacting .net codes. As you recommended earlier we recently upgraded to 8.9.9 LTS and still having same issues. Code coverage is not showing up. Can you please guide me how to troubleshoot and resolve this issues.

Hi,

As requested above^ I still need to see your analysis log.

 
Ann

@ganncamp is this command you are requesting? Also with respect analysis log, are you referring bamboo agent build logs?

`

command 29-Jul-2022 08:37:52 Beginning to execute external process for build 'UWR Rewrites - Aplus Property Claims Receipt And Acceptance API Sonar Reports - Property.Claims.ReceiptAndAcceptance.API #542 (UWR-APCRAASR-AAEJ-542)'\n ... running command line: \nD:\Development Tools\sonar-scanner-4.6.2\bin\sonar-scanner.bat -Dsonar.projectKey=CommercialProperty:Property.Claims.ReceiptAndAcceptance.API "-Dsonar.projectName=Property.Claims.ReceiptAndAcceptance" -Dsonar.projectVersion=${bamboo.CPVersion_Property.Claims.ReceiptAndAcceptance.API_Autoupdate}.0-SNAPSHOT -Dsonar.cs.nunit.reportsPaths=TestResult.xml -Dsonar.cs.opencover.reportsPaths=coverage.xml -Dsonar.dotnet.visualstudio.testProjectPattern=*.Test* -Dsonar.language=cs -Dsonar.dotnet.visualstudio.solution.file=Property.Claims.ReceiptAndAcceptance.API.sln -Dsonar.dotnet.buildConfiguration=Debug -Dsonar.sources=. -Dsonar.cs.fxcop.directories=Lib,packages -Dsonar.cs.fxcop.aspnet=false -X -Dsonar.login=********\n ... in: E:\bamboo-agent-home\xml-data\build-dir\UWR-APCRAASR-AAEJ\VRSK.PropertyReceiptAndAcceptance.API\n

`

@ganncamp logs:

build	29-Jul-2022 08:37:52	Time Elapsed 00:00:01.54
simple	29-Jul-2022 08:37:52	Finished task 'Dotnet Core Build' with result: Success
command	29-Jul-2022 08:37:52	Substituting password variable: ${bamboo.CP.SonarSecretToken}
simple	29-Jul-2022 08:37:52	Starting task 'SONAR SCANNER' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.command'
command	29-Jul-2022 08:37:52	Substituting password variable: ${bamboo.CP.SonarSecretToken}
command	29-Jul-2022 08:37:52	Beginning to execute external process for build 'UWR Rewrites - Aplus Property Claims Receipt And Acceptance API Sonar Reports - Property.Claims.ReceiptAndAcceptance.API #542 (UWR-APCRAASR-AAEJ-542)'\n ... running command line: \nD:\Development Tools\sonar-scanner-4.6.2\bin\sonar-scanner.bat -Dsonar.projectKey=CommercialProperty:Property.Claims.ReceiptAndAcceptance.API "-Dsonar.projectName=Property.Claims.ReceiptAndAcceptance" -Dsonar.projectVersion=${bamboo.CPVersion_Property.Claims.ReceiptAndAcceptance.API_Autoupdate}.0-SNAPSHOT -Dsonar.cs.nunit.reportsPaths=TestResult.xml -Dsonar.cs.opencover.reportsPaths=coverage.xml -Dsonar.dotnet.visualstudio.testProjectPattern=*.Test* -Dsonar.language=cs -Dsonar.dotnet.visualstudio.solution.file=Property.Claims.ReceiptAndAcceptance.API.sln -Dsonar.dotnet.buildConfiguration=Debug -Dsonar.sources=. -Dsonar.cs.fxcop.directories=Lib,packages -Dsonar.cs.fxcop.aspnet=false -X -Dsonar.login=********\n ... in: E:\bamboo-agent-home\xml-data\build-dir\UWR-APCRAASR-AAEJ\VRSK.PropertyReceiptAndAcceptance.API\n
build	29-Jul-2022 08:37:59	08:37:59.558 INFO: Scanner configuration file: D:\Development Tools\sonar-scanner-4.6.2\bin\..\conf\sonar-scanner.properties
build	29-Jul-2022 08:37:59	08:37:59.574 INFO: Project root configuration file: NONE
build	29-Jul-2022 08:37:59	08:37:59.855 INFO: SonarScanner 4.6.2.2472
build	29-Jul-2022 08:37:59	08:37:59.856 INFO: Java 11.0.11 AdoptOpenJDK (64-bit)
build	29-Jul-2022 08:37:59	08:37:59.856 INFO: Windows Server 2019 10.0 amd64
build	29-Jul-2022 08:38:01	08:38:01.081 DEBUG: keyStore is : 
build	29-Jul-2022 08:38:01	08:38:01.082 DEBUG: keyStore type is : pkcs12
build	29-Jul-2022 08:38:01	08:38:01.082 DEBUG: keyStore provider is : 
build	29-Jul-2022 08:38:01	08:38:01.082 DEBUG: init keystore
build	29-Jul-2022 08:38:01	08:38:01.082 DEBUG: init keymanager of type SunX509
build	29-Jul-2022 08:38:02	08:38:02.999 DEBUG: Create: C:\Windows\system32\config\systemprofile\.sonar\cache
build	29-Jul-2022 08:38:03	08:38:02.999 INFO: User cache: C:\Windows\system32\config\systemprofile\.sonar\cache
build	29-Jul-2022 08:38:03	08:38:03.000 DEBUG: Create: C:\Windows\system32\config\systemprofile\.sonar\cache\_tmp
build	29-Jul-2022 08:38:03	08:38:03.002 DEBUG: Extract sonar-scanner-api-batch in temp...
build	29-Jul-2022 08:38:03	08:38:03.021 DEBUG: Get bootstrap index...
build	29-Jul-2022 08:38:03	08:38:03.021 DEBUG: Download: https://codescan.verisk.com/sonar/batch/index
build	29-Jul-2022 08:38:04	08:38:04.051 DEBUG: Get bootstrap completed
build	29-Jul-2022 08:38:04	08:38:04.069 DEBUG: Create isolated classloader...
build	29-Jul-2022 08:38:04	08:38:04.254 DEBUG: Start temp cleaning...
build	29-Jul-2022 08:38:04	08:38:04.259 DEBUG: Temp cleaning done
build	29-Jul-2022 08:38:04	08:38:04.260 INFO: Scanner configuration file: D:\Development Tools\sonar-scanner-4.6.2\bin\..\conf\sonar-scanner.properties
build	29-Jul-2022 08:38:04	08:38:04.260 INFO: Project root configuration file: NONE
build	29-Jul-2022 08:38:04	08:38:04.261 DEBUG: Execution getVersion
build	29-Jul-2022 08:38:04	08:38:04.296 INFO: Analyzing on SonarQube server 8.9.9
build	29-Jul-2022 08:38:04	08:38:04.297 INFO: Default locale: "en_US", source code encoding: "windows-1252" (analysis is platform dependent)
build	29-Jul-2022 08:38:04	08:38:04.298 DEBUG: Work directory: E:\bamboo-agent-home\xml-data\build-dir\UWR-APCRAASR-AAEJ\VRSK.PropertyReceiptAndAcceptance.API\.scannerwork
build	29-Jul-2022 08:38:04	08:38:04.298 DEBUG: Execution execute
build	29-Jul-2022 08:38:05	08:38:05.104 DEBUG: Community 8.9.9.56886
build	29-Jul-2022 08:38:05	08:38:05.375 INFO: Load global settings
build	29-Jul-2022 08:38:05	08:38:05.516 DEBUG: GET 200 https://codescan.verisk.com/sonar/api/settings/values.protobuf | time=139ms
build	29-Jul-2022 08:38:05	08:38:05.571 INFO: Load global settings (done) | time=196ms
build	29-Jul-2022 08:38:05	08:38:05.573 INFO: Server id: 6CA5A72F-AW8nkLVVzBmxVatIWzh9
build	29-Jul-2022 08:38:05	08:38:05.576 INFO: User cache: C:\Windows\system32\config\systemprofile\.sonar\cache
build	29-Jul-2022 08:38:05	08:38:05.579 INFO: Load/download plugins
build	29-Jul-2022 08:38:05	08:38:05.580 INFO: Load plugins index
build	29-Jul-2022 08:38:05	08:38:05.589 DEBUG: GET 200 https://codescan.verisk.com/sonar/api/plugins/installed | time=9ms
build	29-Jul-2022 08:38:05	08:38:05.747 INFO: Load plugins index (done) | time=167ms
build	29-Jul-2022 08:38:06	08:38:06.140 INFO: Load/download plugins (done) | time=561ms
build	29-Jul-2022 08:38:06	08:38:06.264 DEBUG: Plugins:
build	29-Jul-2022 08:38:06	08:38:06.265 DEBUG:   * Dependency-Check 3.0.1 (dependencycheck)
build	29-Jul-2022 08:38:06	08:38:06.265 DEBUG:   * Python Code Quality and Security 3.4.1.8066 (python)
build	29-Jul-2022 08:38:06	08:38:06.265 DEBUG:   * CSS Code Quality and Security 1.4.2.2002 (cssfamily)
build	29-Jul-2022 08:38:06	08:38:06.265 DEBUG:   * Crowd 2.1.3 (crowd)
build	29-Jul-2022 08:38:06	08:38:06.265 DEBUG:   * PMD 3.4.0 (pmd)
build	29-Jul-2022 08:38:06	08:38:06.265 DEBUG:   * Clover 4.1 (clover)
build	29-Jul-2022 08:38:06	08:38:06.265 DEBUG:   * Go Code Quality and Security 1.8.3.2219 (go)
build	29-Jul-2022 08:38:06	08:38:06.265 DEBUG:   * JaCoCo 1.1.1.1157 (jacoco)
build	29-Jul-2022 08:38:06	08:38:06.265 DEBUG:   * Kotlin Code Quality and Security 1.8.3.2219 (kotlin)
build	29-Jul-2022 08:38:06	08:38:06.265 DEBUG:   * JavaScript/TypeScript Code Quality and Security 7.4.4.15624 (javascript)
build	29-Jul-2022 08:38:06	08:38:06.265 DEBUG:   * Ruby Code Quality and Security 1.8.3.2219 (ruby)
build	29-Jul-2022 08:38:06	08:38:06.265 DEBUG:   * Scala Code Quality and Security 1.8.3.2219 (sonarscala)
build	29-Jul-2022 08:38:06	08:38:06.265 DEBUG:   * C# Code Quality and Security 8.22.0.31243 (csharp)
build	29-Jul-2022 08:38:06	08:38:06.266 DEBUG:   * Groovy 1.8 (groovy)
build	29-Jul-2022 08:38:06	08:38:06.266 DEBUG:   * Java Code Quality and Security 6.15.1.26025 (java)
build	29-Jul-2022 08:38:06	08:38:06.266 DEBUG:   * Sonargraph Integration 7.0.0 (sonargraphintegration)
build	29-Jul-2022 08:38:06	08:38:06.266 DEBUG:   * HTML Code Quality and Security 3.4.0.2754 (web)
build	29-Jul-2022 08:38:06	08:38:06.266 DEBUG:   * Flex Code Quality and Security 2.6.1.2564 (flex)
build	29-Jul-2022 08:38:06	08:38:06.266 DEBUG:   * XML Code Quality and Security 2.2.0.2973 (xml)
build	29-Jul-2022 08:38:06	08:38:06.266 DEBUG:   * PHP Code Quality and Security 3.17.0.7439 (php)
build	29-Jul-2022 08:38:06	08:38:06.266 DEBUG:   * Checkstyle 9.3 (checkstyle)
build	29-Jul-2022 08:38:06	08:38:06.266 DEBUG:   * VB.NET Code Quality and Security 8.22.0.31243 (vbnet)
build	29-Jul-2022 08:38:07	08:38:07.385 INFO: Process project properties
build	29-Jul-2022 08:38:07	08:38:07.395 INFO: Process project properties (done) | time=10ms
build	29-Jul-2022 08:38:07	08:38:07.396 INFO: Execute project builders
build	29-Jul-2022 08:38:07	08:38:07.396 DEBUG: Execute project builder: org.sonar.plugins.csharp.CSharpGlobalProtobufFileProcessor
build	29-Jul-2022 08:38:07	08:38:07.396 DEBUG: Execute project builder: org.sonar.plugins.vbnet.VbNetGlobalProtobufFileProcessor
build	29-Jul-2022 08:38:07	08:38:07.397 INFO: Execute project builders (done) | time=1ms
build	29-Jul-2022 08:38:07	08:38:07.407 INFO: Project key: CommercialProperty:Property.Claims.ReceiptAndAcceptance.API
build	29-Jul-2022 08:38:07	08:38:07.407 INFO: Base dir: E:\bamboo-agent-home\xml-data\build-dir\UWR-APCRAASR-AAEJ\VRSK.PropertyReceiptAndAcceptance.API
build	29-Jul-2022 08:38:07	08:38:07.407 INFO: Working dir: E:\bamboo-agent-home\xml-data\build-dir\UWR-APCRAASR-AAEJ\VRSK.PropertyReceiptAndAcceptance.API\.scannerwork
build	29-Jul-2022 08:38:07	08:38:07.407 DEBUG: Project global encoding: windows-1252, default locale: en_US
build	29-Jul-2022 08:38:07	08:38:07.409 DEBUG: Creating module hierarchy
build	29-Jul-2022 08:38:07	08:38:07.409 DEBUG:   Init module 'Property.Claims.ReceiptAndAcceptance'
build	29-Jul-2022 08:38:07	08:38:07.410 DEBUG:     Base dir: E:\bamboo-agent-home\xml-data\build-dir\UWR-APCRAASR-AAEJ\VRSK.PropertyReceiptAndAcceptance.API
build	29-Jul-2022 08:38:07	08:38:07.410 DEBUG:     Working dir: E:\bamboo-agent-home\xml-data\build-dir\UWR-APCRAASR-AAEJ\VRSK.PropertyReceiptAndAcceptance.API\.scannerwork
build	29-Jul-2022 08:38:07	08:38:07.410 DEBUG:     Module global encoding: windows-1252, default locale: en_US
build	29-Jul-2022 08:38:07	08:38:07.599 INFO: Load project settings for component key: 'CommercialProperty:Property.Claims.ReceiptAndAcceptance.API'
build	29-Jul-2022 08:38:07	08:38:07.618 DEBUG: GET 200 https://codescan.verisk.com/sonar/api/settings/values.protobuf?component=CommercialProperty%3AProperty.Claims.ReceiptAndAcceptance.API | time=19ms
build	29-Jul-2022 08:38:07	08:38:07.619 INFO: Load project settings for component key: 'CommercialProperty:Property.Claims.ReceiptAndAcceptance.API' (done) | time=20ms
build	29-Jul-2022 08:38:07	08:38:07.648 DEBUG: Available languages:
build	29-Jul-2022 08:38:07	08:38:07.649 DEBUG:   * Neutral => "neutral"
build	29-Jul-2022 08:38:07	08:38:07.649 DEBUG:   * Python => "py"
build	29-Jul-2022 08:38:07	08:38:07.649 DEBUG:   * CSS => "css"
build	29-Jul-2022 08:38:07	08:38:07.649 DEBUG:   * Go => "go"
build	29-Jul-2022 08:38:07	08:38:07.649 DEBUG:   * Kotlin => "kotlin"
build	29-Jul-2022 08:38:07	08:38:07.649 DEBUG:   * JavaScript => "js"
build	29-Jul-2022 08:38:07	08:38:07.649 DEBUG:   * TypeScript => "ts"
build	29-Jul-2022 08:38:07	08:38:07.649 DEBUG:   * Ruby => "ruby"
build	29-Jul-2022 08:38:07	08:38:07.649 DEBUG:   * Scala => "scala"
build	29-Jul-2022 08:38:07	08:38:07.649 DEBUG:   * C# => "cs"
build	29-Jul-2022 08:38:07	08:38:07.649 DEBUG:   * Groovy => "grvy"
build	29-Jul-2022 08:38:07	08:38:07.650 DEBUG:   * Java => "java"
build	29-Jul-2022 08:38:07	08:38:07.650 DEBUG:   * HTML => "web"
build	29-Jul-2022 08:38:07	08:38:07.650 DEBUG:   * JSP => "jsp"
build	29-Jul-2022 08:38:07	08:38:07.650 DEBUG:   * Flex => "flex"
build	29-Jul-2022 08:38:07	08:38:07.650 DEBUG:   * XML => "xml"
build	29-Jul-2022 08:38:07	08:38:07.650 DEBUG:   * PHP => "php"
build	29-Jul-2022 08:38:07	08:38:07.650 DEBUG:   * VB.NET => "vbnet"
build	29-Jul-2022 08:38:07	08:38:07.659 INFO: Auto-configuring with CI 'Bamboo'
build	29-Jul-2022 08:38:07	08:38:07.660 INFO: Load quality profiles
build	29-Jul-2022 08:38:07	08:38:07.687 DEBUG: GET 200 https://codescan.verisk.com/sonar/api/qualityprofiles/search.protobuf?project=CommercialProperty%3AProperty.Claims.ReceiptAndAcceptance.API | time=27ms
build	29-Jul-2022 08:38:07	08:38:07.717 INFO: Load quality profiles (done) | time=57ms
build	29-Jul-2022 08:38:07	08:38:07.721 INFO: Auto-configuring with CI 'Bamboo'
build	29-Jul-2022 08:38:07	08:38:07.724 INFO: Load active rules
build	29-Jul-2022 08:38:07	08:38:07.734 DEBUG: GET 200

Hi,

This log ends prematurely.

 
Ann

@ganncamp attached full log.
plan-1885538326-AAEJ-542.log (319.2 KB)

Hi,

Thanks for the log.

...D:\Development Tools\sonar-scanner-4.6.2\bin\sonar-scanner.bat ...
...
...WARN: Your project contains C# files which cannot be analyzed with the scanner you are using. To analyze C# or VB.NET, you must use the SonarScanner for .NET 5.x or higher, see https://redirect.sonarsource.com/doc/install-configure-scanner-msbuild.html

You need to analyze with the SonarScanner for .NET. Simply using the correct scanner may clear this up. But before I close…

I notice your analysis command contains a number of extra parameters:

  • -Dsonar.language=cs
    this does nothing; it was removed years ago
  • -Dsonar.dotnet.visualstudio.testProjectPattern=*.Test*
    -Dsonar.dotnet.visualstudio.solution.file=Property.Claims.ReceiptAndAcceptance.API.sln
    -Dsonar.dotnet.buildConfiguration=Debug
    These I don’t recognize (not shocking since .NET isn’t my specialty), and I’m not finding any parameters starting sonar.dotnet in the docs
  • -Dsonar.sources=. when you analyze with the SonarScanner for .NET, your sources are discovered during the build. This is becomes redundant at best and should be dropped.

 
HTH,
Ann

@ganncamp thanks for your review and comment. Let me configure based on your recommendation and let you know the feedback,

@ganncamp, still having issues after updating dotnet sonarscanner (sonar-scanner-msbuild-5.7.2.50892-net5.0). Attached update logs. please review and let me know your suggestions:
plan-1885538326-AAEJ-551.log (317.8 KB)

Hi,

Could you flesh this out with some detail?

 
Ann

@ganncamp As per your recommendations I did changed to SonarScanner for .NET (sonar-scanner-msbuild-5.7.2.50892-net5.0) to run this build plan from Bamboo application. But still code coverage is not updating.

Here is the command: = \nd:\Development Tools\dotnet\tools\sonar-scanner-msbuild-5.7.2.50892-net5.0\sonar-scanner-4.7.0.2747\bin\sonar-scanner.bat -Dsonar.projectKey=CommercialProperty:Property.Claims.ReceiptAndAcceptance.API "-Dsonar.projectName=Property.Claims.ReceiptAndAcceptance" -Dsonar.projectVersion=${bamboo.CPVersion_Property.Claims.ReceiptAndAcceptance.API_Autoupdate}.0-SNAPSHOT -Dsonar.cs.nunit.reportsPaths=TestResult.xml -Dsonar.cs.opencover.reportsPaths=coverage.xml -Dsonar.dotnet.visualstudio.testProjectPattern=*.Test* -Dsonar.language=cs -Dsonar.dotnet.visualstudio.solution.file=Property.Claims.ReceiptAndAcceptance.API.sln -Dsonar.dotnet.buildConfiguration=Debug -Dsonar.sources=. -Dsonar.cs.fxcop.directories=Lib,packages -Dsonar.cs.fxcop.aspnet=false -X -Dsonar.login=********\n ... in: E:\bamboo-agent-home\xml-data\build-dir\UWR-APCRAASR-AAEJ\VRSK.PropertyReceiptAndAcceptance.API\n

Hi,

What problem are you having? No problem is obvious to me from the log.

 
Ann

@ganncamp code coverage report not showing, here is the attached report shows no coverage.