3
votes

1. When I'm trying to run my app using:

# ./rebar clean compile generate
# rel/master/bin/master console

I'm getting the following error:

application: app_name
exited:{shutdown,{app_name}, start, [normal, []]}}
type:permanent
{"kernel pid terminated", application_controler, "{application_start_failure,app_name 
..........

So I can't start my application.

2. Moreover, right after builing release

# rel.... start
# rel.... stop

Will cause error: "Node [email protected] not responding to pings"

While

# rel.... stop <- the same error as above
# rel.... start
# rel.... stop <- is fine (outputs "ok")

App structure:

deps ebin rebar rebar.config src rel

rebar.config

{erl_first_files, []}.
{cover_enabled, true}.
{erl_opts, [debug_info]}.
{sub_dirs, ["rel"]}.
{deps_dir, ["deps]}.
{deps, [some_stable_modules_from_github]}.

reltool.config (from rel folder)

{sys, [
     {lib_dirs, ["../..", "../deps"]},
     {rel, "master", "1",
        [app_name, 
         kernel,
         stdlib,
         stdlib,
         sasl,
         some_stable_modules]},
     {rel, "start_clean", "", [kernel, stdlib]},
     {boot_rel, "master"},
     {profile, embedded},
     {excl_sys_filters, ["^bin/.*", "^erts.*/bin/{dialyzer|typer)"])},
     {app, sasl, ["incl_cond", include]},
     {app, hipe, ["incl_cond", exclude]},
     {app, some_stable_module, ["incl_cond", include]},
     {app, master, ["incl_cond", include]}
   ]}.

{target_dir, "master"}.

{overlay, [
          {mkdir, "log/sasl"},
          {copy, "files/erl", "\{\{erts_vsn\}\}/bin/erl"},
          {copy, "files/nodetool", "\{\{erts_vsn\}\}/bin/nodetool"},
          {copy, "files/master", "bin/master"},
          {copy, "files/app.config", "etc/app.config"},
          {copy, "files/vm.args", "etc/vm.args"}
          ]}.

Two questions:

  1. Why I can start my application using rel/master/bin/master console?

  2. Why I'm getting "node is not responding to pings" error?

thanks!

PS. In general it's a basic application which is created using rebar. I just added a couple modules to work with mongodb.

1
I'm not sure that you are aware that you cut away the actual error message. It would have helped to see what error you get with regards to app_name. - Daniel Luna

1 Answers

1
votes

From your reltool.config, it looks like the app_name application is not included in the release. Please ensure that:

{app, app_name, ["incl_cond", include]},

is there. If that doesn't help, try to start your application manually. For example:

erl -pa ebin deps/whatever/ebin ...
> application:start(app_name).

That should give you a hint of what's wrong/missing in the release.

UPDATE: If you cannot start your application manually try and debug it. Assuming that you start a root supervisor in your application module, what happens if you start the supervisor manually? Could you post your .app/.app.src file? The start function from your application module? The eventual start_link function from your supervisor?

PS: You have two "stdlib" entries in your reltool.config