Troubleshooting when ran $ mix test

I used
Erlang/OTP 21 [erts-10.3.4] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [hipe]

Elixir 1.8.1 (compiled with Erlang/OTP 20)
Phoenix v1.2.5

I got this problem
07:07:27.638 [error] GenServer #PID<0.2661.0> terminating
** (Postgrex.Error) FATAL 28P01 (invalid_password) password authentication failed for user “postgres”
(db_connection) lib/db_connection/connection.ex:84: DBConnection.Connection.connect/2
(connection) lib/connection.ex:622: Connection.enter_connect/5
(stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message: nil
** (Mix) The database for Lat6.Repo couldn’t be created: killed

Your code cannot connect to the Postgres due to the invalid password. Check if that password is correct and replace it if not.

Besides the “invalid password” issue – is there a reason you’re trying to use a very outdated version of Phoenix with mismatched Elixir/Erlang versions?

Did you ever resolve this issue? I have the same error. I’m running Elixir 1.13.3/Erlang 24, Phoenix 1.6.6.

  1. Create new project
  2. Edit my PostGres password in dex.exs (my password is not ‘postgres’).
  3. Run mix test
  4. Get the same error as in the original post.

Running mix ecto.create creates the database as expected. Running mix test again results in the same error.

mix test does not use config/dev.exs, but config/test.exs.

3 Likes

Thanks. Now I can run tests!

1 Like