Inconsistent issue count between project overview and issues list after ES reindex (Docker+EC2 ASG)

Hi everyone,

We are running SonarQube Server Developer Edition v2025.4.2 (112048) in a Docker container on EC2, with a PostgreSQL database hosted on RDS.

Our EC2 instances are managed by an Auto Scaling Group, which means they are periodically recreated.

Problem

We have observed that, for some projects, the number of issues displayed in the project overview differs from the number shown in the issues list.

Examples:

What we’ve tried

Based on the documentation, we suspected an Elasticsearch indexing inconsistency after instance recreation.

We attempted to force reindexing by:

  1. Stopping the container
  2. Removing the ES data directory: /opt/sonarqube/data/es8
  3. Starting the container again

However, this approach is not reliable:

  • Sometimes it resolves the issue
  • In most cases, the discrepancy remains

Logs and background tasks

We reviewed the Compute Engine logs (logs/ce.log) and found only successful operations, for example:

2026.06.25 11:49:51 INFO ce[][o.s.c.t.CeWorkerImpl] Execute task | project=MyProject | type=ISSUE_SYNC | branch=main | branchType=BRANCH | id=54eb3ee8-0121-4d63-bda3-92c3886f9abe
2026.06.25 11:49:51 INFO ce[54eb3ee8-0121-4d63-bda3-92c3886f9abe][o.s.c.t.s.ComputationStepExecutor] Ignore orphan component | status=SUCCESS | time=4ms
2026.06.25 11:49:51 INFO ce[54eb3ee8-0121-4d63-bda3-92c3886f9abe][o.s.c.t.p.t.IndexIssuesStep] indexing issues of branch dea1eac5-ade3-45cb-9146-7ec9f33436a5
2026.06.25 11:49:51 INFO ce[54eb3ee8-0121-4d63-bda3-92c3886f9abe][o.s.c.t.s.ComputationStepExecutor] index issues | status=SUCCESS | time=14ms
2026.06.25 11:49:51 INFO ce[54eb3ee8-0121-4d63-bda3-92c3886f9abe][o.s.c.t.CeWorkerImpl] Executed task | project=MyProject| type=ISSUE_SYNC | branch=main | branchType=BRANCH | id=54eb3ee8-0121-4d63-bda3-92c3886f9abe | status=SUCCESS | time=33ms
The Background Tasks view also does not report any failures or warnings.

Questions

  • What could be the root cause of this discrepancy between the project overview and the issues list?
  • Is there a recommended way to properly force a full and consistent reindex in this setup?
  • Could this be related to running SonarQube in an ephemeral environment (ASG + Docker + non-persistent ES data)?

At the moment, simply removing the Elasticsearch data directory is not a reliable fix.

Any suggestions or guidance would be greatly appreciated.

Thanks in advance!

Hey @Cristoph, welcome to the Community!

Indeed this looks like an Elasticsearch problem. Do you see any warnings or errors in the Elasticsearch logs (es.log)? Could you share the logs?