SonarQube Background Tasks gets canceled

Let’s discuss what you have in mind!

Try to describe the problem or opportunity you are seeing and why it matters. The closer you stick to this topic template, and the more information you provide, the better chance you have to generate a real discussion.

A few questions to help you:

  • What are you trying to accomplish? - Sonarqube Integration with Postgresql in AWS
    Issue Background:
    Always the Sonarqube BG tasks going to CANCELED State whenever the projects gets analyzed via Jenkins pipeline.
    Sonarqube Developer Edition - 8.9.6 in AWS EC2
    Postgresql Version - 11.13 in Aurora Postgresql

Error seen in ce.log for BG task:

2022.08.11 19:26:32 ERROR ce[AYKMo3VGq9qcN_B0-nfn-test][o.s.c.t.CeWorkerImpl] Failed to finalize task with uuid 'AYKMo3VGq9qcN_B0-nfn-test' and persist its state to db
java.lang.IllegalStateException: Task does not exist anymore: CeTask{type=REPORT, uuid=AYKMo3VGq9qcN_B0-nfn-test, component=Component{uuid='AYJdGuuPDfXJ0mJNO1vO', key='sf-smt:BRANCH:SMT-Jenkins_Library_Test', name='sf-smt'}, mainComponent=Component{uuid='AXvzIA_0IQTxJco-TJEJ', key='sf-smt', name='sf-smt'}, submitter=User{uuid='AXVkLPN0Vy6y5LAkfGTy', login='user1'}}
2022.08.11 19:26:32 INFO  ce[AYKMo3VGq9qcN_B0-nfn][o.s.c.t.CeWorkerImpl] Executed task | project=sf-smt | type=REPORT | branch=SMT-Jenkins_Library_Test | branchType=BRANCH | id=AYKMo3VGq9qcN_B0-nfn | submitter=user1 | status=SUCCESS | time=292135ms

Hey there.

Most often, this error is a result of multiple SonarQube application instances connecting to the same database. You should check to see if that’s happened (even by accident).