I am attempting to deploy using elixir releases. I am using a managed DB on Digital Ocean. After going through all the steps for a release, when I try to
start the app I get back this issue:
03:52:07.444 [error] Postgrex.Protocol (#PID<0.1407.0>) failed to connect: ** (Postgrex.Error) FATAL 28000 (invalid_authorization_specification) no pg_hba.conf entry for host "188.8.131.52", user "app_prod", database "app_prod", SSL off
184.108.40.206 is the IP to my managed DB. I did run
export DATABASE_URL=<my_url> which includes the username, password, db, and hostname. I looked at several other issues but since I am not a DB guru it’s hard to parse through content. Any help is appreciated.
Sounds like you can’t access the database from the host?
Have you tried using psql to connect?
I have seen this before but I don’t know what it means. Any reference material I can read up on about it as it relates to DO.
This seems like the issue from my limited knowledge.
You probably already found it but, for posterity:
If you cannot connect with it then there’s a problem that’s outside Elixir.
Don’t know about the DO specifics, I have however seen this exact error (on azure managed service) when either the IP of the host is not added as an authorised IP or the server is set to require SSL connections and the client does not set ssl true in the ecto repo config.
Edit: inclined to think it will be the SSL issue
I will try this out today
Thanks for the details. I will test this out
So I believe the answer was setting
ssl: true in my
prod.secret.exs file since I was able to connect to my db from the server I am running my app from.