Missed Team ’24? Catch up on announcements here.

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

Trouble connecting PostgreSQL to Bitbucket

Benjamin Goodman September 4, 2018

I am trying to set up an instance of Bitbucket Server on a CentOS 7 VM with Apache, but I am having trouble trying to connect the Bitbucket Server to a PostgreSQL I installed. I set up PostgreSQL precisely according to this Atlassian support article: https://confluence.atlassian.com/bitbucketserver/connecting-bitbucket-server-to-postgresql-776640389.html 

 

When I run the Setup, I fill the fields out as per below:

Database Type: "PostgreSQL"

Hostname: [CentOS 7 VM Public IP] (I have also tried my local IP and 'localhost')

Port: 5432

Database name: [Name of my database ('bitbucket')]

Database username: [Username as configured in article, I have it as ('bitbucketuser')]

Database password: [Password]

 

I receive the following error message:

"The configuration entered is not valid. A database connection could not be established. Please check your configuration and try again.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:217) com.atlassian.stash.internal.db.DefaultDatabaseManager.prepareDatabase(DefaultDatabaseManager.java:183) com.atlassian.stash.internal.maintenance.SpringMaintenanceTaskFactory.migrationTask(SpringMaintenanceTaskFactory.java:132) ...Could not get JDBC Connection; nested exception is org.postgresql.util.PSQLException: Connection attempt timed out. 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:214) ...Connection attempt timed out. org.postgresql.Driver$ConnectThread.getResult(Driver.java:414) org.postgresql.Driver.connect(Driver.java:259) java.sql.DriverManager.getConnection(DriverManager.java:664)"

 

I have triple checked the database credentials, and made sure PostgreSQL is running as a service, so I am a bit confused by the error message.

1 answer

1 vote
Christian Glockner
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 4, 2018

Hi Simon,

The error that is relevant is

Connection attempt timed out

Bitbucket Server isn't able to connect to your Postgres server, there might be a firewall in between it and Bitbucket Server that's preventing access.

Cheers,

Christian

Premier Support Engineer

Atlassian

Benjamin Goodman September 6, 2018

I've just contacted my IT group and they seem to agree with you! Thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events