After upgrading from SonarQube 8.9.9 Community to 9.9.2, server starts up fine but after hours of running, it seems it disconnects from the MSSQL server:
2023.09.28 11:54:42 ERROR web[][o.s.s.p.w.RootFilter] Processing of request /api/measures/component?additionalFields=period%2Cmetrics&metricKeys=alert_status%2Cquality_gate_details&componen
t=com.flowtraders.fi.midmodels%3Afi-mid-models%3Afeature-OAS-5821 failed
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 8000ms.
### The error may exist in org.sonar.db.user.UserTokenMapper
### The error may involve org.sonar.db.user.UserTokenMapper.selectByTokenHash
### The error occurred while executing a query
### Cause: java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 8000ms.
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
Our kerberos ticket is valid:
root@<SONAR.HOSTNAME>:~# klist
Ticket cache: FILE:/tmp/krb5cc_0
Default principal: svc-nlsqlsonar-java@OUR.REDACTED.REALM
Valid starting Expires Service principal
09/28/2023 08:17:01 09/28/2023 18:17:01 krbtgt/OUR.REDACTED.REALM@OUR.REDACTED.REALM
renew until 10/02/2023 16:15:32
And simply shutting down SonarQube and starting it back up (without renewing the kerberos ticket) makes it work again, until it randomly happens again after a few hours. Servers are in the same network, has the same NTP servers etc.
We are running SonarQube on Debian Bullseye11.5, which is using OpenJDK Runtime Environment (build 17.0.6+10-LTS) against a MSSQL 2016 server.
Our jdbc connector string looks like this:
sonar.jdbc.url=jdbc:sqlserver://<REDACTED_SERVER_NAME>;databaseName=SonarJava;integratedSecurity=true;trustServerCertificate=true;authenticationScheme=JavaKerberos
I verified that we use Latin1_General_CS_AS
Can possibly be related to these issues, CORRECTION: we still see these errors.