Error during SonarQube Scanner execution: java.lang.OutOfMemoryError: GC overhead limit exceeded

Set Up

  • SonarQube 7.1 running in a docker container
  • Jenkins 2.138.2 build running in a docker container
  • .NET Core 2.1.4
  • dotnet-sonarscanner global tool 4.4.2

Things I’ve Tried

  • Setting the SONAR_SCANNER_OPTS to -Xms1024m -Xmx2048m
  • Limiting scanning to only *.cs files
  • I’m able to submit scans from my local Windows machine…it just doesn’t work when the scan is run on linux in a docker container via Jenkins

This project has less than 5K lines of code so I don’t understand the memory issues.

Jenkins log
[rate-sonarqube-with-jenkins-NGP4SELAKNIG6M2Y5OEW4JAF2UZRPEGW7C7XATBSF4Y4JZT2BFFQ@2] Running shell script
+ docker build -t [DOCKER_TAG] --file tests/Dockerfile --build-arg VERSION=0.0.30-MIT-91-integrate-son --build-arg SONAR_HOST_URL=[SONAR_HOST_URL]) .
Sending build context to Docker daemon 578.6kB
Step 1/18 : FROM microsoft/dotnet:2.1.403-sdk
—> efa6f1f55357
Step 2/18 : WORKDIR /
—> Using cache
—> 308628251bd1
Step 3/18 : RUN apt-get update && apt-get install -y openjdk-8-jre
—> Using cache
—> 466e709a12fb
Step 4/18 : RUN echo “$JAVA_HOME”
—> Using cache
—> d5719bbc2b85
Step 5/18 : ENV PATH="$PATH:/root/.dotnet/tools"
—> Using cache
—> fd13e9ba5ce9
Step 6/18 : RUN dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.0.0-rc10
—> Using cache
—> 2ea22523983e
Step 7/18 : RUN dotnet tool install --global dotnet-sonarscanner
—> Using cache
—> 3a2def542009
Step 8/18 : COPY . ./
—> a76ac2dec0fe
Step 9/18 : RUN dotnet test --logger:“trx;LogFileName=TestResults.trx” /p:CollectCoverage=true /p:CoverletOutput=/tests/TestResults/Coverage/ /p:CoverletOutputFormat=opencover /p:Exclude="[NUnit3.TestAdapter]" tests/tests.csproj
—> Running in 1eb4818f34fe
Build started, please wait…
PrometheusExceptionHandler.cs(12,44): warning CS1998: This async method lacks ‘await’ operators and will run synchronously. Consider using the ‘await’ operator to await non-blocking API calls, or ‘await Task.Run(…)’ to do CPU-bound work on a background thread. [/src/notes/notes.csproj]
Build completed.
Test run for /tests/bin/Debug/netcoreapp2.1/tests.dll(.NETCoreApp,Version=v2.1)
Microsoft ® Test Execution Command Line Tool Version 15.8.0
Copyright © Microsoft Corporation. All rights reserved.
Starting test execution, please wait…
Results File: /tests/TestResults/TestResults.trx
Total tests: 13. Passed: 13. Failed: 0. Skipped: 0.
Test Run Successful.
Test execution time: 1.8635 Seconds
Calculating coverage result…
Generating report ‘/tests/TestResults/Coverage/coverage.opencover.xml’
±-------±-------±-------±-------+
| Module | Line | Branch | Method |
±-------±-------±-------±-------+
| notes | 18.1% | 18.8% | 23.3% |
±-------±-------±-------±-------+
Removing intermediate container 1eb4818f34fe
—> d41c5b40db6f

Step 11/18 : RUN dotnet build-server shutdown
—> Running in d838e104273a
Shutting down MSBuild server…
Shutting down VB/C# compiler server…
MSBuild server shut down successfully.
VB/C# compiler server shut down successfully.
Removing intermediate container d838e104273a
—> e2b043fa8598
Step 12/18 : ARG VERSION
—> Running in 4d64259ab4d1
Removing intermediate container 4d64259ab4d1
—> 682556ca9543
Step 13/18 : ARG SONAR_HOST_URL
—> Running in dad3ed4daebf
Removing intermediate container dad3ed4daebf
—> 51a5aa8ea974
Step 14/18 : ENV SONAR_SCANNER_OPTS="-Xms1024m -Xmx2048m"
—> Running in 96c0a755ed0d
Removing intermediate container 96c0a755ed0d
—> 802804fb2072
Step 15/18 : RUN dotnet sonarscanner begin /n:“appdev/notes-service” /k:“notes-service” /v:$VERSION /d:sonar.host.url=$SONAR_HOST_URL /s:“pwdSonarQube.Analysis.xml”
—> Running in 436695bcb206
SonarScanner for MSBuild 4.4.2
Using the .NET Core version of the Scanner for MSBuild
Loading analysis properties from /SonarQube.Analysis.xml
sonar.verbose=true was specified - setting the log verbosity to ‘Debug’
Pre-processing started.
Preparing working directories…
Using environment variables to determine the download directory…
Creating directory: /.sonarqube
18:19:42.312 18:19:42.304 Loading analysis properties from /SonarQube.Analysis.xml
18:19:42.312 18:19:42.312 sonar.verbose=true was specified - setting the log verbosity to ‘Debug’
18:19:42.318 Updating build integration targets…
18:19:42.321 Installed SonarQube.Integration.ImportBefore.targets to /root/.local/share/Microsoft/MSBuild/4.0/Microsoft.Common.targets/ImportBefore
18:19:42.321 Installed SonarQube.Integration.ImportBefore.targets to /root/.local/share/Microsoft/MSBuild/10.0/Microsoft.Common.targets/ImportBefore
18:19:42.321 Installed SonarQube.Integration.ImportBefore.targets to /root/.local/share/Microsoft/MSBuild/11.0/Microsoft.Common.targets/ImportBefore
18:19:42.322 Installed SonarQube.Integration.ImportBefore.targets to /root/.local/share/Microsoft/MSBuild/12.0/Microsoft.Common.targets/ImportBefore
18:19:42.322 Installed SonarQube.Integration.ImportBefore.targets to /root/.local/share/Microsoft/MSBuild/14.0/Microsoft.Common.targets/ImportBefore
18:19:42.322 Installed SonarQube.Integration.ImportBefore.targets to /root/.local/share/Microsoft/MSBuild/15.0/Microsoft.Common.targets/ImportBefore
18:19:42.323 Installed SonarQube.Integration.ImportBefore.targets to /root/Microsoft/MSBuild/15.0/Microsoft.Common.targets/ImportBefore
18:19:42.324 Installed SonarQube.Integration.targets to /.sonarqube/bin/targets
18:19:42.326 Creating config and output folders…
18:19:42.326 Creating directory: /.sonarqube/conf
18:19:42.326 Creating directory: /.sonarqube/out
18:19:42.338 Fetching analysis configuration settings…

18:19:50.121 Local analyzer cache: /tmp/.sonarqube/resources
18:19:50.131 Writing Roslyn generated ruleset to /.sonarqube/conf/SonarQubeRoslyn-cs.ruleset…
18:19:50.155 Writing Roslyn analyzer additional file to /.sonarqube/conf/cs/SonarLint.xml…
18:19:50.158 Provisioning analyzer assemblies for cs…
18:19:50.159 Installing required Roslyn analyzers…
18:19:50.159 Processing plugin: csharp version 7.0.1.4822
18:19:50.253 Cache miss: plugin files were not found in the local cache
18:19:50.255 Fetching resource for plugin: csharp, version 7.0.1.4822. Resource: SonarAnalyzer-7.0.1.4822.zip
18:19:50.256 Downloading SonarAnalyzer-7.0.1.4822.zip from [SONAR_HOST_URL]/static/csharp/SonarAnalyzer-7.0.1.4822.zip to /tmp/.sonarqube/resources/0
18:19:50.256 Downloading file from [SONAR_HOST_URL]/static/csharp/SonarAnalyzer-7.0.1.4822.zip to /tmp/.sonarqube/resources/0/SonarAnalyzer-7.0.1.4822.zip…
18:19:51.525 Extracting files to /tmp/.sonarqube/resources/0…
18:19:51.564 Pre-processing succeeded.
Removing intermediate container 436695bcb206
—> 689f49110f54
Step 16/18 : RUN dotnet build
—> Running in 2b68fc11dcdb
Microsoft ® Build Engine version 15.8.169+g1ccb72aefa for .NET Core
Copyright © Microsoft Corporation. All rights reserved.
Restoring packages for /tests/tests.csproj…
Restoring packages for /src/notes/notes.csproj…
Restore completed in 706.97 ms for /src/notes/notes.csproj.
Restore completed in 730.09 ms for /tests/tests.csproj.

notes -> /src/notes/bin/Debug/netcoreapp2.1/notes.dll
tests -> /tests/bin/Debug/netcoreapp2.1/tests.dll
Build succeeded.

21 Warning(s)
0 Error(s)
Time Elapsed 00:00:12.23
Removing intermediate container 2b68fc11dcdb
—> f88b04942ab5
Step 17/18 : RUN dotnet sonarscanner end
—> Running in a4eb04906208
SonarScanner for MSBuild 4.4.2
Using the .NET Core version of the Scanner for MSBuild
Default properties file was found at /root/.dotnet/tools/.store/dotnet-sonarscanner/4.4.2/dotnet-sonarscanner/4.4.2/tools/netcoreapp2.1/any/SonarQube.Analysis.xml
Loading analysis properties from /root/.dotnet/tools/.store/dotnet-sonarscanner/4.4.2/dotnet-sonarscanner/4.4.2/tools/netcoreapp2.1/any/SonarQube.Analysis.xml
Post-processing started.
18:20:05.597 Loading the SonarQube analysis config from /.sonarqube/conf/SonarQubeAnalysisConfig.xml
18:20:05.598 Not running under TeamBuild
18:20:05.599 Analysis base directory: /.sonarqube
Build directory:
Bin directory: /.sonarqube/bin
Config directory: /.sonarqube/conf
Output directory: /.sonarqube/out
Config file: /.sonarqube/conf/SonarQubeAnalysisConfig.xml
Generating SonarQube project properties file to /.sonarqube/out/sonar-project.properties
Setting analysis property: sonar.visualstudio.enable=false
The supplied Code Analysis ErrorLog file is a valid json file and does not need to be fixed: /src/notes/bin/Debug/netcoreapp2.1/notes.dll.RoslynCA.json
The supplied Code Analysis ErrorLog file is a valid json file and does not need to be fixed: /tests/bin/Debug/netcoreapp2.1/tests.dll.RoslynCA.json
Using longest common projects root path as project base directory: ‘/’.
Dumping content of sonar-project.properties
------------------------------------------------------------------------
sonar.projectKey=notes-service
sonar.projectName=appdev/notes-service
sonar.projectVersion=0.0.30-MIT-91-integrate-son
sonar.working.directory=/.sonarqube/out/.sonar
sonar.projectBaseDir=/
sonar.sources=
“/root/.nuget/packages/nunit3testadapter/3.10.0/build/netcoreapp1.0/NUnit3.TestAdapter.dll”,
“/root/.nuget/packages/nunit3testadapter/3.10.0/build/netcoreapp1.0/NUnit3.TestAdapter.pdb”,
“/root/.nuget/packages/nunit3testadapter/3.10.0/build/netcoreapp1.0/nunit.engine.netstandard.dll”,
“/root/.nuget/packages/nunit3testadapter/3.10.0/build/netcoreapp1.0/Mono.Cecil.dll”
72003307-FF91-4121-AA7E-2F668E1343FD.sonar.projectKey=notes-service:72003307-FF91-4121-AA7E-2F668E1343FD
72003307-FF91-4121-AA7E-2F668E1343FD.sonar.projectName=notes
72003307-FF91-4121-AA7E-2F668E1343FD.sonar.projectBaseDir=/src/notes
72003307-FF91-4121-AA7E-2F668E1343FD.sonar.sourceEncoding=utf-8
72003307-FF91-4121-AA7E-2F668E1343FD.sonar.sources=

72003307-FF91-4121-AA7E-2F668E1343FD.sonar.cs.roslyn.reportFilePath=/src/notes/bin/Debug/netcoreapp2.1/notes.dll.RoslynCA.json
72003307-FF91-4121-AA7E-2F668E1343FD.sonar.cs.analyzer.projectOutPath=/.sonarqube/out/0
72003307-FF91-4121-AA7E-2F668E1343FD.sonar.cs.analyzer.projectOutPaths=
“/.sonarqube/out/0”
72003307-FF91-4121-AA7E-2F668E1343FD.sonar.cs.roslyn.reportFilePaths=
“/src/notes/bin/Debug/netcoreapp2.1/notes.dll.RoslynCA.json”
F746B049-01C7-4C38-82B0-ED7B5BA478F0.sonar.projectKey=notes-service:F746B049-01C7-4C38-82B0-ED7B5BA478F0
F746B049-01C7-4C38-82B0-ED7B5BA478F0.sonar.projectName=tests
F746B049-01C7-4C38-82B0-ED7B5BA478F0.sonar.projectBaseDir=/tests
F746B049-01C7-4C38-82B0-ED7B5BA478F0.sonar.sourceEncoding=utf-8
F746B049-01C7-4C38-82B0-ED7B5BA478F0.sonar.sources=

F746B049-01C7-4C38-82B0-ED7B5BA478F0.sonar.cs.roslyn.reportFilePath=/tests/bin/Debug/netcoreapp2.1/tests.dll.RoslynCA.json
F746B049-01C7-4C38-82B0-ED7B5BA478F0.sonar.cs.analyzer.projectOutPath=/.sonarqube/out/1
F746B049-01C7-4C38-82B0-ED7B5BA478F0.sonar.cs.analyzer.projectOutPaths=
“/.sonarqube/out/1”
F746B049-01C7-4C38-82B0-ED7B5BA478F0.sonar.cs.roslyn.reportFilePaths=
“/tests/bin/Debug/netcoreapp2.1/tests.dll.RoslynCA.json”
sonar.host.url=[SONAR_HOST_URL]
sonar.cs.opencover.reportsPaths=/coverage.opencover.xml
sonar.cs.vstest.reportsPaths=
/TestResults/
.trx
sonar.coverage.exclusions=Test.cs
sonar.inclusions=
*/.cs
sonar.sourceEncoding=UTF-8
sonar.visualstudio.enable=false
sonar.modules=72003307-FF91-4121-AA7E-2F668E1343FD,F746B049-01C7-4C38-82B0-ED7B5BA478F0
------------------------------------------------------------------------
Writing processing summary to /.sonarqube/out/ProjectInfo.log
SONAR_SCANNER_OPTS is already set. Value: -Xms1024m -Xmx2048m
Calling the SonarQube Scanner…
Overwriting the value of environment variable ‘SONAR_SCANNER_OPTS’. Old value: -Xms1024m -Xmx2048m, new value: -Xms1024m -Xmx2048m
Executing file /root/.dotnet/tools/.store/dotnet-sonarscanner/4.4.2/dotnet-sonarscanner/4.4.2/tools/netcoreapp2.1/any/sonar-scanner-3.2.0.1227/bin/sonar-scanner
Args: -Dsonar.scanAllFiles=true -Dproject.settings=/.sonarqube/out/sonar-project.properties --embedded --debug
Working directory: /
Timeout (ms):-1
Process id: 32
18:20:06.050 INFO: Scanner configuration file: /root/.dotnet/tools/.store/dotnet-sonarscanner/4.4.2/dotnet-sonarscanner/4.4.2/tools/netcoreapp2.1/any/sonar-scanner-3.2.0.1227/conf/sonar-scanner.properties
18:20:06.054 INFO: Project root configuration file: /.sonarqube/out/sonar-project.properties
18:20:06.079 INFO: SonarQube Scanner 3.2.0.1227
18:20:06.079 INFO: Java 1.8.0_181 Oracle Corporation (64-bit)
18:20:06.079 INFO: Linux 3.10.0-693.21.1.el7.x86_64 amd64
18:20:06.079 INFO: SONAR_SCANNER_OPTS=-Xms1024m -Xmx2048m
18:20:06.285 DEBUG: keyStore is :
18:20:06.285 DEBUG: keyStore type is : jks
18:20:06.285 DEBUG: keyStore provider is :
18:20:06.285 DEBUG: init keystore
18:20:06.286 DEBUG: init keymanager of type SunX509
18:20:06.363 DEBUG: Create: /root/.sonar/cache
18:20:06.364 INFO: User cache: /root/.sonar/cache
18:20:06.364 DEBUG: Create: /root/.sonar/cache/_tmp
18:20:06.367 DEBUG: Extract sonar-scanner-api-batch in temp…
18:20:06.375 DEBUG: Get bootstrap index…
18:20:06.375 DEBUG: Download: [SONAR_HOST_URL]/batch/index
18:20:07.093 DEBUG: Get bootstrap completed
18:20:07.101 DEBUG: Download [SONAR_HOST_URL]/batch/file?name=sonar-scanner-engine-shaded-7.1-all.jar to /root/.sonar/cache/_tmp/fileCache556173601065454841.tmp
18:20:40.884 DEBUG: Create isolated classloader…
18:20:40.891 DEBUG: Start temp cleaning…
18:20:40.898 DEBUG: Temp cleaning done
18:20:40.898 DEBUG: Execution getVersion
18:20:40.900 INFO: SonarQube server 7.1.0
18:20:40.901 INFO: Default locale: “en_US”, source code encoding: “UTF-8”
18:20:40.901 DEBUG: Work directory: /.sonarqube/out/.sonar
18:20:40.902 DEBUG: Execution execute
18:20:41.087 INFO: Publish mode
18:20:41.201 INFO: Load global settings
18:20:41.732 DEBUG: GET 200 [SONAR_HOST_URL]/api/settings/values.protobuf | time=521ms
18:20:41.754 INFO: Load global settings (done) | time=554ms
18:20:41.760 INFO: Server id: AWZ5bLVvcA8aMe32SNqZ
18:20:41.769 INFO: User cache: /root/.sonar/cache
18:20:41.955 INFO: Load plugins index
18:20:42.048 DEBUG: GET 200 [SONAR_HOST_URL]/api/plugins/installed | time=92ms
18:20:42.082 INFO: Load plugins index (done) | time=127ms
18:20:42.082 INFO: Load/download plugins

18:21:21.706 DEBUG: Plugins:
18:21:21.706 DEBUG: * SonarC# 7.0.1.4822 (csharp)
18:21:21.707 DEBUG: * SonarPython 1.9.1.2080 (python)
18:21:21.707 DEBUG: * SonarJava 5.2.0.13398 (java)
18:21:21.707 DEBUG: * Git 1.4.0.1037 (scmgit)
18:21:21.707 DEBUG: * SonarFlex 2.4.0.1222 (flex)
18:21:21.707 DEBUG: * SonarXML 1.5.0.1373 (xml)
18:21:21.707 DEBUG: * SonarPHP 2.13.0.3107 (php)
18:21:21.707 DEBUG: * SonarTS 1.6.0.2388 (typescript)
18:21:21.707 DEBUG: * Svn 1.7.0.1017 (scmsvn)
18:21:21.707 DEBUG: * SonarJS 4.1.0.6085 (javascript)
18:21:22.045 INFO: Process project properties
18:21:22.064 DEBUG: Process project properties (done) | time=19ms
18:21:22.084 INFO: Load project repositories
18:21:22.092 DEBUG: GET 404 [SONAR_HOST_URL]/batch/project.protobuf?key=notes-service | time=8ms
18:21:22.092 DEBUG: Project repository not available - continuing without it
18:21:22.096 INFO: Load project repositories (done) | time=12ms
18:21:22.170 DEBUG: Available languages:
18:21:22.170 DEBUG: * C# => “cs”
18:21:22.170 DEBUG: * Python => “py”
18:21:22.170 DEBUG: * Java => “java”
18:21:22.171 DEBUG: * Flex => “flex”
18:21:22.171 DEBUG: * XML => “xml”
18:21:22.171 DEBUG: * PHP => “php”
18:21:22.171 DEBUG: * TypeScript => “ts”
18:21:22.171 DEBUG: * JavaScript => “js”
18:21:22.182 INFO: Load quality profiles
18:21:22.198 DEBUG: GET 200 [SONAR_HOST_URL]/api/qualityprofiles/search.protobuf?defaults=true | time=15ms
18:21:22.207 INFO: Load quality profiles (done) | time=25ms
18:21:22.221 INFO: Load active rules
18:21:22.252 DEBUG: GET 200 [SONAR_HOST_URL]/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWZ5bNtYcA8aMe32SOGa&p=1&ps=500 | time=30ms
18:21:22.395 DEBUG: GET 200 [SONAR_HOST_URL]/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWZ5bN1FcA8aMe32SOON&p=1&ps=500 | time=39ms
18:21:22.529 DEBUG: GET 200 [SONAR_HOST_URL]/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWZ5bN6acA8aMe32SOTo&p=1&ps=500 | time=21ms
18:21:22.555 DEBUG: GET 200 [SONAR_HOST_URL]/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWZ5bN71cA8aMe32SOUZ&p=1&ps=500 | time=12ms
18:21:22.575 DEBUG: GET 200 [SONAR_HOST_URL]/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWZ5bOBhcA8aMe32SOZu&p=1&ps=500 | time=20ms
18:21:22.622 DEBUG: GET 200 [SONAR_HOST_URL]/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWZ5bOFAcA8aMe32SOcQ&p=1&ps=500 | time=22ms
18:21:22.659 DEBUG: GET 200 [SONAR_HOST_URL]/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWZ5bOQQcA8aMe32SOfQ&p=1&ps=500 | time=19ms
18:21:22.689 DEBUG: GET 200 [SONAR_HOST_URL]/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWZ5bOUTcA8aMe32SOgh&p=1&ps=500 | time=24ms
18:21:22.714 INFO: Load active rules (done) | time=493ms
18:21:22.717 INFO: Load metrics repository
18:21:22.731 DEBUG: GET 200 [SONAR_HOST_URL]/api/metrics/search?f=name,description,direction,qualitative,custom&ps=500&p=1 | time=14ms
18:21:22.742 INFO: Load metrics repository (done) | time=25ms
18:21:22.772 INFO: Project key: notes-service
18:21:22.772 INFO: Project base dir: /
18:21:22.772 DEBUG: Start recursive analysis of project modules
18:21:22.772 INFO: ------------- Scan tests
18:21:22.863 INFO: Load server rules
18:21:22.905 DEBUG: GET 200 [SONAR_HOST_URL]/api/rules/list.protobuf | time=42ms
18:21:23.131 INFO: Load server rules (done) | time=269ms
18:21:23.175 INFO: Base dir: /tests
18:21:23.175 INFO: Working dir: /.sonarqube/out/.sonar/notes-service_notes-service_F746B049-01C7-4C38-82B0-ED7B5BA478F0
18:21:23.179 INFO: Source paths: Controllers/HealthCheckControllerTest.cs, Services/CreateNoteCommandHandlerTests.cs, Services/DeleteNoteCommandHandlerTests.cs, Services/GetForClientQueryHandlerTests.cs, Services/GetForFactQueryHandlerTests.cs, Services/GetSingleNoteQueryHandlerTests.cs, Services/UpdateNoteCommandHandlerTests.cs, Dockerfile, TestResults/Coverage/combined.js, TestResults/Coverage/coverage.opencover.xml, TestResults/Coverage/icon_cube.svg, TestResults/Coverage/icon_down-dir_active.svg, TestResults/Coverage/icon_fork.svg, TestResults/Coverage/icon_info-circled.svg, TestResults/Coverage/icon_minus.svg, TestResults/Coverage/icon_plus.svg, TestResults/Coverage/icon_search-minus.svg, TestResults/Coverage/icon_search-plus.svg, TestResults/Coverage/icon_up-dir.svg, TestResults/Coverage/icon_up-dir_active.svg, TestResults/Coverage/icon_wrench.svg, TestResults/Coverage/index.htm, TestResults/Coverage/notes_CreateNoteCommandHandler.htm, TestResults/Coverage/notes_DapperColumnMappingExtensions.htm, TestResults/Coverage/notes_DeleteNoteCommandHandler.htm, TestResults/Coverage/notes_GetForClientQuery.htm, TestResults/Coverage/notes_GetForClientQueryHandler.htm, TestResults/Coverage/notes_GetForFactQuery.htm, TestResults/Coverage/notes_GetForFactQueryHandler.htm, TestResults/Coverage/notes_GetSingleNoteQueryHandler.htm, TestResults/Coverage/notes_HealthCheckController.htm, TestResults/Coverage/notes_HealthCheckModel.htm, TestResults/Coverage/notes_HealthCheckService.htm, TestResults/Coverage/notes_HttpContextLoggingFilter.htm, TestResults/Coverage/notes_HyperionLogger.htm, TestResults/Coverage/notes_JaegerServiceCollectionExtensions.htm, TestResults/Coverage/notes_NoteModel.htm, TestResults/Coverage/notes_NotesController.htm, TestResults/Coverage/notes_NotesDatabase.htm, TestResults/Coverage/notes_NotesRepository.htm, TestResults/Coverage/notes_PrometheusExceptionHandler.htm, TestResults/Coverage/notes_RequestMetricsFilter.htm, TestResults/Coverage/notes_RequestTracingFilter.htm, TestResults/Coverage/notes_SharingRulesClient.htm, TestResults/Coverage/notes_UpdateNoteCommandHandler.htm, TestResults/Coverage/notes_VaultCredential.htm, TestResults/Coverage/notes_VaultLease_1.htm, TestResults/Coverage/notes_VaultService.htm, TestResults/Coverage/notes_VaultUnavailableException.htm, TestResults/Coverage/report.css, TestResults/TestResults.trx
18:21:23.181 INFO: Source encoding: UTF-8, default locale: en_US

18:21:23.286 DEBUG: Initializers :
18:21:23.287 INFO: Index files
18:21:23.290 INFO: Included sources:
18:21:23.290 INFO: **/
.cs

18:21:23.351 INFO: 7 files indexed
18:21:23.352 INFO: 44 files ignored because of inclusion/exclusion patterns
18:21:23.353 INFO: Quality profile for cs: Sonar way
18:21:23.353 INFO: Excluded sources for coverage:
18:21:23.353 INFO: *Test.cs

18:21:24.138 INFO: Sensor C# Properties [csharp]
18:21:24.139 DEBUG: Analyzer working directory ‘/.sonarqube/out/1/output-cs’ contains 6 .pb file(s)
18:21:24.139 DEBUG: Found Roslyn issues report
18:21:24.140 INFO: Sensor C# Properties [csharp] (done) | time=1ms
18:21:24.144 INFO: Sensor SonarJavaXmlFileSensor [java]
18:21:24.144 INFO: Sensor SonarJavaXmlFileSensor [java] (done) | time=0ms
18:21:24.145 INFO: SCM provider for this project is: git
18:21:24.145 INFO: 7 files to be analyzed
18:21:24.159 DEBUG: readpipe [git, --version],/usr/bin
18:21:24.177 DEBUG: readpipe may return ‘git version 2.11.0’
18:21:24.177 DEBUG: remaining output:
18:21:24.178 DEBUG: readpipe [git, config, --system, --edit],/usr/bin
18:21:24.182 DEBUG: readpipe may return ‘/etc/gitconfig’
18:21:24.182 DEBUG: remaining output:

18:21:24.399 INFO: 7/7 files analyzed
18:21:24.402 INFO: ------------- Scan notes
18:21:24.418 INFO: Base dir: /src/notes
18:21:24.418 INFO: Working dir: /.sonarqube/out/.sonar/notes-service_notes-service_72003307-FF91-4121-AA7E-2F668E1343FD
18:21:24.420 INFO: Source paths: …
18:21:24.420 INFO: Source encoding: UTF-8, default locale: en_US

18:21:24.440 DEBUG: Initializers :
18:21:24.443 INFO: Index files
18:21:24.443 INFO: Included sources:
18:21:24.443 INFO: **/.cs

18:21:24.513 INFO: 41 files indexed
18:21:24.513 INFO: 5 files ignored because of inclusion/exclusion patterns
18:21:24.513 INFO: Quality profile for cs: Sonar way
18:21:24.513 INFO: Excluded sources for coverage:
18:21:24.513 INFO: *Test.cs

18:21:24.557 DEBUG: Sensors : C# Properties -> SonarJavaXmlFileSensor
18:21:24.557 INFO: Sensor C# Properties [csharp]
18:21:24.558 DEBUG: Analyzer working directory ‘/.sonarqube/out/0/output-cs’ contains 6 .pb file(s)
18:21:24.558 DEBUG: Found Roslyn issues report
18:21:24.558 INFO: Sensor C# Properties [csharp] (done) | time=1ms
18:21:24.558 INFO: Sensor SonarJavaXmlFileSensor [java]
18:21:24.558 INFO: Sensor SonarJavaXmlFileSensor [java] (done) | time=0ms
18:21:24.559 INFO: SCM provider for this project is: git
18:21:24.559 INFO: 41 files to be analyzed

18:21:24.931 INFO: 41/41 files analyzed
18:21:24.931 INFO: ------------- Scan appdev/notes-service
18:21:24.943 INFO: Base dir: /
18:21:24.944 INFO: Working dir: /.sonarqube/out/.sonar
18:21:24.944 INFO: Source paths: root/.nuget/packages/nunit3testadapter/3.10.0/build/netcoreapp1.0/NUnit3.TestAdapter.dll, root/.nuget/packages/nunit3testadapter/3.10.0/build/netcoreapp1.0/NUnit3.TestAdapter.pdb, root/.nuget/packages/nunit3testadapter/3.10.0/build/netcoreapp1.0/nunit.engine.netstandard.dll, root/.nuget/packages/nunit3testadapter/3.10.0/build/netcoreapp1.0/Mono.Cecil.dll
18:21:24.944 INFO: Source encoding: UTF-8, default locale: en_US

18:21:24.963 DEBUG: Initializers :
18:21:24.963 INFO: Index files
18:21:24.965 INFO: Included sources:
18:21:24.965 INFO: **/
.cs
18:21:24.966 INFO: 0 files indexed
18:21:24.966 INFO: 4 files ignored because of inclusion/exclusion patterns
18:21:24.966 INFO: Excluded sources for coverage:
18:21:24.966 INFO: *Test.cs

18:21:25.009 DEBUG: Sensors : SonarJavaXmlFileSensor -> C# -> C# Tests Coverage Report Import -> C# Unit Test Results Import -> Zero Coverage Sensor -> CPD Block Indexer
18:21:25.009 INFO: Sensor SonarJavaXmlFileSensor [java]
18:21:25.009 INFO: Sensor SonarJavaXmlFileSensor [java] (done) | time=0ms
18:21:25.009 INFO: Sensor C# [csharp]
18:21:25.019 INFO: Importing results from 6 proto files in ‘/.sonarqube/out/1/output-cs’
18:21:25.090 INFO: Importing results from 6 proto files in ‘/.sonarqube/out/0/output-cs’

18:21:25.285 INFO: Importing 2 Roslyn reports
18:21:25.341 INFO: Sensor C# [csharp] (done) | time=332ms
18:21:25.341 INFO: Sensor C# Tests Coverage Report Import [csharp]
18:23:02.135 INFO: ------------------------------------------------------------------------
18:23:02.135 INFO: EXECUTION FAILURE
18:23:02.135 INFO: ------------------------------------------------------------------------
18:23:02.136 INFO: Total time: 2:56.123s
18:23:02.191 INFO: Final Memory: 8M/1483M
18:23:02.191 INFO: ------------------------------------------------------------------------
18:23:02.191 ERROR: Error during SonarQube Scanner execution
java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.lang.StringCoding$StringDecoder.decode(StringCoding.java:149)
at java.lang.StringCoding.decode(StringCoding.java:193)
at java.lang.String.<init>(String.java:426)
at java.lang.String.<init>(String.java:491)
at java.io.UnixFileSystem.list(Native Method)
at java.io.File.list(File.java:1122)
at java.io.File.listFiles(File.java:1207)
at org.sonar.plugins.dotnet.tests.WildcardPatternFileProvider.listFiles(WildcardPatternFileProvider.java:120)
at org.sonar.plugins.dotnet.tests.WildcardPatternFileProvider.listFiles(WildcardPatternFileProvider.java:126)
at org.sonar.plugins.dotnet.tests.WildcardPatternFileProvider.listFiles(WildcardPatternFileProvider.java:126)
at org.sonar.plugins.dotnet.tests.WildcardPatternFileProvider.listFiles(WildcardPatternFileProvider.java:126)
at org.sonar.plugins.dotnet.tests.WildcardPatternFileProvider.listFiles(WildcardPatternFileProvider.java:126)
at org.sonar.plugins.dotnet.tests.WildcardPatternFileProvider.listFiles(WildcardPatternFileProvider.java:126)
at org.sonar.plugins.dotnet.tests.WildcardPatternFileProvider.listFiles(WildcardPatternFileProvider.java:126)
at org.sonar.plugins.dotnet.tests.WildcardPatternFileProvider.listFiles(WildcardPatternFileProvider.java:126)
at org.sonar.plugins.dotnet.tests.WildcardPatternFileProvider.listFiles(WildcardPatternFileProvider.java:126)
at org.sonar.plugins.dotnet.tests.WildcardPatternFileProvider.listFiles(WildcardPatternFileProvider.java:126)
at org.sonar.plugins.dotnet.tests.WildcardPatternFileProvider.listFiles(WildcardPatternFileProvider.java:126)
at org.sonar.plugins.dotnet.tests.WildcardPatternFileProvider.listFiles(WildcardPatternFileProvider.java:126)
at org.sonar.plugins.dotnet.tests.WildcardPatternFileProvider.listFiles(WildcardPatternFileProvider.java:126)
at org.sonar.plugins.dotnet.tests.WildcardPatternFileProvider.listFiles(WildcardPatternFileProvider.java:126)
at org.sonar.plugins.dotnet.tests.WildcardPatternFileProvider.listFiles(WildcardPatternFileProvider.java:126)
at org.sonar.plugins.dotnet.tests.WildcardPatternFileProvider.listFiles(WildcardPatternFileProvider.java:126)
at org.sonar.plugins.dotnet.tests.WildcardPatternFileProvider.listFiles(WildcardPatternFileProvider.java:126)
at org.sonar.plugins.dotnet.tests.WildcardPatternFileProvider.listFiles(WildcardPatternFileProvider.java:126)
at org.sonar.plugins.dotnet.tests.WildcardPatternFileProvider.listFiles(WildcardPatternFileProvider.java:126)
at org.sonar.plugins.dotnet.tests.WildcardPatternFileProvider.listFiles(WildcardPatternFileProvider.java:126)

The issue turned out to be that I had a greedy wildcard set in my SonarQube.Analysis.xml for sonar.cs.opencover.reportsPaths.

Something like:
**/coverage.opencover.xml

instead of
/tests/**/coverage.opencover.xml

I assume it was searching all folders and running out of memory.

1 Like

Does this mean your issues is resolved?

Yes as long as the wildcard doesn’t start with ** it doesn’t run out of memory.

1 Like