Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Not able to connect Bitbucket with Postgres database

devesh-s December 6, 2017

Hi Team,

I am not able to connect my Bitbucket with Postgres database. I have checked Postgres database is up and running on port 5432 and I have created user named Postgres I have set the password for the same. I have created one database named Bitbucket. I am getting below mentioned error while connecting. This is little urgent I appreciate if you could help me ASAP.

The configuration entered is not valid. A database connection could not be established. Please check your configuration and try again. 

Hide details

The configuration entered is not valid. A database connection could not be established. Please check your configuration and try again.
  com.atlassian.stash.internal.db.DefaultDatabaseManager.validateConfiguration(DefaultDatabaseManager.java:230)
  com.atlassian.stash.internal.db.DefaultDatabaseManager.prepareDatabase(DefaultDatabaseManager.java:187)
  com.atlassian.stash.internal.maintenance.SpringMaintenanceTaskFactory.migrationTask(SpringMaintenanceTaskFactory.java:140)
  ...
Could not get JDBC Connection; nested exception is org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "35.177.107.246", user "postgres", database "bitbucket", SSL off
  org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80)
  com.atlassian.stash.internal.db.DefaultDatabaseValidator.validate(DefaultDatabaseValidator.java:44)
  com.atlassian.stash.internal.db.DefaultDatabaseManager.validateConfiguration(DefaultDatabaseManager.java:227)
  ...
FATAL: no pg_hba.conf entry for host "35.177.107.246", user "postgres", database "bitbucket", SSL off
  org.postgresql.Driver$ConnectThread.getResult(Driver.java:365)
  org.postgresql.Driver.connect(Driver.java:288)
  java.sql.DriverManager.getConnection(DriverManager.java:664)
  ...

 

1 answer

0 votes
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 7, 2017

Hi Devesh,

Can you have a look at this resolution and see if it helps you? 

Let us know if you have any trouble.

Regards,

Shannon

Alejandro Calderón April 3, 2019

I have the same problem and this solution didn't work for me...

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 4, 2019

Alejandro,

Welcome to Community, it's nice to meet you.

It's possible that there's another issue causing you not to be able to connect to Postgres. The best thing to do here is to gather the error messages related to this problem from your server logs, and submit either as a Support Ticket, or raise a new question. Then we can have a look at your issue specifically to solve the problem.

Let me know if you have any trouble.

Regards,

Shannon

Binbin Zhao August 22, 2020
The configuration entered is not valid. A database connection could not be established. Please check your configuration and try again.
 com.atlassian.stash.internal.db.DefaultDatabaseManager.validateConfiguration(DefaultDatabaseManager.java:217)
 com.atlassian.stash.internal.migration.DefaultDatabaseMigrationService.validateConfiguration(DefaultDatabaseMigrationService.java:85)
 sun.reflect.GeneratedMethodAccessor1218.invoke(Unknown Source)
 ...
Failed to obtain JDBC Connection; nested exception is org.postgresql.util.PSQLException: Connection to 10.1.6.26:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
 org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:82)
 com.atlassian.stash.internal.db.DefaultDatabaseValidator.validate(DefaultDatabaseValidator.java:43)
 com.atlassian.stash.internal.db.DefaultDatabaseManager.validateConfiguration(DefaultDatabaseManager.java:214)
 ...
Connection to 10.1.6.26:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
 org.postgresql.Driver$ConnectThread.getResult(Driver.java:409)
 org.postgresql.Driver.connect(Driver.java:267)
 java.sql.DriverManager.getConnection(DriverManager.java:664)
 ...
Connection refused (Connection refused)
 java.net.PlainSocketImpl.socketConnect(Native Method)
 java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
 java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
 ...


The solution also did not work for me.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events