StackOverflowError when using SonarHTML plugin

SonarQube: 7.4
SonarQube Gradle Plugin: 2.6.1
SonarHTML: 3.0.1


Execution failed for task ':sonarqube'.
> java.lang.StackOverflowError (no error message)

Steps to reproduce:

  1. Reinstall SonarHTML after upgrading to SonarQube 7.4 from SonarQube 7.3.
  2. Run scan using the gradle SonarQube plugin.

Everything worked just fine until I reinstalled SonarHTML. I had initially forgot to install it when we upgraded. No StackOverflowErrors prior to reinstalling the plugin. After reinstalling the SonarHTML the crashes started happening. I then uninstalled the SonarHTML plugin and the crashes stopped.

The only thing I’ve been able to do is remove SonarHTML. I have no been able to get it to work otherwise.


That would be great to share the project or a reproducer so we can try to reproduce your problem on our side.

What are the Xmx and Xss values allocated to Gradle for this build?

Can you share the full logs of the execution of the “sonarqube” task?


Sorry, I am just now seeing you respond to this. I cannot share the project or much with regards to it unfortunately. I would have to scrub an awful lot from the logs, but I’ve added the start of the log and the specific task that is failing with some info removed (basically path/project info).

Xmx = 4096m and Xss is not set anywhere that I can find.

  • ./gradlew --info sonarqube ‘-Dsonar.projectVersion=5.3.33
    ’ -x test
    Initialized native services in: /usr/jenkins/.gradle/native
    To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon:
    Starting process ‘Gradle build daemon’. Working directory: /usr/jenkins/.gradle/daemon/4.10 Command: /usr/jenkins/builds/tools/hudson.model.JDK/JDK_8/bin/java -Xmx4096m -Dfile.encoding=UTF-8 -Duser.language=en -Duser.variant -cp /usr/jenkins/.gradle/wrapper/dists/gradle-4.10-bin/bg6py687nqv2mbe6e1hdtk57h/gradle-4.10/lib/gradle-launcher-4.10.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 4.10
    Successfully started process ‘Gradle build daemon’
    An attempt to start the daemon took 0.703 secs.
    The client will now receive all logging from the daemon (pid: 17979). The daemon log file: /usr/jenkins/.gradle/daemon/4.10/daemon-17979.out.log
    Closing daemon’s stdin at end of input.
    The daemon will no longer process any standard input.
    Daemon will be stopped at the end of the build stopping after processing
    Using 6 worker leases.
    Starting Build
    Settings evaluated using settings file ‘/usr/jenkins/builds/workspace/Jenkins.Test.SonarHTML/settings.gradle’.
    Using local directory build cache for the root build (location = /usr/jenkins/.gradle/caches/build-cache-1, removeUnusedEntriesAfter = 7 days).
    Projects loaded. Root project using build file ‘/usr/jenkins/builds/workspace/Jenkins.Test.SonarHTML/build.gradle’.
    Included projects: [root project ‘Jenkins.Test.SonarHTML’, …’]
    Parallel execution with configuration on demand is an incubating feature.

Task :sonarqube
Java Test Files AST scan (done) | time=576ms
Sensor JavaSquidSensor [java] (done) | time=17546ms
Sensor SurefireSensor [java]
parsing [/usr/jenkins/builds/workspace/Jenkins.Test.SonarHTML/[path]/build/test-results/test]
Sensor SurefireSensor [java] (done) | time=2ms
Sensor JaCoCoSensor [java]
Analysing /usr/jenkins/builds/workspace/Jenkins.Test.SonarHTML/core/build/jacoco/test.exec
No information about coverage per test.
Sensor JaCoCoSensor [java] (done) | time=270ms
Sensor SonarJavaXmlFileSensor [java]
Sensor SonarJavaXmlFileSensor [java] (done) | time=1ms
Sensor HTML [web]

Task :sonarqube FAILED
:sonarqube (Thread[Task worker for ‘:’ Thread 3,5,main]) completed. Took 20 mins 10.696 secs.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:sonarqube’.
    java.lang.StackOverflowError (no error message)

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use ‘–warning-mode all’ to show the individual deprecation warnings.

BUILD FAILED in 20m 17s
1 actionable task: 1 executed
script returned exit code 1

Here is the stack trace:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ‘:sonarqube’.

at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(

at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(

at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(

at org.gradle.api.internal.tasks.execution.SkipCachedTaskExecuter.execute(

at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(

at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(

at org.gradle.api.internal.tasks.execution.ResolveBuildCacheKeyExecuter.execute(

at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(

at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(

at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(

at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(

at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(

at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(

at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(

at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(

at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(

at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$

at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(

at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(

at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(



at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(

at org.gradle.execution.taskgraph.LocalTaskInfoExecutor.execute(

at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(

at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(

at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(

at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(

at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.execute(

at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.executeWithWork(

at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$

at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(

at org.gradle.internal.concurrent.ManagedExecutorImpl$

at org.gradle.internal.concurrent.ThreadFactoryImpl$

Caused by: java.lang.StackOverflowError

Hi @gbishop,

Thank you for the logs. The stacktrace contains only gradle api calls, I don’t see any reference to classes in org.sonarqube.gradle.* or in org.sonar.plugins.html.* . Thus it seems strange to me that the issue would come from the HTML analyzer.

Could you try increasing the Xmx and Xss values?

If you still have the issue, could you create an example of code which reproduces it?
Note that since version 3.0.0, SonarHTML changed the list of file extensions analyzed by default. You can see the full list in SonarQube’s configuration Administration->HTML->File suffixes.
Another important change is that PHP and JSP files are always analysed even when they are not listed in File suffixes. Thus one of those files could be the culprit.


I’ll try and do that. It certainly could be a red herring, but I know that the problem is fixed when I remove the HTML plugin. I’ll have to wait for a better time to reinstall the HTML plugin as we are about to release, but then I can try your suggestions.

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