Screencast Build a Database-Backed Web App with Phoenix Elixir

  • Carlos Souza
  • 397 views

Comments

  1. matthewcole2010 said

    mix ecto.create doesn't work. Here is the error I get:

    22:17:03.276 [error] GenServer #PID terminating ** (RuntimeError) Connect raised a KeyError error. The exception details are hidden, as they may contain sensitive data such as database credentials.

    (elixir) lib/keyword.ex:377: Keyword.fetch!/2 (postgrex) lib/postgrex/protocol.ex:603: Postgrex.Protocol.auth_md5/4 (postgrex) lib/postgrex/protocol.ex:497: 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 FireStarter.Repo couldn't be created: an exception was raised: ** (RuntimeError) Connect raised a KeyError error. The exception details are hidden, as they may contain sensitive data such as database credentials.

    (elixir) lib/keyword.ex:377: Keyword.fetch!/2 (postgrex) lib/postgrex/protocol.ex:603: Postgrex.Protocol.auth_md5/4 (postgrex) lib/postgrex/protocol.ex:497: 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

  2. clive Harber said

    From this error, all that can be seen is that one or more of the database connection keys required in config/dev.exs are missing. Without seeing the details in the config/dev.exs file that starts: 'config :fire_starter, FireStarter.Repo,' theres little more than can be done here.

    For reference, it should probably look something like this (if you're using the standard Postgres drivers):

    config :fire_starter, FireStarter.Repo, adapter: Ecto.Adapters.Postgres, username: , password: , database: “fire_starter_dev”, hostname: "localhost", pool_size: 10

    In the video the username and password keys are removed, because thats the way that Carlos has set his local database up. I suspect that you will need to put these keys back in and set them to your DB user. Ecto should then be able to connect.

  3. Faculty

    Carlos Souza said

    Yep, what @clive said. Double check your database credentials (i.e. username and password) at the bottom of the config/dev.exs file.

  4. matthewcole2010 said

    I can't get any good information about how my PostgreSQL is configured or what the password even is. I know it's not the administrator password for my Mac. I've spent hours researching this issue and have done multiple reinstalls of PostgreSQL.

  5. matthewcole2010 said

    Actually, nevermind about the PostgreSQL issue. I reinstalled it again and this time it seems to be working. Thanks for your help. I look forward to completing the rest of this tutorial.

  6. Charles Carriere said

    This was fantastic! Thank you. Really helped solidify some of the Phoenix tutorial.

  7. Student #4708240 said

    test

About This Screencast

In this episode, we will take what you learned from the "On Fire With Phoenix" course to build a database-backed web app from scratch.

You need to be an enrolled student in order to view this video and subscribe.

Enroll Now