Unable to Connect to Database Any Longer

Must-share information (formatted with Markdown):

  • which versions are you using: sonarqube server 2026.4.0.125744+
  • how is SonarQube deployed: zip
  • what are you trying to achieve: Troubleshooting Database connection
  • what have you tried so far to achieve this

Hey all,

Recently went to test the latest version on my test server and went to upgrade to 2026.4.1.126914 from 2026.4.0.125744. Process went pretty normally, no issues. Server came up clean. Typically after an upgrade, I need to go to the maintenance page at https://localhost:9000/setup and then there’s a database upgrade tool available however, this time I got a message that said it was unable to connect to the database and to reach out to an admin. I dug into the logs and I found the following message:

{“process”:“web”,“timestamp”:“2026-09-25T09:38:26.164-04:00”,“severity”:“WARN”,“logger”:“org.springframework.context.annotation.AnnotationConfigApplicationContext”,“message”:“Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@70dea4e-org.sonar.db.StartMyBatis’: Fail to connect to database”}

{…org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:603)“,”\t… 45 common frames omitted","\t\tCaused by: “,”\t\tcom.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Database ‘sonar’ on server ‘’ is not currently available. Please retry the connection later. If the problem persists, contact customer support, and provide them the session tracing ID of ‘{9411464A-0310-4C23-814E-128918DAC08A}’…}

I loaded up SSMS from the same server and went to connect with the credentials that SonarQube should be using and everything was fine. I could see the database, the tables… everything seemed normal to me. I went to attempt to log into the server itself and it allowed me to do this which is unusual. Typically after an upgrade you cannot log in until you upgrade the database backend. As I browsed around, it was basically a new server with none of my existing projects in the test server available.

Thinking there was something wrong with the version, I reverted to the older version (2026.4.0.125744) and attempted to bring the server back online but I got the same issue. I am not sure where to start with this as the database is available and the credentials work. It seems like sonarqube is maybe having some sort of driver issue? Thoughts?

Other info:

  • OpenJDK-21.0.11+10
  • Windows server 2022
  • Azure SQL Database

Hey @l1nklight, the message:

Database sonar on server … is not currently available. Please retry the connection later. If the problem persists, contact customer support, and provide them the session tracing ID …

is returned by Azure SQL, not SonarQube. SonarQube is just surfacing the JDBC error through HikariCP. When this happens, the database itself is reporting that it isn’t available; the session tracing ID is what Azure support/tools use to find the exact reason.

The fact that after the upgrade you can log into SonarQube and see what looks like a brand-new, empty instance suggests that at least some startups are not pointing at your original Azure SQL database (for example, defaulting back to the embedded H2 DB or to a different schema/DB instance).

To narrow this down, I recommend you check what DB SonarQube is actually using now:

  • Start SonarQube, go to Administration > System, and share (sanitized) what you see under Database: engine, version, and JDBC URL. This will tell us whether the running instance is on H2 or on a different Azure SQL DB/schema.
  • Is this the same DB/JDBC connection string that you would expect? Is it the same that you were connecting manually to?

Awesome write up Andres. Thank you very much. Let me investigate using the tips you gave me and I’ll get back to you if I find anything. Really appreciate the response.