Phoenix chat app crashes with Internal Server Error when perforing authorization

As I am learning Phoenix/Elixir I built a chat application: https://babble.herokuapp.com/

When a user tries to sign up or sign, gets the Internal server error.

I have been struggling with trying to find a solution for this but not having any success. When helpful thread I found of someone that had a similar problem said updating dependencies helped them. I tried that but hasn’t worked for me.

Any help is appreciated.

elixir -v
Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]

Elixir 1.6.1 (compiled with OTP 20)

heroku logs:

$ heroku logs
2018-07-24T14:24:05.106056+00:00 app[web.1]: (elixir) lib/enum.ex:1255: Enum."-map/2-lists^map/1-0-"/2
2018-07-24T14:24:05.106058+00:00 app[web.1]: (elixir) lib/enum.ex:1255: Enum."-map/2-lists^map/1-0-"/2
2018-07-24T14:24:05.106060+00:00 app[web.1]: (postgrex) lib/postgrex/utils.ex:67: Postgrex.Utils.parse_version/1
2018-07-24T14:24:05.106061+00:00 app[web.1]: (postgrex) lib/postgrex/protocol.ex:663: Postgrex.Protocol.bootstrap_send/6
2018-07-24T14:24:05.106063+00:00 app[web.1]: (postgrex) lib/postgrex/protocol.ex:497: Postgrex.Protocol.handshake/2
2018-07-24T14:24:05.106065+00:00 app[web.1]: (db_connection) lib/db_connection/connection.ex:135: DBConnection.Connection.connect/2
2018-07-24T14:24:05.106067+00:00 app[web.1]: (connection) lib/connection.ex:622: Connection.enter_connect/5
2018-07-24T14:24:05.106069+00:00 app[web.1]: Last message: nil
2018-07-24T14:24:05.110000+00:00 app[web.1]: 14:24:05.109 [error] GenServer #PID<0.24425.3> terminating
2018-07-24T14:24:05.110004+00:00 app[web.1]: ** (RuntimeError) Connect raised a ArgumentError error. The exception details are hidden, as
2018-07-24T14:24:05.110006+00:00 app[web.1]: they may contain sensitive data such as database credentials.
2018-07-24T14:24:05.110007+00:00 app[web.1]: 
2018-07-24T14:24:05.110009+00:00 app[web.1]: (postgrex) lib/postgrex/utils.ex:67: anonymous fn/1 in Postgrex.Utils.parse_version/1
2018-07-24T14:24:05.110011+00:00 app[web.1]: (elixir) lib/enum.ex:1255: Enum."-map/2-lists^map/1-0-"/2
2018-07-24T14:24:05.110012+00:00 app[web.1]: (elixir) lib/enum.ex:1255: Enum."-map/2-lists^map/1-0-"/2
2018-07-24T14:24:05.110014+00:00 app[web.1]: (postgrex) lib/postgrex/utils.ex:67: Postgrex.Utils.parse_version/1
2018-07-24T14:24:05.110018+00:00 app[web.1]: (postgrex) lib/postgrex/protocol.ex:497: Postgrex.Protocol.handshake/2
2018-07-24T14:24:05.110016+00:00 app[web.1]: (postgrex) lib/postgrex/protocol.ex:663: Postgrex.Protocol.bootstrap_send/6
2018-07-24T14:24:05.110019+00:00 app[web.1]: (db_connection) lib/db_connection/connection.ex:135: DBConnection.Connection.connect/2
2018-07-24T14:24:05.110021+00:00 app[web.1]: (connection) lib/connection.ex:622: Connection.enter_connect/5
2018-07-24T14:24:05.110023+00:00 app[web.1]: Last message: nil
2018-07-24T14:24:05.112740+00:00 app[web.1]: 14:24:05.112 [error] GenServer #PID<0.24423.3> terminating
2018-07-24T14:24:05.112743+00:00 app[web.1]: ** (RuntimeError) Connect raised a ArgumentError error. The exception details are hidden, as
2018-07-24T14:24:05.112745+00:00 app[web.1]: they may contain sensitive data such as database credentials.
2018-07-24T14:24:05.112747+00:00 app[web.1]: 
2018-07-24T14:24:05.112748+00:00 app[web.1]: (postgrex) lib/postgrex/utils.ex:67: anonymous fn/1 in Postgrex.Utils.parse_version/1
2018-07-24T14:24:05.112750+00:00 app[web.1]: (elixir) lib/enum.ex:1255: Enum."-map/2-lists^map/1-0-"/2
2018-07-24T14:24:05.112751+00:00 app[web.1]: (elixir) lib/enum.ex:1255: Enum."-map/2-lists^map/1-0-"/2
2018-07-24T14:24:05.112753+00:00 app[web.1]: (postgrex) lib/postgrex/utils.ex:67: Postgrex.Utils.parse_version/1
2018-07-24T14:24:05.112755+00:00 app[web.1]: (postgrex) lib/postgrex/protocol.ex:663: Postgrex.Protocol.bootstrap_send/6
2018-07-24T14:24:05.112757+00:00 app[web.1]: (postgrex) lib/postgrex/protocol.ex:497: Postgrex.Protocol.handshake/2
2018-07-24T14:24:05.112760+00:00 app[web.1]: (db_connection) lib/db_connection/connection.ex:135: DBConnection.Connection.connect/2
2018-07-24T14:24:05.112762+00:00 app[web.1]: (connection) lib/connection.ex:622: Connection.enter_connect/5
2018-07-24T14:24:05.112764+00:00 app[web.1]: Last message: nil
2018-07-24T14:24:05.123302+00:00 app[web.1]: 14:24:05.123 [error] GenServer #PID<0.24426.3> terminating
2018-07-24T14:24:05.123305+00:00 app[web.1]: ** (RuntimeError) Connect raised a ArgumentError error. The exception details are hidden, as
2018-07-24T14:24:05.123307+00:00 app[web.1]: they may contain sensitive data such as database credentials.
2018-07-24T14:24:05.123309+00:00 app[web.1]: 
2018-07-24T14:24:05.123310+00:00 app[web.1]: (postgrex) lib/postgrex/utils.ex:67: anonymous fn/1 in Postgrex.Utils.parse_version/1
2018-07-24T14:24:05.123312+00:00 app[web.1]: (elixir) lib/enum.ex:1255: Enum."-map/2-lists^map/1-0-"/2
2018-07-24T14:24:05.123314+00:00 app[web.1]: (elixir) lib/enum.ex:1255: Enum."-map/2-lists^map/1-0-"/2
2018-07-24T14:24:05.123317+00:00 app[web.1]: (postgrex) lib/postgrex/utils.ex:67: Postgrex.Utils.parse_version/1
2018-07-24T14:24:05.123318+00:00 app[web.1]: (postgrex) lib/postgrex/protocol.ex:663: Postgrex.Protocol.bootstrap_send/6
2018-07-24T14:24:05.123320+00:00 app[web.1]: (postgrex) lib/postgrex/protocol.ex:497: Postgrex.Protocol.handshake/2
2018-07-24T14:24:05.123322+00:00 app[web.1]: (db_connection) lib/db_connection/connection.ex:135: DBConnection.Connection.connect/2
2018-07-24T14:24:05.123323+00:00 app[web.1]: (connection) lib/connection.ex:622: Connection.enter_connect/5
2018-07-24T14:24:05.123325+00:00 app[web.1]: Last message: nil
2018-07-24T14:24:05.136035+00:00 app[web.1]: 14:24:05.135 [error] GenServer #PID<0.24430.3> terminating
2018-07-24T14:24:05.136039+00:00 app[web.1]: ** (RuntimeError) Connect raised a ArgumentError error. The exception details are hidden, as
2018-07-24T14:24:05.136040+00:00 app[web.1]: they may contain sensitive data such as database credentials.
2018-07-24T14:24:05.136042+00:00 app[web.1]: 
2018-07-24T14:24:05.136043+00:00 app[web.1]: (postgrex) lib/postgrex/utils.ex:67: anonymous fn/1 in Postgrex.Utils.parse_version/1
2018-07-24T14:24:05.136044+00:00 app[web.1]: (elixir) lib/enum.ex:1255: Enum."-map/2-lists^map/1-0-"/2
2018-07-24T14:24:05.136045+00:00 app[web.1]: (elixir) lib/enum.ex:1255: Enum."-map/2-lists^map/1-0-"/2
2018-07-24T14:24:05.136047+00:00 app[web.1]: (postgrex) lib/postgrex/utils.ex:67: Postgrex.Utils.parse_version/1
2018-07-24T14:24:05.136048+00:00 app[web.1]: (postgrex) lib/postgrex/protocol.ex:663: Postgrex.Protocol.bootstrap_send/6
2018-07-24T14:24:05.136049+00:00 app[web.1]: (postgrex) lib/postgrex/protocol.ex:497: Postgrex.Protocol.handshake/2
2018-07-24T14:24:05.136051+00:00 app[web.1]: (db_connection) lib/db_connection/connection.ex:135: DBConnection.Connection.connect/2
2018-07-24T14:24:05.136052+00:00 app[web.1]: (connection) lib/connection.ex:622: Connection.enter_connect/5
2018-07-24T14:24:05.136054+00:00 app[web.1]: Last message: nil
2018-07-24T14:24:05.150464+00:00 app[web.1]: 14:24:05.149 [error] GenServer #PID<0.24432.3> terminating
2018-07-24T14:24:05.150468+00:00 app[web.1]: ** (RuntimeError) Connect raised a ArgumentError error. The exception details are hidden, as
2018-07-24T14:24:05.150469+00:00 app[web.1]: they may contain sensitive data such as database credentials.
2018-07-24T14:24:05.150471+00:00 app[web.1]: 
2018-07-24T14:24:05.150472+00:00 app[web.1]: (postgrex) lib/postgrex/utils.ex:67: anonymous fn/1 in Postgrex.Utils.parse_version/1
2018-07-24T14:24:05.150474+00:00 app[web.1]: (elixir) lib/enum.ex:1255: Enum."-map/2-lists^map/1-0-"/2
2018-07-24T14:24:05.150476+00:00 app[web.1]: (elixir) lib/enum.ex:1255: Enum."-map/2-lists^map/1-0-"/2
2018-07-24T14:24:05.150478+00:00 app[web.1]: (postgrex) lib/postgrex/utils.ex:67: Postgrex.Utils.parse_version/1
2018-07-24T14:24:05.150480+00:00 app[web.1]: (postgrex) lib/postgrex/protocol.ex:663: Postgrex.Protocol.bootstrap_send/6
2018-07-24T14:24:05.150481+00:00 app[web.1]: (postgrex) lib/postgrex/protocol.ex:497: Postgrex.Protocol.handshake/2
2018-07-24T14:24:05.150483+00:00 app[web.1]: (db_connection) lib/db_connection/connection.ex:135: DBConnection.Connection.connect/2
2018-07-24T14:24:05.150484+00:00 app[web.1]: (connection) lib/connection.ex:622: Connection.enter_connect/5
2018-07-24T14:24:05.150486+00:00 app[web.1]: Last message: nil
2018-07-24T14:24:05.151987+00:00 app[web.1]: 14:24:05.151 [error] GenServer #PID<0.24436.3> terminating
2018-07-24T14:24:05.151990+00:00 app[web.1]: ** (RuntimeError) Connect raised a ArgumentError error. The exception details are hidden, as
2018-07-24T14:24:05.151992+00:00 app[web.1]: they may contain sensitive data such as database credentials.
2018-07-24T14:24:05.151994+00:00 app[web.1]: 
2018-07-24T14:24:05.151996+00:00 app[web.1]: (postgrex) lib/postgrex/utils.ex:67: anonymous fn/1 in Postgrex.Utils.parse_version/1
2018-07-24T14:24:05.151998+00:00 app[web.1]: (elixir) lib/enum.ex:1255: Enum."-map/2-lists^map/1-0-"/2
2018-07-24T14:24:05.152000+00:00 app[web.1]: (elixir) lib/enum.ex:1255: Enum."-map/2-lists^map/1-0-"/2
2018-07-24T14:24:05.152001+00:00 app[web.1]: (postgrex) lib/postgrex/utils.ex:67: Postgrex.Utils.parse_version/1
2018-07-24T14:24:05.152003+00:00 app[web.1]: (postgrex) lib/postgrex/protocol.ex:663: Postgrex.Protocol.bootstrap_send/6
2018-07-24T14:24:05.152005+00:00 app[web.1]: (postgrex) lib/postgrex/protocol.ex:497: Postgrex.Protocol.handshake/2
2018-07-24T14:24:05.152007+00:00 app[web.1]: (db_connection) lib/db_connection/connection.ex:135: DBConnection.Connection.connect/2
2018-07-24T14:24:05.152009+00:00 app[web.1]: (connection) lib/connection.ex:622: Connection.enter_connect/5
2018-07-24T14:24:05.152011+00:00 app[web.1]: Last message: nil
2018-07-24T14:24:05.157543+00:00 app[web.1]: 14:24:05.157 [error] Postgrex.Protocol (#PID<0.24431.3>) failed to connect: ** (RuntimeError) awaited on another connection that failed to bootstrap types
2018-07-24T14:24:05.180185+00:00 app[web.1]: 14:24:05.179 [error] GenServer #PID<0.24441.3> terminating
2018-07-24T14:24:05.180190+00:00 app[web.1]: ** (RuntimeError) Connect raised a ArgumentError error. The exception details are hidden, as
2018-07-24T14:24:05.180191+00:00 app[web.1]: they may contain sensitive data such as database credentials.
2018-07-24T14:24:05.180197+00:00 app[web.1]: 
2018-07-24T14:24:05.180199+00:00 app[web.1]: (postgrex) lib/postgrex/utils.ex:67: anonymous fn/1 in Postgrex.Utils.parse_version/1
2018-07-24T14:24:05.180201+00:00 app[web.1]: (elixir) lib/enum.ex:1255: Enum."-map/2-lists^map/1-0-"/2
2018-07-24T14:24:05.180202+00:00 app[web.1]: (elixir) lib/enum.ex:1255: Enum."-map/2-lists^map/1-0-"/2
2018-07-24T14:24:05.180204+00:00 app[web.1]: (postgrex) lib/postgrex/utils.ex:67: Postgrex.Utils.parse_version/1
2018-07-24T14:24:05.180206+00:00 app[web.1]: (postgrex) lib/postgrex/protocol.ex:663: Postgrex.Protocol.bootstrap_send/6
2018-07-24T14:24:05.180208+00:00 app[web.1]: (postgrex) lib/postgrex/protocol.ex:497: Postgrex.Protocol.handshake/2
2018-07-24T14:24:05.180209+00:00 app[web.1]: (db_connection) lib/db_connection/connection.ex:135: DBConnection.Connection.connect/2
2018-07-24T14:24:05.180211+00:00 app[web.1]: (connection) lib/connection.ex:622: Connection.enter_connect/5
2018-07-24T14:24:05.180213+00:00 app[web.1]: Last message: nil

Could we perhaps get a look at the code you’re using to do the authorization? Or if you’re using a library to do it could you please post the github link and your version.

Here is my Github repo:
https://github.com/aliciapflaumer/babble

Elixir version 1.6.1

auth.ex:

defmodule Babble.Auth do
	import Comeonin.Pbkdf2, only: [checkpw: 2, dummy_checkpw: 0]
	import Plug.Conn

	defp login(conn, user) do
		conn
		|> Guardian.Plug.sign_in(user, :access)
	end

	def login_with(conn, email, pass, opts) do
		repo = Keyword.fetch!(opts, :repo)
		user = repo.get_by(Babble.User, email: email)

		cond do
			user && checkpw(pass, user.encrypt_pass) ->
				{:ok, login(conn, user)}
			user ->
				{:error, :unauthorized, conn}
			true ->
				dummy_checkpw()
				{:error, :not_found, conn}
		end
	end

end

session_controller:

defmodule Babble.SessionController do
	use Babble.Web, :controller
	import Babble.Auth

	def new(conn, _params) do
      render(conn, "new.html")
  	end

  	def create(conn, %{"session" => %{"email" => user, "password" => password}}) do
	    case login_with(conn, user, password, repo: Repo) do
	    	{:ok, conn} ->
	    		# logged_user = Guardian.Plug.current_resource(conn)
	    		conn
	    		|> put_flash(:info, "You are signed in!")
	    		|> redirect(to: page_path(conn, :index))
	    	{:error, _reason, conn} ->
	    		conn
	    		|> put_flash(:error, "Wrong username/password")
	    		|> render("new.html")
	    end
  	end

  	def delete(conn, _) do
	  	conn
	  	|> Guardian.Plug.sign_out
	  	|> redirect(to: "/")
  	end

end

Googling Postgrex.Utils.parse_version returns this issue. Try upgrading postgrex?

1 Like

I updated postgrex, and pushed to heroku. Still gettin internal server error

Heroku logs now:

2018-07-24T15:24:17.981004+00:00 heroku[router]: at=info method=GET path="/users" host=babble.herokuapp.com request_id=9373fbf8-b906-419c-8963-4dd49fd510cd fwd="76.119.187.206" dyno=web.1 connect=1ms service=68ms status=500 bytes=435 protocol=https
2018-07-24T15:24:20.536033+00:00 heroku[router]: at=info method=GET path="/users" host=babble.herokuapp.com request_id=92d1ec43-9f50-4281-b40a-273e093749d1 fwd="76.119.187.206" dyno=web.1 connect=1ms service=10ms status=500 bytes=435 protocol=https
2018-07-24T15:24:20.527797+00:00 app[web.1]: 15:24:20.526 request_id=92d1ec43-9f50-4281-b40a-273e093749d1 [info] GET /users
2018-07-24T15:24:20.535351+00:00 app[web.1]: 15:24:20.535 request_id=92d1ec43-9f50-4281-b40a-273e093749d1 [info] Sent 500 in 8ms
2018-07-24T15:24:20.536528+00:00 app[web.1]: Request: GET /users
2018-07-24T15:24:20.536522+00:00 app[web.1]: 15:24:20.536 [error] #PID<0.439.0> running Babble.Endpoint terminated
2018-07-24T15:24:20.536530+00:00 app[web.1]: ** (exit) an exception was raised:
2018-07-24T15:24:20.536534+00:00 app[web.1]: (ecto) lib/ecto/adapters/sql.ex:431: Ecto.Adapters.SQL.execute_and_cache/7
2018-07-24T15:24:20.536526+00:00 app[web.1]: Server: babble.herokuapp.com:80 (http)
2018-07-24T15:24:20.536532+00:00 app[web.1]: ** (Postgrex.Error) ERROR 42P01 (undefined_table): relation "users" does not exist
2018-07-24T15:24:20.536536+00:00 app[web.1]: (ecto) lib/ecto/repo/queryable.ex:133: Ecto.Repo.Queryable.execute/5
2018-07-24T15:24:20.536537+00:00 app[web.1]: (ecto) lib/ecto/repo/queryable.ex:37: Ecto.Repo.Queryable.all/4
2018-07-24T15:24:20.536539+00:00 app[web.1]: (babble) web/controllers/user_controller.ex:9: Babble.UserController.index/2
2018-07-24T15:24:20.536541+00:00 app[web.1]: (babble) web/controllers/user_controller.ex:1: Babble.UserController.action/2
2018-07-24T15:24:20.536545+00:00 app[web.1]: (babble) lib/babble/endpoint.ex:1: Babble.Endpoint.instrument/4
2018-07-24T15:24:20.536543+00:00 app[web.1]: (babble) web/controllers/user_controller.ex:1: Babble.UserController.phoenix_controller_pipeline/2
2018-07-24T15:24:20.536547+00:00 app[web.1]: (phoenix) lib/phoenix/router.ex:278: Phoenix.Router.__call__/1
2018-07-24T15:24:20.809315+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=babble.herokuapp.com request_id=e878dde6-41ae-4913-954b-3f87fb4bc187 fwd="76.119.187.206" dyno=web.1 connect=1ms service=12ms status=200 bytes=1515 protocol=https
2018-07-24T15:24:28.144718+00:00 app[web.1]: 15:24:28.143 request_id=052bca38-d903-4d98-b8ab-fef4db67cc81 [info] GET /
2018-07-24T15:24:28.144763+00:00 app[web.1]: 15:24:28.144 request_id=052bca38-d903-4d98-b8ab-fef4db67cc81 [info] Sent 200 in 707µs
2018-07-24T15:24:28.146335+00:00 heroku[router]: at=info method=GET path="/" host=babble.herokuapp.com request_id=052bca38-d903-4d98-b8ab-fef4db67cc81 fwd="76.119.187.206" dyno=web.1 connect=2ms service=4ms status=200 bytes=2176 protocol=https
2018-07-24T15:24:30.329856+00:00 app[web.1]: 15:24:30.329 request_id=d6e182c8-790c-418d-87aa-056f1ca33a93 [info] GET /
2018-07-24T15:24:30.329892+00:00 app[web.1]: 15:24:30.329 request_id=d6e182c8-790c-418d-87aa-056f1ca33a93 [info] Sent 200 in 479µs
2018-07-24T15:24:30.333600+00:00 heroku[router]: at=info method=GET path="/" host=babble.herokuapp.com request_id=d6e182c8-790c-418d-87aa-056f1ca33a93 fwd="76.119.187.206" dyno=web.1 connect=1ms service=5ms status=200 bytes=2176 protocol=https
2018-07-24T15:24:30.488369+00:00 heroku[router]: at=info method=GET path= "/js/app-9520be830490228d57f366675c8ab543.js?vsn=d" host=babble.herokuapp.com request_id=bb81117b-099f-404d-a227-96bb008c88f2 fwd="76.119.187.206" dyno=web.1 connect=1ms service=7ms status=200 bytes=54346 protocol=https
2018-07-24T15:24:30.485211+00:00 heroku[router]: at=info method=GET path= "/css/app-ce29cd11fb55406e9cfdf77fb1e710ba.css?vsn=d" host=babble.herokuapp.com request_id=9bb66f48-ef58-4e80-8aea-cb5c110b5940 fwd="76.119.187.206" dyno=web.1 connect=1ms service=11ms status=200 bytes=124718 protocol=https
2018-07-24T15:24:30.727150+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=babble.herokuapp.com request_id=c69cde94-2548-47c8-ac68-0ea5e0275799 fwd="76.119.187.206" dyno=web.1 connect=1ms service=3ms status=200 bytes=1515 protocol=https
2018-07-24T15:24:33.195703+00:00 heroku[router]: at=info method=GET path="/users/new" host=babble.herokuapp.com request_id=395f7cd6-c803-468b-918a-5e91afe952a7 fwd="76.119.187.206" dyno=web.1 connect=2ms service=2ms status=200 bytes=2372 protocol=https
2018-07-24T15:24:33.194997+00:00 app[web.1]: 15:24:33.193 request_id=395f7cd6-c803-468b-918a-5e91afe952a7 [info] GET /users/new
2018-07-24T15:24:33.195109+00:00 app[web.1]: 15:24:33.194 request_id=395f7cd6-c803-468b-918a-5e91afe952a7 [info] Sent 200 in 887µs
2018-07-24T15:24:36.192472+00:00 heroku[router]: at=info method=GET path="/users/" host=babble.herokuapp.com request_id=001147eb-f4fc-4774-9dd1-ce4e4475d81a fwd="76.119.187.206" dyno=web.1 connect=1ms service=5ms status=500 bytes=435 protocol=https
2018-07-24T15:24:36.188435+00:00 app[web.1]: 15:24:36.188 request_id=001147eb-f4fc-4774-9dd1-ce4e4475d81a [info] GET /users/
2018-07-24T15:24:36.191588+00:00 app[web.1]: 15:24:36.191 request_id=001147eb-f4fc-4774-9dd1-ce4e4475d81a [info] Sent 500 in 3ms
2018-07-24T15:24:36.193016+00:00 app[web.1]: 15:24:36.192 [error] #PID<0.447.0> running Babble.Endpoint terminated
2018-07-24T15:24:36.193020+00:00 app[web.1]: Server: babble.herokuapp.com:80 (http)
2018-07-24T15:24:36.193022+00:00 app[web.1]: Request: GET /users/
2018-07-24T15:24:36.193024+00:00 app[web.1]: ** (exit) an exception was raised:
2018-07-24T15:24:36.193026+00:00 app[web.1]: ** (Postgrex.Error) ERROR 42P01 (undefined_table): relation "users" does not exist
2018-07-24T15:24:36.193028+00:00 app[web.1]: (ecto) lib/ecto/adapters/sql.ex:431: Ecto.Adapters.SQL.execute_and_cache/7
2018-07-24T15:24:36.193031+00:00 app[web.1]: (ecto) lib/ecto/repo/queryable.ex:37: Ecto.Repo.Queryable.all/4
2018-07-24T15:24:36.193030+00:00 app[web.1]: (ecto) lib/ecto/repo/queryable.ex:133: Ecto.Repo.Queryable.execute/5
2018-07-24T15:24:36.193033+00:00 app[web.1]: (babble) web/controllers/user_controller.ex:9: Babble.UserController.index/2
2018-07-24T15:24:36.193034+00:00 app[web.1]: (babble) web/controllers/user_controller.ex:1: Babble.UserController.action/2
2018-07-24T15:24:36.193037+00:00 app[web.1]: (babble) web/controllers/user_controller.ex:1: Babble.UserController.phoenix_controller_pipeline/2
2018-07-24T15:24:36.193038+00:00 app[web.1]: (babble) lib/babble/endpoint.ex:1: Babble.Endpoint.instrument/4
2018-07-24T15:24:36.193040+00:00 app[web.1]: (phoenix) lib/phoenix/router.ex:278: Phoenix.Router.__call__/1
2018-07-24T15:24:47.941610+00:00 heroku[router]: at=info method=GET path="/users/" host=babble.herokuapp.com request_id=8815871b-7dfb-46b5-af3e-06c60475a339 fwd="76.119.187.206" dyno=web.1 connect=1ms service=6ms status=500 bytes=435 protocol=https
2018-07-24T15:24:47.936655+00:00 app[web.1]: 15:24:47.936 request_id=8815871b-7dfb-46b5-af3e-06c60475a339 [info] GET /users/
2018-07-24T15:24:47.940668+00:00 app[web.1]: 15:24:47.940 request_id=8815871b-7dfb-46b5-af3e-06c60475a339 [info] Sent 500 in 4ms
2018-07-24T15:24:47.942035+00:00 app[web.1]: Request: GET /users/
2018-07-24T15:24:47.942030+00:00 app[web.1]: 15:24:47.941 [error] #PID<0.449.0> running Babble.Endpoint terminated
2018-07-24T15:24:47.942037+00:00 app[web.1]: ** (exit) an exception was raised:
2018-07-24T15:24:47.942041+00:00 app[web.1]: (ecto) lib/ecto/adapters/sql.ex:431: Ecto.Adapters.SQL.execute_and_cache/7
2018-07-24T15:24:47.942043+00:00 app[web.1]: (ecto) lib/ecto/repo/queryable.ex:133: Ecto.Repo.Queryable.execute/5
2018-07-24T15:24:47.942045+00:00 app[web.1]: (ecto) lib/ecto/repo/queryable.ex:37: Ecto.Repo.Queryable.all/4
2018-07-24T15:24:47.942033+00:00 app[web.1]: Server: babble.herokuapp.com:80 (http)
2018-07-24T15:24:47.942046+00:00 app[web.1]: (babble) web/controllers/user_controller.ex:9: Babble.UserController.index/2
2018-07-24T15:24:47.942039+00:00 app[web.1]: ** (Postgrex.Error) ERROR 42P01 (undefined_table): relation "users" does not exist
2018-07-24T15:24:47.942048+00:00 app[web.1]: (babble) web/controllers/user_controller.ex:1: Babble.UserController.action/2
2018-07-24T15:24:47.942050+00:00 app[web.1]: (babble) web/controllers/user_controller.ex:1: Babble.UserController.phoenix_controller_pipeline/2
2018-07-24T15:24:47.942052+00:00 app[web.1]: (babble) lib/babble/endpoint.ex:1: Babble.Endpoint.instrument/4
2018-07-24T15:24:47.942054+00:00 app[web.1]: (phoenix) lib/phoenix/router.ex:278: Phoenix.Router.__call__/1
2018-07-24T15:24:48.246608+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=babble.herokuapp.com request_id=1f4d6cd0-fa31-434b-ad31-762d15a88dab fwd="76.119.187.206" dyno=web.1 connect=1ms service=2ms status=200 bytes=1515 protocol=https
2018-07-24T15:24:51.139849+00:00 app[web.1]: 15:24:51.139 request_id=3050187a-d2b0-4d3b-ab63-099fa3034bd2 [info] Sent 500 in 5ms
2018-07-24T15:24:51.141279+00:00 app[web.1]: 15:24:51.141 [error] #PID<0.451.0> running Babble.Endpoint terminated
2018-07-24T15:24:51.134391+00:00 app[web.1]: 15:24:51.134 request_id=3050187a-d2b0-4d3b-ab63-099fa3034bd2 [info] GET /users/
2018-07-24T15:24:51.141282+00:00 app[web.1]: Server: babble.herokuapp.com:80 (http)
2018-07-24T15:24:51.141284+00:00 app[web.1]: Request: GET /users/
2018-07-24T15:24:51.141286+00:00 app[web.1]: ** (exit) an exception was raised:
2018-07-24T15:24:51.141288+00:00 app[web.1]: ** (Postgrex.Error) ERROR 42P01 (undefined_table): relation "users" does not exist
2018-07-24T15:24:51.141290+00:00 app[web.1]: (ecto) lib/ecto/adapters/sql.ex:431: Ecto.Adapters.SQL.execute_and_cache/7
2018-07-24T15:24:51.141293+00:00 app[web.1]: (ecto) lib/ecto/repo/queryable.ex:37: Ecto.Repo.Queryable.all/4
2018-07-24T15:24:51.141291+00:00 app[web.1]: (ecto) lib/ecto/repo/queryable.ex:133: Ecto.Repo.Queryable.execute/5
2018-07-24T15:24:51.141296+00:00 app[web.1]: (babble) web/controllers/user_controller.ex:1: Babble.UserController.action/2
2018-07-24T15:24:51.141294+00:00 app[web.1]: (babble) web/controllers/user_controller.ex:9: Babble.UserController.index/2
2018-07-24T15:24:51.141298+00:00 app[web.1]: (babble) web/controllers/user_controller.ex:1: Babble.UserController.phoenix_controller_pipeline/2
2018-07-24T15:24:51.141300+00:00 app[web.1]: (babble) lib/babble/endpoint.ex:1: Babble.Endpoint.instrument/4
2018-07-24T15:24:51.141301+00:00 app[web.1]: (phoenix) lib/phoenix/router.ex:278: Phoenix.Router.__call__/1
2018-07-24T15:24:51.141058+00:00 heroku[router]: at=info method=GET path="/users/" host=babble.herokuapp.com request_id=3050187a-d2b0-4d3b-ab63-099fa3034bd2 fwd="76.119.187.206" dyno=web.1 connect=1ms service=7ms status=500 bytes=435 protocol=https
2018-07-24T15:24:51.377263+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=babble.herokuapp.com request_id=fe75e79b-cffb-43c9-92d1-fa77be068d25 fwd="76.119.187.206" dyno=web.1 connect=1ms service=1ms status=200 bytes=1515 protocol=https
2018-07-24T15:24:52.031845+00:00 app[web.1]: 15:24:52.031 request_id=ddfc0a4d-cd58-4b86-945b-2af189138676 [info] Sent 500 in 3ms
2018-07-24T15:24:52.028691+00:00 app[web.1]: 15:24:52.028 request_id=ddfc0a4d-cd58-4b86-945b-2af189138676 [info] GET /users/
2018-07-24T15:24:52.033156+00:00 app[web.1]: 15:24:52.033 [error] #PID<0.453.0> running Babble.Endpoint terminated
2018-07-24T15:24:52.033159+00:00 app[web.1]: Server: babble.herokuapp.com:80 (http)
2018-07-24T15:24:52.033161+00:00 app[web.1]: Request: GET /users/
2018-07-24T15:24:52.033163+00:00 app[web.1]: ** (exit) an exception was raised:
2018-07-24T15:24:52.033166+00:00 app[web.1]: (ecto) lib/ecto/adapters/sql.ex:431: Ecto.Adapters.SQL.execute_and_cache/7
2018-07-24T15:24:52.033164+00:00 app[web.1]: ** (Postgrex.Error) ERROR 42P01 (undefined_table): relation "users" does not exist
2018-07-24T15:24:52.033176+00:00 app[web.1]: (babble) lib/babble/endpoint.ex:1: Babble.Endpoint.instrument/4
2018-07-24T15:24:52.033168+00:00 app[web.1]: (ecto) lib/ecto/repo/queryable.ex:133: Ecto.Repo.Queryable.execute/5
2018-07-24T15:24:52.033173+00:00 app[web.1]: (babble) web/controllers/user_controller.ex:1: Babble.UserController.action/2
2018-07-24T15:24:52.033169+00:00 app[web.1]: (ecto) lib/ecto/repo/queryable.ex:37: Ecto.Repo.Queryable.all/4
2018-07-24T15:24:52.033171+00:00 app[web.1]: (babble) web/controllers/user_controller.ex:9: Babble.UserController.index/2
2018-07-24T15:24:52.033174+00:00 app[web.1]: (babble) web/controllers/user_controller.ex:1: Babble.UserController.phoenix_controller_pipeline/2
2018-07-24T15:24:52.033178+00:00 app[web.1]: (phoenix) lib/phoenix/router.ex:278: Phoenix.Router.__call__/1
2018-07-24T15:24:52.032883+00:00 heroku[router]: at=info method=GET path="/users/" host=babble.herokuapp.com request_id=ddfc0a4d-cd58-4b86-945b-2af189138676 fwd="76.119.187.206" dyno=web.1 connect=1ms service=5ms status=500 bytes=435 protocol=https
2018-07-24T15:24:52.277823+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=babble.herokuapp.com request_id=7a0e0a5e-e99a-4743-b37f-e825945c5d0c fwd="76.119.187.206" dyno=web.1 connect=1ms service=2ms status=200 bytes=1515 protocol=https
2018-07-24T15:26:10.049266+00:00 heroku[router]: at=info method=GET path="/" host=babble.herokuapp.com request_id=8c17ba65-ccc4-4398-be06-7ce8f34ff5de fwd="76.119.187.206" dyno=web.1 connect=1ms service=3ms status=200 bytes=2176 protocol=https
2018-07-24T15:26:10.048117+00:00 app[web.1]: 15:26:10.048 request_id=8c17ba65-ccc4-4398-be06-7ce8f34ff5de [info] Sent 200 in 765µs
2018-07-24T15:26:10.047760+00:00 app[web.1]: 15:26:10.047 request_id=8c17ba65-ccc4-4398-be06-7ce8f34ff5de [info] GET /

Also, app works locally.

have you done the db migrations on heroku?

3 Likes

Oh my gosh!
I did heroku run mix ecto.migrate and it works now!
Thank you all!

3 Likes