Background Task failed after Sonar-scanner analysis

Our project analysis took 21 hours to complete due to huge codebase, and below was seen in log.

INFO: Analysis report generated in 12644ms, dir size=3.5 GB
INFO: Analysis report compressed in 89957ms, zip size=619.5 MB
INFO: Analysis report uploaded in 19600ms
INFO: Note that you will be able to access the updated dashboard once the server
INFO: More about the report processing at
INFO: Analysis total time: 21:46:06.827 s
INFO: ------------------------------------------------------------------------
INFO: ------------------------------------------------------------------------
INFO: Total time: 21:46:07.577s
INFO: Final Memory: 7M/88M

After this analysis completion, the background task failed with below error

java.lang.IllegalStateException: Fail to select data of CE task AX4pBNt1dxBRvUfJjYnO
	at org.sonar.db.ce.CeTaskInputDao.selectData(
	at org.sonar.ce.task.projectanalysis.step.ExtractReportStep.execute(
	at org.sonar.ce.task.step.ComputationStepExecutor.executeStep(
	at org.sonar.ce.task.step.ComputationStepExecutor.executeSteps(
	at org.sonar.ce.task.step.ComputationStepExecutor.execute(
	at org.sonar.ce.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(
	at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.executeTask(
	at org.sonar.ce.taskprocessor.CeWorkerImpl$
	at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(
	at org.sonar.ce.taskprocessor.CeWorkerImpl$TrackRunningState.get(
	at java.base/java.util.concurrent.Executors$
	at java.base/
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(
	at java.base/java.util.concurrent.ThreadPoolExecutor$
	at java.base/
Caused by: org.postgresql.util.PSQLException: ERROR: invalid memory alloc request size 1238920861
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(
	at org.postgresql.core.v3.QueryExecutorImpl.execute(
	at org.postgresql.jdbc.PgStatement.executeInternal(
	at org.postgresql.jdbc.PgStatement.execute(
	at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(
	at org.postgresql.jdbc.PgPreparedStatement.executeQuery(
	at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(
	at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(
	at org.sonar.db.ce.CeTaskInputDao.selectData(
	... 20 more

My instance details

  • Sonarqube version -
  • Scanner version -
  • DB - postgres 12.9
  • Java- 11.0.11

Hey there.

Long story short, your analysis report is about 100MB too big (it can be, at maximum, 512 MB with a Postgres database).

I would refer to a post here where advice is given on shrinking the analysis report:

Another option would be to split the scan into several projects, if there’s a logical way of splitting the sources (a monorepo, for example, with many different applications)

1 Like

Yeah i have tried it by splitting the scan into several sub modules. It works, but i was looking for results in a single scan.
Also you mean that report upload issue is due to postgres DB limitation rather than sonarqube ?

This is a Postgres limitation and as far as I’m aware, cannot be overriden by any DB level setting :frowning:

1 Like

Ok. Since this is a Postgres limitation, should we fallback to H2 database ? Does H2 database also has a similar limitation ? :neutral_face:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.