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?