Uncaught exception leads to no process: the process is not alive?




I spent some time to find what was the problem, I was getting the following error while running “mix phx.server”:

** (exit) exited in: GenServer.call(Mix.ProjectStack, {:get_and_update, #Function<14.5643525/1 in Mix.ProjectStack.printable_app_name/0>}, 30000)
    ** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started

No idea what could be the real issue. Also, it outputs an erl_dump which I could not honestly do anything with it using crashdump_viewer.

After some digging I found that I was missing the PORT env variable, by launching it via the shell:

iex(2)> Application.ensure_all_started(:traceify)
    {:failed_to_start_child, TraceifyWeb.Endpoint,
     {%RuntimeError{message: "expected the PORT environment variable to be set"},
        {TraceifyWeb.Endpoint, :init, 2,
         [file: 'lib/traceify_web/endpoint.ex', line: 50]},

I should have received that error, instead of a general “no process: the process is not alive or there’s no process currently” to quickly be aware of the issue. Maybe I am missing something (I am an Elixir “newbie”), thus.