Hello! I'm trying to connect Bitbucket to a external postgresql database and I get the following error:
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) ... Failed to obtain JDBC Connection; nested exception is org.postgresql.util.PSQLException: Connection to 172.18.10.230: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:81) com.atlassian.stash.internal.db.DefaultDatabaseValidator.validate(DefaultDatabaseValidator.java:44) com.atlassian.stash.internal.db.DefaultDatabaseManager.validateConfiguration(DefaultDatabaseManager.java:214) ... Connection to 172.18.10.230: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:405) org.postgresql.Driver.connect(Driver.java:263) java.sql.DriverManager.getConnection(DriverManager.java:664)
I have checked that I am listening at that port and it is true. I have also added at pg_hba.conf file the following
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 trust
host all all 172.18.0.0/16 trust
I have also added at postgresql.conf the following
listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
port = 5432 # (change requires restart)
I am configuring something wrong but i don't know where. Could you please help me?
Hello Idoia and welcome to the Community!
Thanks for including your log output and your configuration for PostgreSQL. From looking at your log output and your notes, there is an issue with the Database connection with Bitbucket. There are a few things we’d like to verify, please check the following:
ps -f -u postgres
psql -h 172.18.10.230 -p 5432
If you’re still having issues after running through and verifying the above please reach out and let us know.
Regards,
Stephen Sifers
Thank you Stephen!
It works!!! My firewall was blocking outgoing connections from Bitbucket
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.