phoenix framework deployment issue

412 views Asked by At

I am trying to deploy a Phoenix app using exrm and conform. Testing the release on local Ubuntu works. But when i run the same on server there is failure. I am not able to understand the exact cause.

{error_logger,{{2016,1,30},{7,45,44}},"Protocol: ~tp: register/listen error: ~tp~n",["inet_tcp",etimedout]} {error_logger,{{2016,1,30},{7,45,44}},crash_report,[[{initial_call,{net_kernel,init,['Argument__1']}},{pid,<0.22.0>},{registered_name,[]},{error_info,{exit,{error,badarg},[{gen_server,init_it,6,[{file,"gen_server.erl"},{line,344}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]}},{ancestors,[net_sup,kernel_sup,<0.10.0>]},{messages,[]},{links,[#Port<0.380>,<0.19.0>]},{dictionary,[{longnames,true}]},{trap_exit,true},{status,running},{heap_size,987},{stack_size,27},{reductions,842}],[]]} {error_logger,{{2016,1,30},{7,45,44}},supervisor_report,[{supervisor,{local,net_sup}},{errorContext,start_error},{reason,{'EXIT',nodistribution}},{offender,[{pid,undefined},{id,net_kernel},{mfargs,{net_kernel,start_link,[['[email protected]',longnames]]}},{restart_type,permanent},{shutdown,2000},{child_type,worker}]}]} {error_logger,{{2016,1,30},{7,45,44}},supervisor_report,[{supervisor,{local,kernel_sup}},{errorContext,start_error},{reason,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}},{offender,[{pid,undefined},{id,net_sup},{mfargs,{erl_distribution,start_link,[]}},{restart_type,permanent},{shutdown,infinity},{child_type,supervisor}]}]} {error_logger,{{2016,1,30},{7,45,44}},crash_report,[[{initial_call,{application_master,init,['Argument__1','Argument__2','Argument__3','Argument__4']}},{pid,<0.9.0>},{registered_name,[]},{error_info,{exit,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}}},{kernel,start,[normal,[]]}},[{application_master,init,4,[{file,"application_master.erl"},{line,134}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]}},{ancestors,[<0.8.0>]},{messages,[{'EXIT',<0.10.0>,normal}]},{links,[<0.8.0>,<0.7.0>]},{dictionary,[]},{trap_exit,true},{status,running},{heap_size,376},{stack_size,27},{reductions,117}],[]]} {error_logger,{{2016,1,30},{7,45,44}},std_info,[{application,kernel},{exited,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}}},{kernel,start,[normal,[]]}}},{type,permanent}]} {"Kernel pid terminated",application_controller,"{application_start_failure,kernel,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}}},{kernel,start,[normal,[]]}}}"}

Crash dump is being written to: erl_crash.dump...Kernel pid terminated (application_controller) ({application_start_failure,kernel,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}}},{k

1

There are 1 answers

2
tkowal On BEST ANSWER

The error reason is usually at the first line of error and crashdump:

{error_logger,{{2016,1,30},{7,45,44}},"Protocol: ~tp: register/listen error: ~tp~n",["inet_tcp",etimedout]}...

({application_start_failure,kernel,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}}}...

During startup there was error while opening listen socket with timeout etimedout. This may be caused by couple of things:

  • your application is already running and you can't open the same port twice,
  • there are firewall restrictions - check iptables especially for port 4369 (Erlang port mapper daemon)
  • your app doesn't have privileges to open that port

iex starts your app with dev environment, while exrm uses prod. Compare your dev and prod settings. Probably there are different ports defined. Try running your app with iex, but with prod environment.

MIX_ENV=prod iex -S mix phoenix.server

Remember that generated release has all the config values evaluated during creation and hardcoded.