SonarQube background task failed

Hi all
I am facing an issue on SonarQube Enterprise Edition Version 9.4
Randomly, after analysis, some task failed.

When this happens, the report is shown but you cannot access the details of the bugs.
For example, here the report show 18 new bugs.

When I click on the 18 link the detail is not shown

Back to background task page, this is the error log.

Error Details

org.sonar.ce.task.projectanalysis.component.VisitException: Visit of Component {key=XXXXX:Agent/sdk/XXXXX_dps/XXXXX_dps.h,type=FILE} failed
	at org.sonar.ce.task.projectanalysis.component.VisitException.rethrowOrWrap(VisitException.java:44)
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:74)
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:110)
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:97)
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:72)
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:110)
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:97)
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:72)
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitChildren(VisitorsCrawler.java:110)
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:97)
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:72)
	at org.sonar.ce.task.projectanalysis.step.ExecuteVisitorsStep.execute(ExecuteVisitorsStep.java:51)
	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: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: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(Executors.java:515)
	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:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.IllegalStateException: Fail to process issues of component 'XXXXX:Agent/sdk/XXXXX_dps/XXXXX_dps.h'
	at org.sonar.ce.task.projectanalysis.issue.IntegrateIssuesVisitor.visitAny(IntegrateIssuesVisitor.java:79)
	at org.sonar.ce.task.projectanalysis.component.TypeAwareVisitorWrapper.visitAny(TypeAwareVisitorWrapper.java:77)
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitNode(VisitorsCrawler.java:117)
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visitImpl(VisitorsCrawler.java:100)
	at org.sonar.ce.task.projectanalysis.component.VisitorsCrawler.visit(VisitorsCrawler.java:72)
	... 29 more
Caused by: org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: org.postgresql.util.PSQLException: ERROR: column i.issue_attributes does not exist
  Position: 429
### The error may exist in org.sonar.db.issue.IssueMapper
### The error may involve org.sonar.db.issue.IssueMapper.scrollNonClosedByComponentUuid-Inline
### The error occurred while setting parameters
### SQL: select           i.kee as kee,     i.rule_uuid as ruleUuid,     i.severity as severity,     i.manual_severity as manualSeverity,     i.message as message,     i.line as line,     i.locations as locations,     i.gap as gap,     i.effort as effort,     i.status as status,     i.resolution as resolution,     i.checksum as checksum,     i.assignee as assigneeUuid,     i.author_login as authorLogin,     i.tags as tagsString,     i.issue_attributes as issueAttributes,     i.issue_creation_date as issueCreationTime,     i.issue_update_date as issueUpdateTime,     i.issue_close_date as issueCloseTime,     i.created_at as createdAt,     i.updated_at as updatedAt,     r.is_external as "isExternal",     r.plugin_rule_key as ruleKey,     r.plugin_name as ruleRepo,     r.language as language,     r.security_standards as securityStandards,     p.kee as componentKey,     i.component_uuid as componentUuid,     p.module_uuid as moduleUuid,     p.module_uuid_path as moduleUuidPath,     p.path as filePath,     root.kee as projectKey,     i.project_uuid as projectUuid,     i.issue_type as type,     i.quick_fix_available as quickFixAvailable,           n.uuid is not null as isNewCodeReferenceIssue             from issues i     inner join rules r on r.uuid=i.rule_uuid     inner join components p on p.uuid=i.component_uuid     inner join components root on root.uuid=i.project_uuid     left join new_code_reference_issues n on i.kee = n.issue_key     where     i.component_uuid = ? and     i.status <> 'CLOSED'
### Cause: org.postgresql.util.PSQLException: ERROR: column i.issue_attributes does not exist
  Position: 429
	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:153)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.select(DefaultSqlSession.java:171)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.select(DefaultSqlSession.java:161)
	at org.apache.ibatis.binding.MapperMethod.executeWithResultHandler(MapperMethod.java:136)
	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:77)
	at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:145)
	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:86)
	at com.sun.proxy.$Proxy49.scrollNonClosedByComponentUuid(Unknown Source)
	at org.sonar.ce.task.projectanalysis.issue.ComponentIssuesLoader.loadOpenIssues(ComponentIssuesLoader.java:166)
	at org.sonar.ce.task.projectanalysis.issue.ComponentIssuesLoader.loadOpenIssues(ComponentIssuesLoader.java:88)
	at org.sonar.ce.task.projectanalysis.issue.TrackerBaseInputFactory$FileTrackerBaseLazyInput.loadIssues(TrackerBaseInputFactory.java:77)
	at org.sonar.core.issue.tracking.LazyInput.getIssues(LazyInput.java:50)
	at org.sonar.core.issue.tracking.FilteringBaseInputWrapper.<init>(FilteringBaseInputWrapper.java:34)
	at org.sonar.core.issue.tracking.NonClosedTracking.of(NonClosedTracking.java:35)
	at org.sonar.core.issue.tracking.Tracker.trackNonClosed(Tracker.java:34)
	at org.sonar.ce.task.projectanalysis.issue.TrackerExecution.track(TrackerExecution.java:53)
	at org.sonar.ce.task.projectanalysis.issue.IssueTrackingDelegator.track(IssueTrackingDelegator.java:52)
	at org.sonar.ce.task.projectanalysis.issue.IntegrateIssuesVisitor.visitAny(IntegrateIssuesVisitor.java:72)
	... 33 more
Caused by: org.postgresql.util.PSQLException: ERROR: column i.issue_attributes does not exist
  Position: 429
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2674)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2364)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:354)
	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:484)
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:404)
	at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:162)
	at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:151)
	at org.apache.commons.dbcp2.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:94)
	at org.apache.commons.dbcp2.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:94)
	at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64)
	at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)
	at org.apache.ibatis.executor.ReuseExecutor.doQuery(ReuseExecutor.java:60)
	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325)
	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)
	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:89)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:151)
	... 50 more

If I run the analysis again, probably the task will finish OK and the details will be shown, as we can see in the first screen.

Can anyone help me by shedding some light on this?
I would like to understand why sometimes it fails and sometimes it doesn’t.

Here some more info.

  • Database: PostgreSQL
  • Database Version: 11.12
  • JDK 11 or higher

Hi,

Welcome to the community!

Thanks for providing the log snippet!

Could you go a step further and check the Error Details (Background Tasks → [failed row] → [cog menu] → Show Error Details) across several failed jobs and see if the causes are consistent, please? (And also tell us what they are? :smiley:)

 
Thx,
Ann

Hi, Javier is a patner.

The log is the same always:

### Error querying database.  Cause: org.postgresql.util.PSQLException: ERROR: column i.issue_attributes does not exist Position: 429

This appears in some executions, with a high frequency.

Hi @jonatsan,

Welcome to the community! Sorry it’s under these circumstances.

Thanks for the follow-up. The team is actively investigating this. We should have more soon.

 
Ann

Thank you for the welcome @ganncamp, we are waiting for any instructions to correct this issue.