Cannot drop database via mix ecto.drop

Hi I cannot drop database via mix ecto.drop .
Also I cannot start “iex -S mix phx.server” - i’ve got infinite loop error below .
Any ideas ? Thanks in advance.

19:39:40.846 [error] GenServer #PID<0.190.0> terminating
** (RuntimeError) Connect raised a ArgumentError error. The exception details are hidden, as
they may contain sensitive data such as database credentials.

(postgrex) lib/postgrex/utils.ex:67: anonymous fn/1 in Postgrex.Utils.parse_version/1
(elixir) lib/enum.ex:1294: Enum."-map/2-lists^map/1-0-"/2
(elixir) lib/enum.ex:1294: Enum."-map/2-lists^map/1-0-"/2
(postgrex) lib/postgrex/utils.ex:67: Postgrex.Utils.parse_version/1
(postgrex) lib/postgrex/protocol.ex:641: Postgrex.Protocol.bootstrap_send/6
(postgrex) lib/postgrex/protocol.ex:475: Postgrex.Protocol.handshake/2
(db_connection) lib/db_connection/connection.ex:135: DBConnection.Connection.connect/2
(connection) lib/connection.ex:622: Connection.enter_connect/5
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3

Last message: nil
State: Postgrex.Protocol
** (Mix) The database for MyDatabase.Repo couldn’t be dropped: an exception was raised:
** (RuntimeError) Connect raised a ArgumentError error. The exception details are hidden, as
they may contain sensitive data such as database credentials.

    (postgrex) lib/postgrex/utils.ex:67: anonymous fn/1 in Postgrex.Utils.parse_version/1
    (elixir) lib/enum.ex:1294: Enum."-map/2-lists^map/1-0-"/2
    (elixir) lib/enum.ex:1294: Enum."-map/2-lists^map/1-0-"/2
    (postgrex) lib/postgrex/utils.ex:67: Postgrex.Utils.parse_version/1
    (postgrex) lib/postgrex/protocol.ex:641: Postgrex.Protocol.bootstrap_send/6
    (postgrex) lib/postgrex/protocol.ex:475: Postgrex.Protocol.handshake/2
    (db_connection) lib/db_connection/connection.ex:135: DBConnection.Connection.connect/2
    (connection) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3

Can you get the exception details? Is it from a CI pipeline? You can usually ssh to those and maybe read the logs or something similar.

According to this https://github.com/elixir-ecto/postgrex/blob/v0.13/lib/postgrex/utils.ex#L67 you can’t get hd of the list …

Actually you are probably failing in |> Enum.map(&elem(Integer.parse(&1), 0)) judging by the stacktrace.

What’s the version of postgrex that you are using?
Can you connect to postgres via psql? What’s its version?

I can connect to postgres via psql. I can make “mix phx.new” and with new project all works fine.
But not with my current project.
psql version : psql (PostgreSQL) 10.2 (Debian 10.2-1.pgdg80+1)
postgrex version 0.13.3

This is an issue with postgres 10 where they changed version naming scheme. It’s fixed in the latest postgrex release. Running mix deps.update postgrex should solve the issue.

5 Likes

Thanks, now works.

Hi I cannot drop database via mix ecto.drop .
Also I cannot start “iex -S mix phx.server” - i’ve got infinite loop error
below .
Any ideas ? Thanks in advance.

https://github.com/elixir-ecto/postgrex/issues/370