sql exception

Unexpected exception SQLException/ConnectException: SQL error when doing 'Taking a connection from the data source'

Connection to 127.0.0.1:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. (after 10 attempt(s); total time spent waiting 692.909 ms; driver version 42.3; java.version=1.8.0_131; jdk.tls.client.protocols=[]; jdk.certpath.disabledAlgorithms=[MD2, MD5, RSA keySize < 1024, DSA keySize < 1024, EC keySize < 224]; jdk.tls.disabledAlgorithms=[SSLv3, RC4, MD5withRSA, DH keySize < 768, EC keySize < 224]) I am using Teamcity 2017.1.3 and gcloud postgres database. I have raised couple of questions before and all left unanswered. Please respond to this.

 

Thanks!!

6 comments
Comment actions Permalink

The error means that TeamCity cannot connect to the database. Please make sure the db process is running and there is nothing blocking the connection. Also make sure the connection is being attempted with the right url and settings.

 

If you have upgraded the database recently, since you are using a very old version of java and teamcity, it might be that an old connector is not able to connect to a newer version. TeamCity 2017.1 has been out of support for several years now. You should consider upgrading teamcity, your java installation and probably the postgresql connector for the database.

0
Comment actions Permalink

Hi Thanks for the rapid response. But this is weird that the restart of the Teamcity pod works fine again. I am not sure what is wrong in here. 

0
Comment actions Permalink

TeamCity depends on the database so it attempts to connect to it very soon. If your services do not start in the proper order, teamcity might start before the database and be unable to connect to it. I haven't ever seen this with the database but it used to happen regularly with docker, so you might want to verify that.

 

Since you have mentioned it being a "pod", I'd assume you are running it on kubernetes. You should probably also consider running the database in a separate instance/container/pod.

0
Comment actions Permalink

It's gcloud sql and we are not running the database as pod. 

0
Comment actions Permalink

Hi We are running gcloud sql which is connected to the teamcity server running on GKE. Can we install version of java11 with 2017.x version of teamcity server. 

0
Comment actions Permalink

Hi,

 

the error message clearly reports that it's trying to connect to 127.0.0.1:5432. This connection is defined in the database.properties file within the data directory, with 5432 being the default setting for postgresql.

 

If it's not on 127.0.0.1, either you misconfigured the path to the database, or the file is not being handled properly by your pod and it might have been modified/reset. Please ensure that this file is properly managed and it's persisted throughout cyclings of the instances.

0

Please sign in to leave a comment.