Not able to connect to POSTGRES db

I am trying to deploy metabase on aptible using docker image using following commnad:
aptible deploy --app metabase-prod --docker-image metabase/metabase

I set the appropriate MB database env variables:

  • MB_DB_TYPE=postgres
  • MB_DB_HOST=host
  • MB_DB_NAME=db
  • MB_DB_PORT=port
  • MB_DB_USER=User
  • MB_DB_PASS=pwd

On aptible when you set the environment, it will restart the container and while restarting it gives me following error:
Failed to connect to database: org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host “XX.XX.X.XX”, user “User”, database “db”, SSL off

I also tried settinf env var MB_DB_CONNECTION_URI=<db_url>?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactor
but result in same.
How can I configure postgres as my application database ?

That’s a postgress specific error. Check the Postgress documentation - the default setting doesn’t allow any remote connections, so need to change your conf file.
Sorry I can’t be more specific, Posgress isn’t my thing.

Thanks for the reply, but I am able to add the database if I use embedded H2 database as application database and do the setup-login and add the same postgres DB from the admin panel, if it is postgres specific problem then no connection should be possible from metabase.