I have a Phoenix app that compiles and builds a production web app cleanly, and runs cleanly on OS X. On Linux, however, while it compiles and builds a production web app cleanly, it crashes. Here is the error I receive when trying to start a release build from the command line:
$ 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
Also note that when run with 'mix phoenix.server' on Linux, it starts and runs fine. So the problem seems to be limited to running a release build. Any ideas? I'm not really sure where to start on this one...
Thanks,
Brad
** (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
--
You received this message because you are subscribed to the Google Groups "phoenix-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phoenix-talk...@googlegroups.com.
To post to this group, send email to phoeni...@googlegroups.com.
Visit this group at https://groups.google.com/group/phoenix-talk.
To view this discussion on the web visit https://groups.google.com/d/msgid/phoenix-talk/4b4c486d-a5b1-4475-863c-59bea0a3d344%40googlegroups.com.
MIX_ENV=prod mix phoenix.server
And everything runs just fine. But when I run this,
rel/brad/bin/brad console
And with "mix phoenix.server" I had no issue either. Only when I started it with ENV= PROD.
MIX_ENV=prod mix phoenix.server
starts cleanly and runs just fine, serving web pages and services, and talking to the database via Ecto without a problem. But when I start the release build of Phoenix with this command:
rel/brad/bin/brad
This is what crashes with the aforementioned error. So it appears the question is what is different about the startup sequences and configuration with mix phoenix.server in PROD and a release, that could cause a problem for Ecto specifically, or generally, the startup of a child process. Thoughts?
Thanks everyone for your help thus far.
I wonder if you can post the differences (if any) that exist for the Repo in config.exs. just the config :my_app, MyApp.Repo, .... part. I'm not sure if this will lead to anything but maybe somebody will spot something.
Can you share your mix.exs in a gist? If it's just the packaged exrm release that fails your problem may be the applications list. exrm will only include in the package dependencies you list there, and that causes all sorts of strange startup errors.
--
You received this message because you are subscribed to the Google Groups "phoenix-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phoenix-talk...@googlegroups.com.
To post to this group, send email to phoeni...@googlegroups.com.
Visit this group at https://groups.google.com/group/phoenix-talk.
To view this discussion on the web visit https://groups.google.com/d/msgid/phoenix-talk/4fe57df4-1f21-48c7-a57b-dbf7dbc01656%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "phoenix-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phoenix-talk...@googlegroups.com.
To post to this group, send email to phoeni...@googlegroups.com.
Visit this group at https://groups.google.com/group/phoenix-talk.
To view this discussion on the web visit https://groups.google.com/d/msgid/phoenix-talk/4fe57df4-1f21-48c7-a57b-dbf7dbc01656%40googlegroups.com.
I believe I may know what the issue is: Poolboy is not included in your release generated by exrm. Do you see poolboy listed in rel/brad/lib ?You'll need dependencies for the release as indicated by this exrm documentation: https://hexdocs.pm/exrm/extra-common-issues.html