I tried the above command in the “begin” step. I ran into a memory issue
WARNING: WARN: [CHECKPOINT_WRITER] WARNING Transaction neither committed nor rolled back Transaction_100000002 depth=1 status=<ts=68,264 tc=UNCOMMITTED mvv=0>
Exception in thread "CHECKPOINT_WRITER" Exception in thread "CLEANUP_MANAGER" Exception in thread "Report about progress of Javascript analyzer" java.lang.OutOf
MemoryError: Java heap space
at org.sonarsource.analyzer.commons.ProgressReport.run(ProgressReport.java:61)
at java.lang.Thread.run(Thread.java:748)
java.lang.OutOfMemoryError: Java heap space
at java.util.ArrayList.iterator(ArrayList.java:834)
at com.persistit.TransactionIndex.checkpointAccumulatorSnapshots(TransactionIndex.java:1106)
at com.persistit.CheckpointManager.createCheckpoint(CheckpointManager.java:247)
at com.persistit.CheckpointManager.pollCreateCheckpoint(CheckpointManager.java:197)
at com.persistit.CheckpointManager.runTask(CheckpointManager.java:300)
at com.persistit.IOTaskRunnable.run(IOTaskRunnable.java:144)
at java.lang.Thread.run(Thread.java:748)
java.lang.OutOfMemoryError: Java heap space
at java.util.ArrayList.<init>(ArrayList.java:152)
at com.persistit.CleanupManager.poll(CleanupManager.java:166)
at com.persistit.CleanupManager.runTask(CleanupManager.java:88)
at com.persistit.IOTaskRunnable.run(IOTaskRunnable.java:144)
at java.lang.Thread.run(Thread.java:748)
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 22:50.494s
INFO: Final Memory: 15M/925M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: Java heap space
ERROR:
The SonarQube Scanner did not complete successfully
14:45:57.488 Creating a summary markdown file...
14:45:57.491 Post-processing failed. Exit code: 1
-----------------------------------------------------------------------------------------------------------------------
I went into sonar.properties and uncommented the following line and made the change (in bold)
While increasing the memory available for the compute engine could be necessary for a sufficiently large project, I would also try following the troubleshooting guide here to increase the amount of memory available to the scanner itself.
I have asked this question before but is there a way to restrict the analysis of a .NET sln file only to certain projects ? The reason why this analysis is failing is because we have a huge solution with close to 30 projects. Out of this, the crucial ones are 2 - 3 projects only. The rest are not so important or rather, of lesser priority for such analysis. Note that each project is within it’s own folder in the solution so, unless I am missing something, all I need top tell sonarqube is to ignore the files in the folders … or alternately, only analyse files in certain folders.
I’ve not had any problems running Sonarqube against smaller projects, so running SonarQube against sub-projects should, I am hoping, give us some output that is usable.
I know that there are ways we can do this by inserting xml config blocks into projects themselves (like this) but for a proof of concept scenario, I really don’t want to change our source.
I want the source files in the MyWebProject.Web directory to be analyzed (and only the cs files). However, when I run the project, it does ignore the css and js files but ALL directories in the root of the project are still included in the analysis.
As another tack, I have put sonar.sources=MywebProject.Web in the default SonarQube.Analysis.xml file and am re-running the whole thing again (fingers crossed) … but am I missing something here ?
And for the sake of completeness, here are the commands that I am using
This not only cut down my processing time to less than a minute but also allowed me to focus on .NET part of the solution i.e. .cs files.
Putting the following into the SonarQube.Analysis.xml file had no effect.
MyProject.Web
Like I mentioned above, it went through ALL the folders nonetheless.