Running Sonarqube in jenkins gives me the following error and is not uploading the results

I have built our c-sharp solution, and we use dotcover for code coverage

the following is the output generated.

C:\Client\DEV\DEV_3.3.0\TEST> SonarScanner.MSBuild.exe begin /k:"Client-3.3.0" /n:"Client-3.3.0" /v:"2.0" /d:sonar.cs.dotcover.reportsPaths="C:\Client\DEV\DEV_3.3.0\TEST\CoverageReport.html"

SonarScanner for MSBuild 4.4.2
Using the .NET Framework version of the Scanner for MSBuild
Default properties file was found at C:\sonarqube\msbuild\SonarQube.Analysis.xml`
Loading analysis properties from C:\sonarqube\msbuild\SonarQube.Analysis.xml
Pre-processing started.
Preparing working directories...
15:19:13.733  Updating build integration targets...
15:19:13.766  Fetching analysis configuration settings...
15:19:14.075  Provisioning analyzer assemblies for cs...
15:19:14.077  Installing required Roslyn analyzers...
15:19:14.203  Pre-processing succeeded.

C:\Client\DEV\DEV_3.3.0\TEST>msbuild ..\source\Clientside.sln

300 Warning(s)
0 Error(s)
Time Elapsed 00:03:06.10

Now, as explained in the website sonarqube-dotcover, i ran the dotcover

C:\Client\DEV\DEV_3.3.0\TEST> dotcover analyse /ReportType=HTML /Output="C:\Client\DEV\DEV_3.3.0\TEST\CoverageReport.html" /TargetExecutable="C:\Client\DEV\DEV_3.3.0\3rdparty\NUnit.Console-3.9.0\nunit3-console.exe" /TargetArguments="C:\Client\DEV\DEV_3.3.0\TEST\ClientTest.nunit"

And this is the output after i ran the sonarscanner end operation.

C:\Client\DEV\DEV_3.3.0\TEST>SonarScanner.MSBuild.exe end
SonarScanner for MSBuild 4.4.2
Using the .NET Framework version of the Scanner for MSBuild
Default properties file was found at C:\sonarqube\msbuild\SonarQube.Analysis.xml
Loading analysis properties from C:\sonarqube\msbuild\SonarQube.Analysis.xml
Post-processing started.
SONAR_SCANNER_OPTS is not configured. Setting it to the default value of -Xmx1024m
Calling the SonarQube Scanner...
INFO: Scanner configuration file: C:\sonarqube\msbuild\sonar-scanner-\bin\..\conf\
INFO: Project root configuration file: C:\Client\DEV\DEV_3.3.0\TEST\.sonarqube\out\
INFO: Sensor SonarJavaXmlFileSensor [java]
INFO: Sensor SonarJavaXmlFileSensor [java] (done) | time=4ms
INFO: Sensor Analyzer for "php.ini" files [php]
INFO: Sensor Analyzer for "php.ini" files [php] (done) | time=3ms
INFO: No SCM system was detected. You can use the 'sonar.scm.provider' property to explicitly specify it.


INFO: Source encoding: windows-1252, default locale: en_US
INFO: Index files
INFO: 5 files indexed
INFO: Quality profile for cs: Sonar way
INFO: Sensor C# [csharp]
INFO: Importing analysis results from C:\Client\DEV\DEV_3.3.0\TEST\null\output-cs
INFO: Sensor C# [csharp] (done) | time=6ms
INFO: Sensor SonarJavaXmlFileSensor [java]
INFO: Sensor SonarJavaXmlFileSensor [java] (done) | time=0ms
INFO: Sensor Analyzer for "php.ini" files [php]
INFO: Sensor Analyzer for "php.ini" files [php] (done) | time=1ms
INFO: Sensor C# Tests Coverage Report Import [csharp]
INFO: Aggregating the HTML reports from C:\Client\DEV\DEV_3.3.0\TEST\CoverageReport.html
INFO: Parsing the dotCover report C:\Client\DEV\DEV_3.3.0\TEST\CoverageReport\src\1.html
INFO: Parsing the dotCover report C:\Client\DEV\DEV_3.3.0\TEST\CoverageReport\src\10.html
INFO: Parsing the dotCover report C:\Client\DEV\DEV_3.3.0\TEST\CoverageReport\src\100.html
INFO: Parsing the dotCover report C:\Client\DEV\DEV_3.3.0\TEST\CoverageReport\src\101.html
INFO: Parsing the dotCover report C:\Client\DEV\DEV_3.3.0\TEST\CoverageReport\src\102.html
INFO: Parsing the dotCover report C:\Client\DEV\DEV_3.3.0\TEST\CoverageReport\src\103.html


INFO: Adding this code coverage report to the cache for later reuse: C:\Client\DEV\DEV_3.3.0\TEST\CoverageReport.html
INFO: ------------------------------------------------------------------------
INFO: ------------------------------------------------------------------------
**INFO: Total time: 22.134s**

** INFO: Final Memory: 11M/44M**
** INFO: ------------------------------------------------------------------------**
** ERROR: Error during SonarQube Scanner execution**
** ERROR: Line 129 is out of range in the file source/PipeClient.cs (lines: 128)**
** ERROR:**
** The SonarQube Scanner did not complete successfully**
** 15:10:44.674 Creating a summary markdown file…**
** 15:10:44.685 Post-processing failed. Exit code: 1**


Contents of the ClientTest.nunit file contains paths to various dlls’

And if I run the same commands through jenkins, i get this error :

INFO: Source encoding: UTF-8, default locale: en_US
INFO: ------------------------------------------------------------------------
INFO: ------------------------------------------------------------------------
INFO: Total time: 14.850s
INFO: Final Memory: 7M/85M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: Unable to load component class org.sonar.scanner.phases.AbstractPhaseExecutor
ERROR: Caused by: Unable to load component class org.sonar.scanner.issue.ignore.scanner.IssueExclusionsLoader
ERROR: Caused by: Dangling meta character '*' near index 0
The SonarQube Scanner did not complete successfully
21:11:25.365  Creating a summary markdown file...
21:11:25.369  Post-processing failed. Exit code: 1
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succedeed?
ERROR: Execution of SonarScanner for MSBuild failed (exit code 1)
Archiving artifacts
Extended Email Publisher is currently disabled in project settings
Finished: FAILURE

Very rarely i could see, sonarqube compiles and gives results, but if i check on the coverage it says 0.0%

FYI, i am using the following tools

  • dotcover Version: 2018.3.1

  • sonarqube - LTS - 6.7.x

  • MSBuild version (as in the output - 4.4.2)

P.S the problem is, the dotcover , after the analysis, able to generate the .html file, and i can see the results in it, but i am not able to see that in sonarqube. either it throws the above erros or it shoes 0.0% have given the additional arguments also :

I have another question, as you can see in the above printed logs, sonarqube creates a separate coverage report and adds all the code in html format and tries to compress them.
Not sure what is this operation.

Pleae help, as i am stuck in this for a week. its very important.

Hi @r.kumar,

Could you try to re-run another analysis but skipping the code coverage? Could you confirm that doing so the analysis works properly?

If so, there might be something we don’t parse properly in the html of the code coverage. Could you share the one failing? It seems to be C:\Client\DEV\DEV_3.3.0\TEST\CoverageReport\src\103.html.


1 Like

Thanks for the reply.
im trying ! will update in few mins

ya, it works completely fine without dotcover code coverage in jenkins.
i think as you said, ts the html parsing where it fails.

attaching some logs.
INFO: CPD calculation finished
INFO: Analysis report generated in 15824ms, dir size=20 MB
INFO: Analysis reports compressed in 11335ms, zip size=7 MB
INFO: Analysis report uploaded in 617ms
INFO: ANALYSIS SUCCESSFUL, you can browse http:// . ./dashboard/index/client-2.0
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at http:// . ./api/ce/task?id=AWg9uNJA3oHAopXOffA3
INFO: Task total time: 1:52.034 s
INFO: ------------------------------------------------------------------------
INFO: ------------------------------------------------------------------------
INFO: Total time: 2:04.021s
INFO: Final Memory: 12M/595M
INFO: ------------------------------------------------------------------------
The SonarQube Scanner has finished
10:22:40.398 Creating a summary markdown file…
10:22:40.426 Analysis results: http:// . ./dashboard/index/client-2.0
10:22:40.427 Post-processing succeeded.
Archiving artifacts
Extended Email Publisher is currently disabled in project settings
Finished: SUCCESS

can you please suggest some workaround or fix as it is very important, the dotcover results in sonarqube triggered in jenkins.


Could you share the file C:\Client\DEV\DEV_3.3.0\TEST\CoverageReport\src\103.html which seems to be the last one parsed before the failure?

actually it is not open source code. it may go against our company policy, so i cannot share. sorry, :cry: these html files , as you know , are the csharp files of our project. there were around 400-500 files generated, i just shared a snapshot of it.

any other way ? thanks.

But all the *.html files that are inside the generated ClientCoverageReport folder, when i run the command SonarScanner.MSBuild.exe end, has the following structure.

<!DOCTYPE html>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <script type="text/javascript" src="../js/dotcover.sourceview.js"></script>
    <link rel="stylesheet" type="text/css" href="../css/" />
    <pre id="content" class="source-code">
using namespace1;
using namespace2;
namespace ns1 {
public class : interface1 {


<script type="text/javascript">

Any help ? thanks.

Fortunately, when i tried running it now, it works,

but still there is a problem

but the coverage shows 0.0%

when i click on it, it unfortuantely shows only the .js , .css files

it doesnt have any c-sharp files.

but the ClientCoverageReport.html file, that is generated via dotcover, it has c# files and the coverage percentage also, but it is not getting integrated into sonarqube, as you can see it is giving 0.0%

please help. Thanks.

Archiving this topic due a lack of activity. If you have a similar problem please start a new topic. Thank you.