How to diagnose IEx.pry breakpoint process shutting down: shell process exited with reason: shutdown


I’ve recently started work on a phoenix API, and am trying to debug using require IEx; IEx.pry.

Whenever I reach a breakpoint and hit ‘Y’ to start the interactive shell, after 1-2 seconds I receive:

Request to pry #PID<0.4584.0> at Web.Controller.create/3 (lib/bla..)
   20:   def create(conn, params, %{current_user: user}) do
   21:     require IEx; IEx.pry

Allow? [Yn] Y

Interactive Elixir (1.10.3) - press Ctrl+C to exit (type h() ENTER for help)
** (EXIT from #PID<0.4584.0>) shell process exited with reason: shutdown

I appreciate there’s no way for any of you to tell me why this is happening with the info I’ve given, but I’d like to know how I can try and investigate the issue? Is there any way of following a stack trace or getting some explanation?

Thanks in advance

Hello Mark,

I think this post has hint on how to diagnose this case : How to extend the Pry/Debugger timeout in Phoenix (shell process exited with reason: shutdown).

1-2 seconds looks short. What client do you use?
Server has its own timeout, default is 60s.


@MarkMekhaiel – I agree with @thenrio, it sounds similar to the issue I faced. I was the one who posted the issue that @thenrio references.

My basic process was:

  • Read the Phoenix/Cowboy docs and confirmed that my Phoenix/Elixir/Cowboy configs was OK (nothing obviously wrong)
  • Discovered that my React client had a timeout of 60s
    • Easy test: when I changed the React/Apollo client timeout, my IEx session lasted longer.
    • Deeper dive: open up an erlang debugger (detailed in the link), and saw that cowboy got an error ‘The socket has been closed.’, which suggested that the client (React, or whatever) was closing the link.