Must-share information (formatted with Markdown):
- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
We are using SonarQube Version: 9.0.0-enterprise - how is SonarQube deployed: zip, Docker, Helm
We are deploying the Postgres DB, nginx-ingress and SonarQube using helm chart. - what are you trying to achieve
I have an external MS Sql db created in another resource group and I am trying to copy/ migrate the data from Postgres db which is inside the AKS cluster to MS Sql DB which is outside the AKS.
I have installed DB copy tool, I am trying to use below command to migrate data
*java -jar sonar-db-copy-1.6.0.2092-jar-with-dependencies.jar -urlSrc jdbc:postgresql://sonarqubetest.postgres.database.azure.com:5432/sonarDBNew -userSrc sonarUserNew -pwdSrc **** -urlDest 'jdbc:sqlserver://sonarqubenew.database.windows.net:1433;database=sonarnewDB' -userDest sonarUserNew -pwdDest *****
I am getting the below error that cant reach to postgres DB even if I give the correct url,
Exception in thread "main" com.sonar.dbcopy.utils.toolconfig.SqlDbCopyException: Database can not be reached at url jdbc:postgresql://sonarqube-postgresql:5432/sonarDB. Verify url, user name and password.
at com.sonar.dbcopy.prepare.ConnectionVerifier.databaseIsReached(ConnectionVerifier.java:31)
at com.sonar.dbcopy.StartApp.main(StartApp.java:71)
Caused by: org.postgresql.util.PSQLException: The connection attempt failed.
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:331)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:247)
at org.postgresql.Driver.makeConnection(Driver.java:434)
at org.postgresql.Driver.connect(Driver.java:291)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:681)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:229)
at com.sonar.dbcopy.prepare.ConnectionVerifier.databaseIsReached(ConnectionVerifier.java:24)
... 1 more
Caused by: java.net.UnknownHostException: sonarqube-postgresql
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:567)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
at java.base/java.net.Socket.connect(Socket.java:633)
at org.postgresql.core.PGStream.createSocket(PGStream.java:241)
at org.postgresql.core.PGStream.<init>(PGStream.java:98)
at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:109)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:235)
... 8 more
Pods:
NAME READY STATUS RESTARTS AGE
sonarqube-ingress-nginx-controller-67fb67b5c9-rvdlj 1/1 Running 0 9d
sonarqube-postgresql-0 1/1 Running 0 26d
sonarqube-sonarqube-0 1/1 Running 11 (7d21h ago) 26d
Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!