Hi,
SonarQube: 10.6, Scanner: sonarqube-scan-action@v3.0.0
Deployment method: Helm
Issue: Scanning large projects
After upgrading from SonarQube 10.1 to 10.6, I also had to upgrade sonarqube-scan-action from v1.2.0 to v2.0.0 and above. After this upgrade, a large project started encountering an error during the scan stage of the workflow:
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@v3.0.0
with:
args: >
-Dsonar.verbose=true
-Dsonar.sourceEncoding=UTF-8
-Dsonar.javascript.node.maxspace=8192
continue-on-error: false
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }}
SONAR_SCANNER_JAVA_OPTS: "-Xmx4096m"
This produces the following error:
2024-09-27T08:48:16.2126006Z 08:48:16.211 INFO Hit the cache for 0 out of 0
2024-09-27T08:48:16.2138630Z 08:48:16.213 INFO Miss the cache for 0 out of 0
2024-09-27T08:48:16.2203637Z 08:48:16.220 DEBUG Shutting down the worker
2024-09-27T08:48:16.2214783Z 08:48:16.221 INFO Rule | Time (ms) | Relative
2024-09-27T08:48:16.2215965Z 08:48:16.221 INFO :----|----------:|--------:
2024-09-27T08:48:16.2329522Z 08:48:16.232 DEBUG The worker thread exited with code 0
2024-09-27T08:48:16.2340327Z 08:48:16.233 DEBUG The bridge server shut down
2024-09-27T08:48:16.2344273Z 08:48:16.234 INFO Rule | Time (ms) | Relative
2024-09-27T08:48:16.2345401Z 08:48:16.234 INFO :----|----------:|--------:
2024-09-27T08:48:16.7197541Z 08:48:16.718 ERROR [stderr] Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
2024-09-27T08:48:16.7200161Z 08:48:16.719 ERROR [stderr] at java.base/java.io.File.listFiles(Unknown Source)
2024-09-27T08:48:16.7203395Z 08:48:16.719 ERROR [stderr] at org.sonar.plugins.javascript.bridge.TsConfigProvider$LookupTsConfigProvider.tsconfigs(TsConfigProvider.java:176)
2024-09-27T08:48:16.7206819Z 08:48:16.719 ERROR [stderr] at org.sonar.plugins.javascript.bridge.TsConfigProvider.tsconfigs(TsConfigProvider.java:94)
2024-09-27T08:48:16.7209985Z 08:48:16.719 ERROR [stderr] at org.sonar.plugins.javascript.bridge.TsConfigProvider.getTsConfigs(TsConfigProvider.java:89)
2024-09-27T08:48:16.7213015Z 08:48:16.719 ERROR [stderr] at org.sonar.plugins.javascript.bridge.JsTsSensor.analyzeFiles(JsTsSensor.java:104)
2024-09-27T08:48:16.7216046Z 08:48:16.719 ERROR [stderr] at org.sonar.plugins.javascript.bridge.AbstractBridgeSensor.execute(AbstractBridgeSensor.java:74)
2024-09-27T08:48:16.7219500Z 08:48:16.719 ERROR [stderr] at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
In total, 1,543 files are indexed. If I apply the exclusion patterns **/.ts and **/.js, the number of indexed files drops to 1,265, and the scan completes successfully.
Am I missing some important configuration related to the JVM or the Node.js Bridge Server?
Full logs:
scannerlogs.log (85.4 KB)