I am familiar with building erlang releases with rebar. Now I am trying out packaging releases with relx.
I build the code with erlang.mk. I have a relx.config that lists the applications I want to bundle. The command
./relx -o rel/myrel
succeeds.
However, starting the release fails and crashes:
cd rel
./myrel/bin/myrel console
Exec: /Users/ivan/tmp/rel/myrel/erts-5.9.2/bin/erlexec -boot /Users/ivan/tmp/rel/myrel/releases/1.0.0/myrel -env ERL_LIBS /Users/ivan/tmp/rel/myrel/releases/1.0.0/lib -config /Users/ivan/tmp/rel/myrel/releases/1.0.0/sys.config -args_file /Users/ivan/tmp/rel/myrel/releases/1.0.0/vm.args -- console
Root: /Users/ivan/tmp/rel/myrel
{error_logger,{{2014,2,4},{11,43,6}},supervisor_report,[{supervisor,{local,kernel_sup}},{errorContext,start_error},{reason,{'EXIT',{undef,[{prim_inet,open,[udp,inet],[]},{inet,open,7,[]},{inet_config,set_hostname,0,[]},{inet_config,init,0,[]},{inet_db,start_link,0,[]},{supervisor,do_start_child,2,[]},{supervisor,start_children,3,[]},{supervisor,init_children,2,[]}]}}},{offender,[{pid,undefined},{name,inet_db},{mfargs,{inet_db,start_link,[]}},{restart_type,permanent},{shutdown,2000},{child_type,worker}]}]}
{error_logger,{{2014,2,4},{11,43,6}},std_info,[{application,kernel},{exited,{shutdown,{kernel,start,[normal,[]]}}},{type,permanent}]}
{"Kernel pid terminated",application_controller,"{application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}}"}
Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}})
This looks like the release can't find prim_inet:open/2 - either because its including application hasn't been started, or because it doesn't have the right paths.
I've tried listing inets (and other applications) in relx.config. No effect.
From the relx logs, it seems to know about my erlang libs (in /usr/local/lib/erlang/lib).
Can anyone help me work out what I'm missing and how I can make the above release work?
update: the ERL_LIBS directory above is not created. Meanwhile, the apps I specified are all in myrel/lib/. So something is clearly up.
With thanks and best wishes
Ivan
I have the same problem on R15B03, relx 0.6.0
I noticed that
prim_inet
is placed in/path/to/erlang/lib/erts-[vsn]
(which has no application resource file, so it cannot be specified as a dependency) but relx includes/path/to/erlang/erts-[vsn]
Seems like a bug that we should report it on the relx issue tracker.