Ecto crashing Phoenix on Linux

117 views
Skip to first unread message

Brad O'Hearne

unread,
Feb 28, 2016, 6:22:50 PM2/28/16
to elixir-ecto
Hello, 

I have a Phoenix web app using Ecto which starts / runs fine on OS X when running 'mix phoenix.server', and when running a production build (i.e. both DEV and PROD builds). It also runs fine on Linux when running 'mix phoenix.server' (i.e. just DEV build), but crashes when the production build is run. I am seeing the following error when attempting to start Phoenix: 

$ sudo rel/brad/bin/brad console

Using /home/centos/Apps/Brad/Web/brad/rel/brad/releases/0.0.2/brad.sh
Exec: /home/centos/Apps/Brad/Web/brad/rel/brad/erts-7.2/bin/erlexec -boot /home/centos/Apps/Brad/Web/brad/rel/brad/releases/0.0.2/brad -boot_var ERTS_LIB_DIR /home/centos/Apps/Brad/Web/brad/rel/brad/erts-7.2/../lib -env ERL_LIBS /home/centos/Apps/Brad/Web/brad/rel/brad/lib -config /home/centos/Apps/Brad/Web/brad/rel/brad/running-config/sys.config -pa /home/centos/Apps/Brad/Web/brad/rel/brad/lib/brad-0.0.2/consolidated -args_file /home/centos/Apps/Brad/Web/brad/rel/brad/running-config/vm.args -user Elixir.IEx.CLI -extra --no-halt +iex -- console
Root: /home/centos/Apps/Brad/Web/brad/rel/brad
/home/centos/Apps/Brad/Web/brad/rel/brad
Erlang/OTP 18 [erts-7.2] [source-e6dd627] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]

21:27:46.362 [info] Running Brad.Endpoint with Cowboy using http on port 8080
21:27:46.412 [info] Application brad exited: Brad.start(:normal, []) returned an error: shutdown: failed to start child: Brad.Repo
    ** (EXIT) an exception was raised:
        ** (MatchError) no match of right hand side value: {Ecto.Pools.Poolboy, Brad.Repo.Pool, 5000}
            (ecto) lib/ecto/repo/supervisor.ex:106: Ecto.Repo.Supervisor.init/1
            (stdlib) supervisor.erl:272: :supervisor.init/1
            (stdlib) gen_server.erl:328: :gen_server.init_it/6
            (stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
{"Kernel pid terminated",application_controller,"{application_start_failure,brad,{{shutdown,{failed_to_start_child,'Elixir.Brad.Repo',{{badmatch,{'Elixir.Ecto.Pools.Poolboy','Elixir.Brad.Repo.Pool',5000}},[{'Elixir.Ecto.Repo.Supervisor',init,1,[{file,\"lib/ecto/repo/supervisor.ex\"},{line,106}]},{supervisor,init,1,[{file,\"supervisor.erl\"},{line,272}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,328}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,240}]}]}}},{'Elixir.Brad',start,[normal,[]]}}}"}

Crash dump is being written to: erl_crash.dump...done
Kernel pid terminated (application_controller) ({application_start_failure,brad,{{shutdown,{failed_to_start_child,'Elixir.Brad.Repo',{{badmatch,{'Elixir.Ecto.Pools.Poolboy','Elixir.Brad.Repo.Pool',5000

It appears the problem is associated with trying to start Ecto (Elixir.Brad.Repo). But given that this works in DEV and PROD on OS X and in DEV on Linux, I'm not sure where to start in debugging this. I'm using Ecto 1.0.7 and MongoDB. If there's any ideas, let me know....I'm stumped.

Thanks, 

Brad

Brad O'Hearne

unread,
Feb 28, 2016, 6:50:11 PM2/28/16
to elixir-ecto
Trying to debug this...I have a question about this line in the error output: 

 ** (MatchError) no match of right hand side value: {Ecto.Pools.Poolboy, Clu.Repo.Pool, 5000}

Where is that 5000 coming from? My Ecto.Repo config has a pool_size set to 20...does this number represent something else? 

Brad

moloney...@gmail.com

unread,
Feb 28, 2016, 8:25:06 PM2/28/16
to elixir-ecto
5000 looks like a default timeout in milliseconds. For example starting a supervisor.
Message has been deleted

Brad O'Hearne

unread,
Feb 29, 2016, 8:28:58 AM2/29/16
to elixir-ecto
Does anyone know what is different about starting a Phoenix app in a PROD environment vs. a DEV environment that could cause the above error? Why would this work just fine in DEV but not in PROD? 

Brad

Brad O'Hearne

unread,
Feb 29, 2016, 5:32:20 PM2/29/16
to elixir-ecto
I had been pursuing this on the phoenix-talk list as well. A solution was found via that discussion thread. Anyone interested can read here: 

Reply all
Reply to author
Forward
0 new messages