Sonarqube- can't connect to MSSQL database with SQL authenthication

Hi. I’m trying to install the community version of sonarqube- and connect it to MSSQL database.

I went with SQL authentication option, and created a SQL login and blank database (on a local MSSQL instance) with that login as an admin.

From the web.log I see the following:
Caused by: java.lang.IllegalStateException: Can not connect to database. Please check connectivity and settings (see the properties prefixed by ‘sonar.jdbc.’).
at org.sonar.db.DefaultDatabase.checkConnection(
at org.sonar.db.DefaultDatabase.start(
… 48 common frames omitted
Caused by: java.sql.SQLException: Cannot create PoolableConnectionFactory (The TCP/IP connection to the host localhost, port 1433 has failed. Error: “Connection refused: no further information. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.”.)
web.log (12.9 KB)

From the log itself, I assume that the configuration within sonar.conf was correct, but the issue is with the database connectivity itself. Am I correct? Any ideas on how to fix this?

I assume this might be a frequent issue on setup, but didn’t find any troubleshooting guide.

PS: Integrated Security option didn’t work as well, same issue.

It seems that TCP/IP connections were disabled for SQL server. I’ve manually enabled them via:
Microsoft SQL Server > Configuration Tools > SQL Server Configuration Manager

Now there’s another error:
Caused by: java.sql.SQLException: Cannot create PoolableConnectionFactory (The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: “PKIX path building failed: unable to find valid certification path to requested target”.

web.log (12.1 KB)

I’ve installed JRE and manually updated the connection string by adding


as was mentioned here:

It did solve the issue. Guys, you need to update the installation guide considering all of the possible and frequent pitfalls.

Thanks for the feedback. It does seem this was addressed in the Upgrade Guide, but nowhere else in the docs. I’ll ping the right team to see if we can improve something here.

1 Like

Thanks, I’ve created a ticket for the documentation team to make this update.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.