Jeremy Raymond
Jeremy Raymond

Reputation: 6027

How to determining why an Erlang application is not starting?

I'm trying to start an Erlang app that is failing. All I see in the shell is:

=INFO REPORT==== 7-Jan-2010::17:37:42 ===
    application: ui
    exited: {shutdown,{ui_app,start,[normal,[]]}}
    type: temporary

How can I get Erlang to give me more information as to why the application is not starting? There currently is no other output in the shell.

Upvotes: 5

Views: 1367

Answers (3)

legoscia
legoscia

Reputation: 41568

There is a patch (tp/supervisor-pass-on-errors) that was included in release R16B. This patch makes exit reasons appear in application stop log messages, which thus become much more useful than the {shutdown,{ui_app,start,[normal,[]]}}-style messages we've had until now.

This is the entry in the README:

OTP-10490  == stdlib ==

    If a child process fails in its start function, then the
    error reason was earlier only reported as an error report
    from the error_handler, and supervisor:start_link would only
    return {error,shutdown}. This has been changed so the
    supervisor will now return {error,{shutdown,Reason}}, where
    Reason identifies the failing child and its error reason.
    (Thanks to Tomas Pihl)

Upvotes: 2

Gordon Guthrie
Gordon Guthrie

Reputation: 6264

It is a pain, but the way I do it is the old fashioned way, by writing io:format's into the start function of the application (ie the code of the module with the behaviour of application) and working out which line fails :(

Sometimes brute force and ignorance is your only man...

Upvotes: 0

jldupont
jldupont

Reputation: 96726

You could try launching the shell with more logging support:

erl -boot start_sasl

this might get give a bit more details.

Upvotes: 13

Related Questions