Errors in Erlang

Ulf Wiger ulf@REDACTED
Mon Apr 17 21:40:51 CEST 2006


Den 2006-04-17 15:50:33 skrev Pupeno <pupeno@REDACTED>:

> =INFO REPORT==== 17-Apr-2006::13:32:43 ===
>     application: fanterlasticfour
>     exited: {shutdown,{fanterlasticfour_app,start,[normal,[]]}}
>     type: temporary
> {error,{shutdown,{fanterlasticfour_app,start,[normal,[]]}}}
>
> it didn't start, but I have no idea where or why it died. How do you  
> proceed when you have something like this ? Or how do I avoid it ?
> Thank you.


This typically means that some process has crashed in its
init function during application start. A good guess
is that the 'shutdown' error code comes from this function
in supervisor.erl:

init_children(State, StartSpec) ->
     SupName = State#state.name,
     case check_startspec(StartSpec) of
         {ok, Children} ->
             case start_children(Children, SupName) of
                 {ok, NChildren} ->
                     {ok, State#state{children = NChildren}};
                 {error, NChildren} ->
                     terminate_children(NChildren, SupName),
                     {stop, shutdown}
             end;
         Error ->
             {stop, {start_spec, Error}}
     end.

But if that's the case, you should get an error report.
As Lennart says, you should make sure to have SASL
running, in order to get all error reports.

Also, on how to avoid it. One tip is to do only what's
absolutely necessary in the init functions. The init
phase during application start is very sensitive, and
any error will terminate your entire application.
You get better error handling once your processes have
been started and are supervised in a normal way.



BR,
Ulf Wiger
-- 
Ulf Wiger



More information about the erlang-questions mailing list