ERROR: Caused by: Unknown report version: 0. This parser only handles version 1

I am using SonarQube Server - 2025.3. SonarQube is deployed using Docker. I am trying to get unit test coverage for my C++ project on sonar server which is built using msbuild. I am using opencppcoverage to generate coverage report in cobertura format.
It generated the report successfully.
However, sonar scanner is throwing error stating:
“ERROR: Caused by: Unknown report version: 0. This parser only handles version 1.”
I strongly believe that sonarqube supports cobertura reports.
I am using sonar.cfamily.cobertura.reportPaths parameter.

I am currently stuck and unable to proceed further.

Hey Sumit,

Are you also passing the report to sonar.coverageReportPaths? That’s the only situation where this error should pop up.

Thanks Colin for reverting.
I am not passing report to sonar.coverageReportPaths, but instead I’m using sonar.cfamily.cobertura.reportPaths. Also, scanner_version is 9.0.2.104486, checked it with 10.2.0.117568 but still no success.

I feel my script is fine, can you review it? It looks something like this:

Input:
OpenCppCoverage.exe --export_type cobertura:coverage.xml --sources <my_project> --excluded_sources <my_test_project> – <path_to_my_test_project.exe>

call sonar-scanner.bat -D"sonar.projectKey=<Project_key>" -D"sonar.sources=<my_project>" -D"sonar.cfamily.build-wrapper-output=bw-output" -D"sonar.cfamily.cobertura.reportPaths=coverage.xml" -D"sonar.host.url=<my_sonar_server_url>" -D"sonar.token=<my_sonar_token>"

Output:
.
.
.
ERROR: Error during SonarScanner execution
ERROR: Error during parsing of the generic coverage report ‘coverage.xml’. Look at SonarQube documentation to know the expected XML format.
ERROR: Caused by: Unknown report version: 0. This parser only handles version 1.
.
.
.

Hello,

It looks like something is being passed to sonar.coverageReportPaths.

I recommend reviewing your configuration files, such as sonar-project.properties, to see where sonar.coverageReportPaths is being set, and remove it.

Hi,
I am using sonar scanner CLI version 5.0.1.3006, can you confirm if it supports cobertura format coverage report?
Or can I use version 5.0.2.4997?
Does SonarScanner 5.0.2.4997 support cobertura format coverage report?

The Scanner version is not important in this context. SonarQube v2025.3 supports importing Cobertura reports for C/C++ code using the sonar.cfamily.cobertura.reportPaths property.

The main issue is that your analysis is failing because the scanner is trying to process a report that either shouldn’t be set or isn’t configured correctly. The next step is to identify where this configuration is set and adjust it (possibly remove it).

1 Like

Thanks, I mistakenly added sonar.coverageReportPaths in project file, its working now.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.