SonarQube: DB Connection error

  • SonarQube version 10.4.0.87286
  • SonarQube deployment: docker

Regularly (once a week), we have to restart the server to resolve a DB connection error.
Compute Engine Database Connection displays:

  • Pool Total Connections: 60
  • Pool Active Connections: 60
  • Pool Idle Connections: 0
  • Pool Max Connections: 60
  • Pool Min Idle Connections: 10
  • Pool Max Wait (ms): 8000
  • Pool Max Lifetime (ms): 1800000

Logs

2024.04.22 07:16:16 INFO  ce[be924281-06eb-4844-b91b-afa79628fdbe][o.s.c.t.CeWorkerImpl] Executed task | project=ac.jcard.fido_4.0 | type=REPORT | id=be924281-06eb-4844-b91b-afa79628fdbe | status=FAILED | time=10018ms
2024.04.22 07:16:24 ERROR ce[][o.s.c.t.CeWorkerImpl] Call to listener ReportAnalysisFailureNotificationExecutionListener failed.
org.apache.ibatis.exceptions.PersistenceException:
### Error getting a new connection.  Cause: java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 8000ms.
### Cause: java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 8000ms.

Hi,

Welcome to the community!

Take a look at the connection pool settings.

 
HTH,
Ann

Hello Ann,

The issue does not seem to be related with the connection pool settings, but rather to the fact that DB connections seem not be released properly. As a consequence, the count of active connections grows until it reaches the total count of connections. In our case, it usually takes one week until we reach this limit and we have to restart the server to reset the counter.
Thanks

Pol

Hi,

This is a bug in SonarQube 10.4, you must update it to 10.4.1 or a newer version.

1 Like

Thanks for this answer. Will upgrade our version.