at first glance there’s nothing suspicious, all normal.
What’s your Sonarqube version, which edition ?
Out of the box http://localhost:9000 should bring up the Sonarqube login page.
We need to check the logs in $SONARQUBE_HOME\logs to see what’s going on.
Just attach the logs, don’t forget to sanitize sensitive contents.
2021.02.17 11:52:46 ERROR web[o.s.s.p.PlatformImpl] Web server startup failed
java.lang.IllegalStateException: Fail to connect to database
…
Caused by: java.lang.IllegalStateException: Can not connect to database. Please check connectivity and settings (see the properties prefixed by ‘sonar.jdbc.’).
…
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost, port 1433 has failed. Error: “Connection refused: connect. 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.”.
You didn’t mention your Sonarqube version and edition (Community, Developer, Enterprise).
Did you change the builtin H2 database setting ?
If yes, what’s your jdbc connection string in SONARQUBE_HOME\conf\sonar.properties ?
Did you check common connection problems like firewall, proxies … etc. ?
Maybe it’s also related to a missing dll when using integrated authentication for jdbc connection !?
e.g. noticed this yesterday when updating from Sonarqube 8.6.0 to 8.7, i had to upgrade to a recent version of this dll to make it work.
Try setting loglevel=DEBUG in SONARQUBE_HOME\conf\sonar.properties and restart to get
more infos. Perhaps you’ll get similar log entries if those are only seen in debug level, as i use always
loglevel debug in test.
seems you have changed the jdbc connection string in the meantime.
The first error was:
2021.02.17 12:54:43 INFO web[o.sonar.db.Database] Create JDBC data source for jdbc:sqlserver://localhost;databaseName=sonar;integratedSecurity=true
2021.02.17 12:54:57 ERROR web[o.s.s.p.PlatformImpl] Web server startup failed
java.lang.IllegalStateException: Fail to connect to database
…
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost, port 1433 has failed. Error: “Connection refused: connect. 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.”.
but no entry about ‘no suitable driver’. Maybe it’s the wrong port, AFAIK 1433 is the default port and it’s
recommended to change that. Maybe you’re not authorized for DB access ?
The most recent error has another jdbc connection string and the ‘no suitable driver’ error message
Caused by: java.sql.SQLException: Cannot create JDBC driver of class 'com.microsoft.sqlserver.jdbc.SQLServerDriver' for connect URL 'jdbc:sqlserver:\trg-devops-win-SQLEXPRESS;databaseName=sonar;integratedSecurity=true'
at org.apache.commons.dbcp2.DriverFactory.createDriver(DriverFactory.java:75)
at org.apache.commons.dbcp2.BasicDataSource.createConnectionFactory(BasicDataSource.java:472)
at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:538)
at org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:753)
at org.sonar.db.profiling.NullConnectionInterceptor.getConnection(NullConnectionInterceptor.java:31)
at org.sonar.db.profiling.ProfiledDataSource.getConnection(ProfiledDataSource.java:317)
at org.sonar.db.DefaultDatabase.checkConnection(DefaultDatabase.java:115)
... 25 common frames omitted
Caused by: java.sql.SQLException: No suitable driver
at org.apache.commons.dbcp2.DriverFactory.createDriver(DriverFactory.java:68)
... 31 common frames omitted
Also not sure if Sonarqube supports MSSQL Express database !?
@Colin is right, good catch, missed that at first glance.
Your logs show two different jdbc connection strings, when =
the first one has the right syntax, but either the wrong port, missing permissions or general network problems.
the second one has the wrong syntax and no suitable driver,
see Building the connection URL - SQL Server | Microsoft Docs