I have this error when try to connect to external db on elephantsql

when try to run mix ecto.create i catch this error.

18:18:30.349 [error] GenServer #PID<0.447.0> terminating
** (Postgrex.Error) FATAL 28000 (invalid_authorization_specification) no pg_hba.conf entry for host "1.1.1.w", user "xxx", database "yyy", SSL off
    (db_connection 2.3.0) lib/db_connection/connection.ex:99: DBConnection.Connection.connect/2
    (connection 1.0.4) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib 3.13) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Last message: nil
State: Postgrex.Protocol
** (Mix) The database for Animalia.Repo couldn't be created: killed

this my config data:

config :animalia, Animalia.Repo,
  username: "xxx",
  password: "yyy",
  database: "xxx",
  hostname: "hostname.com",
  show_sensitive_data_on_connection_error: true,
  pool_size: 10
  1. You forgot to clear the creds in the log output.
  2. It looks that the creds are incorrect.
1 Like

how i clear the cread in log ouput ?

is the same credentials on elephantsql

Hello and welcome,

You should have a look at pg_hba.conf.

Please be careful when providing sensitive details, it’s a good opportunity to learn how to change your credentials.

1 Like