SonarQube Background Task Failure After Sonar Scanner completes analysis

Hello Team,
We are facing the following issue after publishing the Sonar scanning results to the SonarQube server.

This happens for just one project which is a large project. The other projects just work fine.

When the background task starts, it fails within 2 seconds with the error below.

Can you please help?

Error Details:

java.lang.IllegalStateException: Fail to select data of CE task a6048ace-06fe-4859-b8f3-dbb684159b96
  at org.sonar.db.ce.CeTaskInputDao.selectData(CeTaskInputDao.java:74)
  at org.sonar.ce.task.projectanalysis.step.ExtractReportStep.execute(ExtractReportStep.java:67)
  at org.sonar.ce.task.step.ComputationStepExecutor.executeStep(ComputationStepExecutor.java:90)
  at org.sonar.ce.task.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:81)
  at org.sonar.ce.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:68)
  at org.sonar.ce.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:75)
  at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.executeTask(CeWorkerImpl.java:212)
  at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.run(CeWorkerImpl.java:194)
  at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:160)
  at org.sonar.ce.taskprocessor.CeWorkerImpl$TrackRunningState.get(CeWorkerImpl.java:135)
  at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:87)
  at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:53)
  at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:128)
  at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:74)
  at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:80)
  at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
  at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
  at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
  at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.postgresql.util.PSQLException: ERROR: invalid memory alloc request size 1096529649
  at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2734)
  at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2421)
  at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:372)
  at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:518)
  at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:435)
  at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:196)
  at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:139)
  at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
  at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
  at org.sonar.db.ce.CeTaskInputDao.selectData(CeTaskInputDao.java:67)
 ... 20 more


Kindly find the Sonar scanner log details for the generated report:

INFO Analysis report generated in 22977ms, dir size=1.3 GB
INFO Analysis report compressed in 140125ms, zip size=548.3 MB

SonarQube Configuration Details:

Sonarqube version : Community Build v25.9.0.112764
pgsql version : 15.4
sonarscanner version : SonarScanner CLI 7.2.0.5079
sonar.ce.javaOpts=-Xmx10240m -Xms512m -XX:+HeapDumpOnOutOfMemoryError

Hi,

You’re hitting this:

SONAR-21454 SonarQube fails to process analysis when report is bigger than 1GB (Postgres)

We hope to have this fixed in the January releases.

In the meantime… You can analyze your project in multiple, smaller chunks. I know this isn’t a good answer. It’s the only one I’ve got tho.

 
HTH,
Ann

1 Like