Sonarqube MS SQL Connection

hi,

could you please provide clear instructions on how to connect sonarqube to an MS SQL Server with Always On availability group (AOAG)

My sonarqube installation works fine when used with a DB on the local host.

Having upgraded to the developer edition for production, the recommendation is to have the DB on a remote SQL server. A remote SQL server in AOAG configuration is already available.

The AOAG consists of two sql servers, clustered with AOAG with a Listener at the front.

The JDBC driver for ms sql has been copied to /opt/sonarqube/extensions/jdbc-drver/mssql

The sonarqube host is a RHEL 9.4

SQL server is SQL 2019

Both the sonarqube server and SQL server are joined to a windows domain.

The authentication method being attempted is windows integrated authentication with a domain service account.

My expectation is that the jdbc URL will be with the listener :port.

jdbc:sqlserver://listener:port;databaseName=sonarqube;integratedSecurity=true;encrypt=false,

Error message received is “TCP Connection to the host, port has failed. “the driver received an unexpected pre-login response.”

Is AOAG configuration for SQL with windows integrated authentication supported for domain environments or does it strictly have to be SQL authentication?

If it is, could you please provide further information.

Also, could you please advice how to raise a ticket for sonar-support. Due to the changes in SQL DBs, my license key will need to be refactored.

many thanks

Hey there.

What version of SonarQube are you using?

Thanks for the reply Colin.

Version 2025.1.2.108896

Thanks!

Since you’re trying to use integrated security, have you followed the instructions to:

  1. Download the Microsoft SQL JDBC Auth 12.8.1 package and copy mssql-jdbc_auth-12.8.1.x64.dll to a folder location set in the PATH environment variable on SonarQube Server host.
  2. If you’re running SonarQube Server as a Windows service, make sure the Windows account under which the service is running has permission to connect your SQL server.

Thanks.

The dll is microsoft server specific and only works if sonarqube is installed on a windows server.

When sonarqube is installed on a linux server (red hat in this case), the Microsoft proprietary dll file is not recognised. Per my initial query m sonarqube is on a red hat server.

I have installed the jdbc driver in the …./mssql

In that case, we would reccomend using SQL authentication. It may be possible to use integrated auth, but you’ll kind of be on your own to figure it out.