Background tasks failing on temporary file size exceeds temp_file_limit

Hi,
We’re using Sonarqube 8.2.0.32929.
Since last week our scans in one project background tasks keeps failing on the following exception:

org.sonar.ce.task.projectanalysis.component.VisitException: Visit of Component {key=org.artifactory:artifactory-combined:PULL_REQUEST:4099,uuid=xxx,type=PROJECT} failed
	at org.sonar.ce.task.projectanalysis.component.VisitException.rethrowOrWrap(VisitException.java:44)
	at org.sonar.ce.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visit(DepthTraversalTypeAwareCrawler.java:41)
	at org.sonar.ce.task.projectanalysis.purge.PurgeDatastoresStep.execute(PurgeDatastoresStep.java:70)
	at org.sonar.ce.task.step.ComputationStepExecutor.executeStep(ComputationStepExecutor.java:81)
	at org.sonar.ce.task.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:72)
	at org.sonar.ce.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:59)
	at org.sonar.ce.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:81)
	at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.executeTask(CeWorkerImpl.java:209)
	at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.run(CeWorkerImpl.java:191)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:158)
	at org.sonar.ce.taskprocessor.CeWorkerImpl$TrackRunningState.get(CeWorkerImpl.java:133)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:85)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:53)
	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:69)
	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: org.apache.ibatis.exceptions.PersistenceException: 
### Error committing transaction.  Cause: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.purge.PurgeMapper.deleteIssueChangesByProjectUuid (batch index #1) failed. Cause: java.sql.BatchUpdateException: Batch entry 0 delete from issue_changes ic
    where
      exists (select 1 from issues i where i.kee=ic.issue_key and i.project_uuid = 'xxx') was aborted: ERROR: temporary file size exceeds temp_file_limit (12172460kB)  Call getNextException to see other errors in the batch.
### Cause: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.purge.PurgeMapper.deleteIssueChangesByProjectUuid (batch index #1) failed. Cause: java.sql.BatchUpdateException: Batch entry 0 delete from issue_changes ic
    where
      exists (select 1 from issues i where i.kee=ic.issue_key and i.project_uuid = 'xxx') was aborted: ERROR: temporary file size exceeds temp_file_limit (12172460kB)  Call getNextException to see other errors in the batch.
	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.commit(DefaultSqlSession.java:226)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.commit(DefaultSqlSession.java:217)
	at org.sonar.db.DbSessionImpl.commit(DbSessionImpl.java:42)
	at org.sonar.db.BatchSession.commit(BatchSession.java:168)
	at org.sonar.db.purge.PurgeCommands.deleteIssues(PurgeCommands.java:222)
	at org.sonar.db.purge.PurgeDao.deleteRootComponent(PurgeDao.java:231)
	at org.sonar.db.purge.PurgeDao.purgeStaleBranches(PurgeDao.java:91)
	at org.sonar.db.purge.PurgeDao.purge(PurgeDao.java:75)
	at org.sonar.ce.task.projectanalysis.purge.ProjectCleaner.purge(ProjectCleaner.java:63)
	at org.sonar.ce.task.projectanalysis.purge.PurgeDatastoresStep.execute(PurgeDatastoresStep.java:76)
	at org.sonar.ce.task.projectanalysis.purge.PurgeDatastoresStep.access$000(PurgeDatastoresStep.java:38)
	at org.sonar.ce.task.projectanalysis.purge.PurgeDatastoresStep$1.visitProject(PurgeDatastoresStep.java:63)
	at org.sonar.ce.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visitNode(DepthTraversalTypeAwareCrawler.java:70)
	at org.sonar.ce.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visitImpl(DepthTraversalTypeAwareCrawler.java:51)
	at org.sonar.ce.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visit(DepthTraversalTypeAwareCrawler.java:39)
	... 20 more
Caused by: org.apache.ibatis.executor.BatchExecutorException: org.sonar.db.purge.PurgeMapper.deleteIssueChangesByProjectUuid (batch index #1) failed. Cause: java.sql.BatchUpdateException: Batch entry 0 delete from issue_changes ic
    where
      exists (select 1 from issues i where i.kee=ic.issue_key and i.project_uuid = 'xxx') was aborted: ERROR: temporary file size exceeds temp_file_limit (12172460kB)  Call getNextException to see other errors in the batch.
	at org.apache.ibatis.executor.BatchExecutor.doFlushStatements(BatchExecutor.java:149)
	at org.apache.ibatis.executor.BaseExecutor.flushStatements(BaseExecutor.java:129)
	at org.apache.ibatis.executor.BaseExecutor.flushStatements(BaseExecutor.java:122)
	at org.apache.ibatis.executor.BaseExecutor.commit(BaseExecutor.java:242)
	at org.apache.ibatis.executor.CachingExecutor.commit(CachingExecutor.java:119)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.commit(DefaultSqlSession.java:223)
	... 34 more
Caused by: java.sql.BatchUpdateException: Batch entry 0 delete from issue_changes ic
    where
      exists (select 1 from issues i where i.kee=ic.issue_key and i.project_uuid = 'xxx') was aborted: ERROR: temporary file size exceeds temp_file_limit (12172460kB)  Call getNextException to see other errors in the batch.
	at org.postgresql.jdbc.BatchResultHandler.handleError(BatchResultHandler.java:148)
	at org.postgresql.core.ResultHandlerDelegate.handleError(ResultHandlerDelegate.java:50)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2234)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:510)
	at org.postgresql.jdbc.PgStatement.executeBatch(PgStatement.java:853)
	at org.postgresql.jdbc.PgPreparedStatement.executeBatch(PgPreparedStatement.java:1546)
	at org.apache.commons.dbcp2.DelegatingStatement.executeBatch(DelegatingStatement.java:242)
	at org.apache.commons.dbcp2.DelegatingStatement.executeBatch(DelegatingStatement.java:242)
	at org.apache.ibatis.executor.BatchExecutor.doFlushStatements(BatchExecutor.java:123)
	... 39 more
Caused by: org.postgresql.util.PSQLException: ERROR: temporary file size exceeds temp_file_limit (12172460kB)
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2497)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2233)
	... 45 more

Currently we don’t have a workaround for this, the DB has plenty of disk space, I’d be happy to hear some advice on what might be the cause and how we can handle it.

Thanks in advance.

Hi,

Welcome to the community!

Can you increase the temp_file_limit?

 
Ann