SonarQube background task is getting stuck

Hello Team,
We are using Sonarqube Enterprise Edition Version 9.9.1 (build 69595).
We are facing issues where the background tasks are stuck at pending status and delete option is also not available for them.
No new tasks can be executed also once a task is stuck. So, every task which is triggered after this stuck task also gets into pending state. This makes our CI pipelines waiting and fail after the reaching timeout at publish quality gate stage as the analysis is yet not complete and stuck.
So, we are not able to get the notification for the tasks as well which are stuck at waiting stage and only getting to know from the developers that the pipelines are failing.

The Sonarqube is running as zip on windows.

Welcome :slight_smile:

did you change something in your Sonarqube setup recently, like
Java memory settings, CE worker threads, new plugins ?

Did you already try to restart Sonarqube ?

Those problems may be caused by

  • database performance
  • network performance
  • disk i/o
  • cpu and memory

see Improving performance

For the last point = cpu + memory, try to decrease your CE worker threads
Also increase the loglevel to get more details

Start with DEBUG, TRACE will also log every SQL statement


I just observed that the issue is occurring for the same project everytime which takes even days and still in the scanning status and cancel option not available. Also, this project shows 4 million lines of code in xml which are not even present in the branch.

I restart the server and it resolves the issue but it’s the problem with detecting the issue which is only detected when some user reports them.

Not quite clear to me.
So, the Sonarqube analysis was successfull, but when Sonarqube starts the CE task for this analysis the Sonarqube server runs out of order ?

Did you already increase the Sonarqube log level and check the logs ?