Question
no pg_hba.conf entry for host when using the App platform
Hi,
I’ve started to use the Beta of the App platform.
My service is a Spring Boot application declared through a Docker image, and it connects to a Postgres database declared through the App platform.
I’ve declared the connection parameters at service level using the following environment variables:
- SPRINGDATASOURCEURL = jdbc:postgresql://${ontrack-db.HOSTNAME}:${ontrack-db.PORT}/${ontrack-db.DATABASE}
- SPRINGDATASOURCEUSERNAME = ${ontrack-db.USERNAME}
- SPRINGDATASOURCEPASSWORD = ${ontrack-db.PASSWORD}
where ontrack-db
is the name of the database component.
However, at startup, the service cannot connect to the database because of the following error:
FATAL: no pg_hba.conf entry for host "159.65.118.45", user "ontrack-db", database "ontrack-db", SSL off
So I wonder how I can make my Postgres component in the App understand that it’s OK to accept connections from the main service in the same App.
I did not find any doc related to the App platform at https://www.digitalocean.com/docs/app-platform/how-to/manage-databases/
Thanks for any help, I’m looking forward to start hosting some apps on the App platform,
Damien Coraboeuf
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×