简体   繁体   中英

Elixir Phoenix ecto.create fail

i am following along with the Phoenix Up & Running guide at https://phoenixframework.readme.io/docs/up-and-running and when I try to use ecto to create a database (Postgresql) I get the following error

mix ecto.create
17:55:35.631 [error] GenServer #PID<0.215.0> terminating
** (RuntimeError) Connect raised a CaseClauseError error. The exception details are hidden, as they may contain sensitive data such
as database credentials.

    (postgrex 0.12.2) lib/postgrex/utils.ex:40: Postgrex.Utils.parse_version/1
    (postgrex 0.12.2) lib/postgrex/protocol.ex:497: Postgrex.Protocol.bootstrap_send/4
    (postgrex 0.12.2) lib/postgrex/protocol.ex:353: Postgrex.Protocol.handshake/2
    (db_connection 1.1.3) lib/db_connection/connection.ex:135: DBConnection.Connection.connect/2
    (connection 1.0.4) lib/connection.ex:622: Connection.enter_connect/5
    (stdlib 3.11.2) proc_lib.erl:249: :proc_lib.init_p_do_apply/3

Last message: nil 

State: Postgrex.Protocol

** (Mix) The database for HelloPhoenix.Repo couldn't be created: an exception was raised:
    ** (RuntimeError) Connect raised a CaseClauseError error. The exception details are hidden, as they may contain sensitive data such
as database credentials.

        (postgrex 0.12.2) lib/postgrex/utils.ex:40: Postgrex.Utils.parse_version/1
        (postgrex 0.12.2) lib/postgrex/protocol.ex:497: Postgrex.Protocol.bootstrap_send/4
        (postgrex 0.12.2) lib/postgrex/protocol.ex:353: Postgrex.Protocol.handshake/2
        (db_connection 1.1.3) lib/db_connection/connection.ex:135: DBConnection.Connection.connect/2
        (connection 1.0.4) lib/connection.ex:622: Connection.enter_connect/5
        (stdlib 3.11.2) proc_lib.erl:249: :proc_lib.init_p_do_apply/3

The only suggestions I found was to update Postgrex. I ran mix deps.update postgrex and this did not fix it.

Finally I checked config/dev.exs and username/password are set to "postgres". I used PgAdmin3 to confirm this is a valid login.

So at this point I am stuck.

Ubuntu 19.10

postgres (PostgreSQL) 11.7 (Ubuntu 11.7-0ubuntu0.19.10.1)
 installed from Ubuntu repo via apt-get

What are the versions of Postgress and postgrex ?

postgrex supports PostgreSQL 8.4, 9.0-9.6, and later (hstore is not supported on 8.4)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM