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

Connecting confluence to Postgres database error

Ranga vittal March 18, 2019

Have hosted Confluence on Docker container and Postgres on another container. Both the containers are up and running. When I try to test the connection it says '

Can't reach database server or port

SQLState - 08001
org.postgresql.util.PSQLException: The connection attempt failed.'

The IP address is correctly entered


I have exposed port 5432

Anything that I have missed?

3 answers

0 votes
Pooja February 22, 2021

Any resolution?

0 votes
adam_zhou@vanguard.com.cn December 27, 2020

SQLState - 08001
org.postgresql.util.PSQLException: The connection attempt failed.

 

i have the same issue~

there is no problem for my jira, bitbucket jira service desk to connect the postgres. 

i'm using the postgres paas service on Azure cloud.  

0 votes
Rafael Pinto Sperafico
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 18, 2019

Hi @Ranga vittal ,

Are you running Confluence and Postgres from the same Docker, meaning that they are on the same box session? If so, Confluence should be able to connect to PostgreSQL when providing its container's name.

As a suggestion, you could create a Network in docker so you do not face issues of getting a different IP every time your containers are started. Without a static IP, when starting a container, you may get a different IP address depending on the order of events.

# create a Docker network
docker network create \
--driver bridge \
--subnet=10.10.0.0/16 \
myNetwork

For PostgreSQL and Confluence you could do the following:

# create a PostgreSQL docker container
docker run -d \
--restart=unless-stopped \
--network myNetwork \
--ip 10.10.1.2 \
--name postgres96 \
--hostname postgres \
-p 5432:5432 \
-e POSTGRES_PASSWORD=mysecretpassword \
-e PGDATA=/var/lib/postgresql/data/pgdata \
-v /path/postgres/9.6:/var/lib/postgresql/data/pgdata \
-d postgres:9.6
# create a Confluence docker container
docker run -d --init \
--network myNetwork \
--ip 10.10.2.2 \
--name confluence667 \
--hostname confluence \
-p 8090:8090 \
-v /path/confluence/6.6.7:/var/atlassian/application-data/confluence \
atlassian/confluence-server:6.6.7

 Then connect Confluence by providing the PostgreSQL name parameter (e.g postgres96)

<property name="hibernate.connection.url">
jdbc:postgresql://postgres96:5432/confluence667
</property>

Hope the above helps.

Kind regards,
Rafael

Van Tor May 29, 2020

Any luck? 

Can't reach database server or port

SQLState - 08001
org.postgresql.util.PSQLException: The connection attempt failed.

So strange failed again here with PostgreSQL too while failed all time MSSQL 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events