Unable to connect to Postgres

INFORMATION

Relevant information to this issue:
I have setup Postgres with the following settings:
Mode: Container
Version: 14
Accessibility: Public

  • Link to your application: Qovery

ISSUE
Unable to connect to db.

The last statement in the logs shows the db is deployed and waiting for connections:
2023-04-23 00:42:36.876 GMT [1] LOG: database system is ready to accept connections

Using the credentials from “Credentials” button from the Overview page of the db I try to connect to the DB from command line. The given credentials with obfuscated password as XYZ-123:
postgres:XYZ-123@z3364deef-postgresql.z58f059b5.gdb.sh:5432

I tried all of the following command line with the same failure:
psql -h z3364deef-postgresql.z58f059b5.gdb.sh -p 5432 -d postgres -U postgres
psql -h z3364deef-postgresql.z58f059b5.gdb.sh -p 5432 -d postgres -U postgres -W

psql -h z3364deef-postgresql.z58f059b5.gdb.sh -p 5432 -U postgres
psql -h z3364deef-postgresql.z58f059b5.gdb.sh -p 5432 -U postgres - W

The Failure message:
psql: error: connection to server at “z3364deef-postgresql.z58f059b5.gdb.sh” (54.236.58.221), port 5432 failed: Connection refused
Is the server running on that host and accepting TCP/IP connections?

Hi @NTS ,

unfortunately accessing a public database is one of the limitations we have today when using a Sincle EC2 (K3S) type cluster (see the limitations here). We should block any user to select “public” on a database when using a Single EC2 cluster.

We will support soon a port-forward option in our CLI to let you connect to any database, no matter their accessibility. In the meantime, you can ssh via our CLI to another application within your environment and connect to the PostgreSQL from there

Alessandro

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.