erlware / relx

Sane, simple release creation for Erlang
http://erlware.github.io/relx
Apache License 2.0
697 stars 232 forks source link

application(s) in release built by relx fail to start #451

Closed sadovski closed 7 years ago

sadovski commented 8 years ago

First of all I apologize for my ignorance...

After successful release generation with relx 3.13.0 I tried to test the release by:

bgu-flower/_rel/flower/bin/flower console

Got a crash...

Exec: /home/akivas/bgu-flower/_rel/flower/erts-7.0/bin/erlexec -boot /home/akivas/bgu-flower/_rel/flower/releases/A/flower -mode embedded -boot_var ERTS_LIB_DIR /home/akivas/bgu-flower/_rel/flower/erts-7.0/../lib -config /home/akivas/bgu-flower/_rel/flower/releases/A/sys.config -args_file /home/akivas/bgu-flower/_rel/flower/releases/A/vm.args -- console Root: /home/akivas/bgu-flower/_rel/flower /home/akivas/bgu-flower/_rel/flower Erlang/OTP 18 [erts-7.0] [source-4d83b58] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]

=INFO REPORT==== 23-Feb-2016::16:28:01 === application: vrrpd_mon exited: {bad_return, {{vrrpd_mon,start,[normal,[]]}, {'EXIT', {undef, [{vrrpd_mon,start,[normal,[]],[]}, {application_master,start_it_old,4, [{file,"application_master.erl"}, {line,273}]}]}}}} type: permanent Eshell V7.0 (abort with ^G) (flower@lubuntu-VirtualBox)1> {"Kernel pid terminated",application_controller,"{application_start_failure,vrrpd_mon,{bad_return,{{vrrpd_mon,start,[normal,[]]},{'EXIT',{undef,[{vrrpd_mon,start,[normal,[]],[]},{application_master,start_it_old,4,[{file,\"application_master.erl\"},{line,273}]}]}}}}}"}

Crash dump is being written to: erl_crash.dump...done Kernel pid terminated (application_controller) ({application_start_failure,vrrpd_mon,{bad_return,{{vrrpd_mon,start,[normal,[]]},{'EXIT',{undef,[{vrrpd_mon,start,[normal,[]],[]},{application_master,s

I almost sure that I missed something and the issue is well known. However I failed to find anything similar to my problem among opened&closed issues.

The relx.config files is rather straightforward:

%% -- mode: Erlang; fill-column: 80; comment-column: 75; -- {release, {"flower", "A"}, [gen_listener_tcp, flower, regine, vrrpd_mon]}.

{extended_start_script, true}.

.app file of the application that failed is also standard:

vrrpd_mon/ebin/vrrpd_mon/vrrpd_mon.app:

{application, vrrpd_mon, [{description,"Interface to VRRP daemon - reacts to VRRP state changes"}, {vsn,"1.0.0"}, {registered,[]}, {applications,[kernel,stdlib]}, {mod,{vrrpd_mon_app,[]}}, {env,[]}, {modules,[vrrpd_mon]}] }.

My gut feeling is that the script makes attempt to run vrrpd_mon:start() instead of vrrpd_mon_app:start()...

Will be grateful for any help

tsloughter commented 8 years ago

Hm, are you positive the vrrpd_mon.app in _rel is the same? It definitely thinks that it has {mod,{vrrpd_mon,[]}} instead of vrrpd_mon-app.

sadovski commented 8 years ago

Yep. I checked vrrpdmon.app in _rel - it is the same. Can be started by application:start(vrrpd_mon).

tsloughter commented 8 years ago

Hm, Odd. Can you share the code on github so I can try it myself?

sadovski commented 8 years ago

Hi Tristan, the code is on github: https://github.com/sadovski/bgu-flower This is an earlier version, but is good enough for experiments

tsloughter commented 8 years ago

I don't see how you build these apps or the release.

sadovski commented 8 years ago

Sorry, my fault. Now I pushed everything related to release creation as is to github. Applications are built by tetrapak (unfortunately I inherited those mechanisms)

lrascao commented 8 years ago

is this issue still occurring?

sadovski commented 8 years ago

I guess yes. Or there is a new relx version around?

2016-09-30 2:38 GMT+03:00 Luis Rascão notifications@github.com:

is this issue still occurring?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/erlware/relx/issues/451#issuecomment-250622286, or mute the thread https://github.com/notifications/unsubscribe-auth/AKlTahgOGZFh6sN4y5uHPBn-CRM8xGNiks5qvEv-gaJpZM4Hg0FD .

lrascao commented 7 years ago

what are the commands needed to build the release?

sadovski commented 7 years ago

Today I downloaded latest Relx from github just to find out that now I need Rebar to build Relx. Unfortunately I am on business trip now and cannot further investigate the issue I reported. I will be back in a week and a half and then will try to reproduce the issue with brand new Relx.

Thank you, Akiva

2016-10-27 1:29 GMT+03:00 Luis Rascão notifications@github.com:

what are the commands needed to build the release?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/erlware/relx/issues/451#issuecomment-256496153, or mute the thread https://github.com/notifications/unsubscribe-auth/AKlTamdo6yzaKZTcSkoIJT9n8KsyFyzMks5q39QzgaJpZM4Hg0FD .

lrascao commented 7 years ago

@sadovski you can use the latest rebar3 nightly, available at https://s3.amazonaws.com/rebar3-nightly/rebar3

sadovski commented 7 years ago

Good idea, thanks. Will try ASAP.

Akiva

On November 28, 2016, at 12:12 AM, Luis Rascão notifications@github.com wrote:

@sadovski you can use the latest rebar3 nightly, available at https://s3.amazonaws.com/rebar3-nightly/rebar3

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/erlware/relx","title":"erlware/relx","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/erlware/relx"}},"updates":{"snippets":[{"icon":"PERSON","message":"@lrascao in #451: @sadovski you can use the latest rebar3 nightly, available at <a href="https://s3.amazonaws.com/rebar3-nightly/rebar3">https://s3.amazonaws.com/rebar3-nightly/rebar3</a>"}],"action":{"name":"View Issue","url":"https://github.com/erlware/relx/issues/451#issuecomment-263154986"}}}

sadovski commented 7 years ago

Hello Luis, Today I got the latest relx from git (Merge pull request #548) rebuild it (thanks for the link to rebar3), generated a release and tried to run it. Got the same crash as before (see below). I suspect I'm doing something terribly wrong, but cannot figure out what.

akivas@lubuntu-VirtualBox:~/rbgu-flower$ relx ===> Starting relx build process ... ===> Resolving OTP Applications from directories: /usr/lib/erlang/lib /home/akivas/rbgu-flower/gen_listener_tcp/ /home/akivas/rbgu-flower/gen_socket/ /home/akivas/rbgu-flower/regine/ /home/akivas/rbgu-flower/flower /home/akivas/rbgu-flower/vrrpd_mon/ /home/akivas/rbgu-flower/_rel ===> Resolved flower-A ===> Including Erts from /usr/lib/erlang ===> release successfully created!

akivas@lubuntu-VirtualBox:~/rbgu-flower$ _rel/flower/bin/flower console Exec: /home/akivas/rbgu-flower/_rel/flower/erts-7.0/bin/erlexec -boot /home/akivas/rbgu-flower/_rel/flower/releases/A/flower -mode embedded -boot_var ERTS_LIB_DIR /home/akivas/rbgu-flower/_rel/flower/lib -config /home/akivas/rbgu-flower/_rel/flower/releases/A/sys.config -args_file /home/akivas/rbgu-flower/_rel/flower/releases/A/vm.args -pa -- console Root: /home/akivas/rbgu-flower/_rel/flower /home/akivas/rbgu-flower/_rel/flower Erlang/OTP 18 [erts-7.0] [source-4d83b58] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]

=INFO REPORT==== 10-Dec-2016::00:47:16 === application: vrrpd_mon exited: {bad_return, {{vrrpd_mon,start,[normal,[]]}, {'EXIT', {undef, [{vrrpd_mon,start,[normal,[]],[]}, {application_master,start_it_old,4, [{file,"application_master.erl"}, {line,273}]}]}}}} type: permanent Eshell V7.0 (abort with ^G) (flower@lubuntu-VirtualBox)1> {"Kernel pid terminated",application_controller,"{application_start_failure,vrrpd_mon,{bad_return,{{vrrpd_mon,start,[normal,[]]},{'EXIT',{undef,[{vrrpd_mon,start,[normal,[]],[]},{application_master,start_it_old,4,[{file,\"application_master.erl\"},{line,273}]}]}}}}}"}

Crash dump is being written to: erl_crash.dump...done Kernel pid terminated (application_controller) ({application_start_failure,vrrpd_mon,{bad_return,{{vrrpd_mon,start,[normal,[]]},{'EXIT',{undef,[{vrrpd_mon,start,[normal,[]],[]},{application_master,s akivas@lubuntu-VirtualBox:~/rbgu-flower$

sadovski commented 7 years ago

Now, how to build the app: 1) Get code from github (see above) 2) Build tetrapak - the tool to build the rest: 2.1) Go to directory 'tetrapak' 2.2) Run 'make' 3) In the root directory of the project (bgu-flower) run the script: ./build-bgu-flower.sh

lrascao commented 7 years ago

i managed to build with tetrapak (btw, you must the last person on earth using this) but was unable to generate the release with relx, keep getting this:

Failed to solve release:
 Dependency flower is specified as a dependency but is not reachable by the system.
sadovski commented 7 years ago

Hi Luis, i really apologize for driving you crazy... Meanwhile I did the following: 1) Build from scratch Lubuntu VM 2) Downloaded my old bgu-flower from Github 3) Built damned tetrapak 4) Build bgu-flower - no issues 5) Copied relx from another VM 6) Run 'relx' - no issues: akivas@lubuntu-VirtualBox:~/bgu-flower$ relx ===> Starting relx build process ... ===> Resolving OTP Applications from directories: /usr/lib/erlang/lib /home/akivas/bgu-flower/gen_listener_tcp/ /home/akivas/bgu-flower/gen_socket/ /home/akivas/bgu-flower/regine/ /home/akivas/bgu-flower/flower /home/akivas/bgu-flower/vrrpd_mon/ /home/akivas/bgu-flower/_rel ===> Resolved flower-A ===> Including Erts from /usr/lib/erlang ===> release successfully created!

Maybe the root cause of the failure you got is in the global variable ERL_LIBS that I set this way:

akivas@lubuntu-VirtualBox:~/bgu-flower$ echo ${ERL_LIBS} /home/akivas/bgu-flower/gen_listener_tcp/:/home/akivas/bgu-flower/gen_socket/:/home/akivas/bgu-flower/regine/:/home/akivas/bgu-flower/flower:/home/akivas/bgu-flower/vrrpd_mon/

Thanks, Akiva S

lrascao commented 7 years ago

so i guess it's good then?

lrascao commented 7 years ago

closing, please re-open if issue persists