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.