Helm deployment always using H2 instead of Azure psql

  • which versions are you using -sonarqube:9.9-developer
  • how is SonarQube deployed: Helm chart
  • what are you trying to achieve - To connect Azure postgreSQL server using jdbc connection with sonarqube in AKS
  • what have you tried so far to achieve this - I’m able to run sonarqube but its not showing any connection related information with Azure PostgreSQL. Its using h2 database.Also tried to connect the psql using another pod in same namespace (kubectl run pgsql-client…)

sonarqube-sonarqube-0.log (58.3 KB)

Hi,

What do your server logs say?

 
Ann

Hi Ann,
Attached are all the logs that I cud collect from UI.Cant find anything related to azure psql database.
ServerLogs.zip (331.7 KB)

Hi,

Your server logs - specifically the three (identical?) copies of web.log start after server startup. Can you clear the logs, restart and provide those logs, please? INFO-level is fine.

 
Thx,
Ann

Hi Ann,
Attached are the new web.log (INFO)
sonarqube_web.log (83.2 KB)

Hi,

SonarQube is pretty immediately starting H2:

2023.06.06 14:45:01 INFO  web[][o.s.p.ProcessEntryPoint] Starting Web Server
2023.06.06 14:45:04 INFO  web[][o.s.s.p.LogServerVersion] SonarQube Server / 9.9.0.65466 / ce743843018827cb30c05735e7971523de34bb48
2023.06.06 14:45:05 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.06.06 14:45:05 INFO  web[][o.s.s.p.d.EmbeddedDatabase] Embedded database started. Data stored in: /opt/sonarqube/data
2023.06.06 14:45:05 INFO  web[][o.sonar.db.Database] Create JDBC data source for jdbc:h2:tcp://127.0.0.1:9092/sonar;NON_KEYWORDS=VALUE
2023.06.06 14:45:05 INFO  web[][c.z.h.HikariDataSource] HikariPool-1 - Starting...
2023.06.06 14:45:05 INFO  web[][c.z.h.p.HikariPool] HikariPool-1 - Added connection conn2: url=jdbc:h2:tcp://127.0.0.1:9092/sonar user=
2023.06.06 14:45:05 INFO  web[][c.z.h.HikariDataSource] HikariPool-1 - Start completed.
2023.06.06 14:45:05 WARN  web[][o.s.db.dialect.H2] H2 database should be used for evaluation purpose only.

That makes me think it’s not seeing the properties for your external database. How/where have you specified them?

 
Ann

Using helm values.yaml

Hi,

You seem to have used the envvar names instead of what I’m seeing in the chart.

 
Ann

Hi,
Had tried the chart’s version of JDBC values earlier but same issue.
Applied again and here are new web.log(INFO) and helm values.
sonarqube_web.log (73.6 KB)

Hi,

Okay. This is not my forte. I’m flagging it for other eyes.

 
Ann

Hi Ann,
Is there any audience or group I cud ask for help please ?

Hi @overtocloud ,

I think there is a typo in your values.yaml file.

for jdbcOverwrite, it should be enable and not enabled (documentation):

jdbcOverwrite:
  # If enable the JDBC Overwrite, make sure to set `postgresql.enabled=false`
  enable: false
``

Hi Leo,
Changed it to - enable: true
But now it complains about Username format

Caused by: org.postgresql.util.PSQLException: FATAL: Invalid Username specified. Please check the Username and retry connection. The Username should be in username@hostname format.

Tried with this format but not helped:


Attached are the pod logs
sonarqube-sonarqube-0.log (21.2 KB)

Typically, the username is just a single string, not a username@hostname format. What is the name of your user that can access the Azure PostgreSQL database? Is it sonarqube-admin?

Hi Joe,
Yes its sonarqube-admin

So when you use jdbcUsername: sonarqube-admin does your SonarQube Helm chart deployment work?

Pod is green when using `jdbcUsername: sonarqube-admin@sonarqube-dev-postgresql-1
Thanks

1 Like

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