SonarQube 9.9 not connecting to external db; instead starts the embedded db

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Upgrading from 8.9 to 9.9 community edition

  • how is SonarQube deployed: zip, Docker, Helm
    Deploying using docker/docker-compose

  • what are you trying to achieve
    Upgrade of the sonarqube server which uses the DB that 8.9 was using

  • what have you tried so far to achieve this
    During the upgrade there were a few plugins which were causing issues which I removed; then I am not sure what changed but the sonarqube docker container started using the embedded DB instead of the external DB configured

Following is my docker-compose file

version: “3”

services:
sonarqube:
image: sonarqube:9.9-community
security_opt:
- seccomp:unconfined
container_name: sonarqube
ports:
- 9000:9000
environment:
- SONARQUBE_JDBC_URL=jdbc:sqlserver://10.10.10.10\IN16;databaseName=SOME_DB
- SONARQUBE_JDBC_USERNAME=someusername
- SONARQUBE_JDBC_PASSWORD=somepassword
volumes:
- sonarqube_conf:/opt/sonarqube/conf
- sonarqube_data:/opt/sonarqube/data
- sonarqube_extensions:/opt/sonarqube/extensions
- sonarqube_bundled-plugins:/opt/sonarqube/lib/bundled-plugins
- sonarqube_common:/opt/sonarqube/lib/common

volumes:
sonarqube_conf:
sonarqube_data:
sonarqube_extensions:
sonarqube_bundled-plugins:
sonarqube_common:

Logs indicate H2 DB was started

9.1.69595.jar)
WARNING: Please consider reporting this to the maintainers of org.sonar.process.PluginSecurityManager
WARNING: System::setSecurityManager will be removed in a future release
2023.07.27 13:39:32 INFO  web[][o.s.p.ProcessEntryPoint] Starting Web Server
2023.07.27 13:39:33 INFO  web[][o.s.s.p.LogServerVersion] SonarQube Server / 9.9.1.69595 / ab53fa3b811b30e6c4391e9f77edce9019d84480
2023.07.27 13:39:34 INFO  web[][o.s.s.p.d.EmbeddedDatabase] Starting embedded database on port 9092 with url jdbc:h2:tcp://127.0.0.1:9092/sonar;NON_KEYWORDS=VALUE
2023.07.27 13:39:34 INFO  web[][o.s.s.p.d.EmbeddedDatabase] Embedded database started. Data stored in: /opt/sonarqube/data
2023.07.27 13:39:34 INFO  web[][o.sonar.db.Database] Create JDBC data source for jdbc:h2:tcp://127.0.0.1:9092/sonar;NON_KEYWORDS=VALUE
2023.07.27 13:39:34 INFO  web[][c.z.h.HikariDataSource] HikariPool-1 - Starting...
2023.07.27 13:39:34 INFO  web[][c.z.h.p.HikariPool] HikariPool-1 - Added connection conn2: url=jdbc:h2:tcp://127.0.0.1:9092/sonar user=
2023.07.27 13:39:34 INFO  web[][c.z.h.HikariDataSource] HikariPool-1 - Start completed.
2023.07.27 13:39:34 WARN  web[][o.s.db.dialect.H2] H2 database should be used for evaluation purpose only.

Can someone please suggest what might be the issue?

Hi,

It’s subtle, and a lot of people miss it even after reading the LTS to LTS release upgrade notes, but the deprecated SONARQUBE variable names were dropped. You need to switch to SONAR.

 
HTH,
Ann