Phoenix Server keeps crashing after POST

After doing a POST request to delete my session with Guardian, my phoenix server keeps crashing, even after restarts with the following error:

[error] #PID<0.416.0> running SportsConnected.Endpoint terminated
Server: localhost:4000 (http)
Request: GET /
** (exit) an exception was raised:
    ** (FunctionClauseError) no function clause matching in IO.chardata_to_string/1
        (elixir) lib/io.ex:445: IO.chardata_to_string(nil)
        (elixir) lib/file.ex:95: File.regular?/1
        (plug) lib/plug/debugger.ex:349: Plug.Debugger.get_snippet/2
        (plug) lib/plug/debugger.ex:236: Plug.Debugger.each_frame/4
        (elixir) lib/enum.ex:1325: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
        (plug) lib/plug/debugger.ex:224: Plug.Debugger.frames/2
        (plug) lib/plug/debugger.ex:159: Plug.Debugger.render/6
        (plug) lib/plug/debugger.ex:129: Plug.Debugger.__catch__/5
        (sports_connected) lib/myapp/endpoint.ex:1: MyApp.Endpoint.call/2
        (plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4
        (cowboy) /Users/myapp/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4

To be honest, I have no clue how to solve that and I also couldn’t find anything useful on the web.

My dependencies are the following:

  defp deps do
    [
      {:phoenix, "~> 1.2"},
      {:phoenix_pubsub, "~> 1.0"},
      {:phoenix_ecto, "~> 3.0"},
      {:postgrex, ">= 0.0.0"},
      {:sqlite_ecto2, git: "https://github.com/scouten/sqlite_ecto2", tag: "v2.0.0-dev.8"},
      {:phoenix_html, "~> 2.6"},
      {:phoenix_live_reload, "~> 1.0", only: :dev},
      {:gettext, "~> 0.13"},
      {:cowboy, "~> 1.1"},
      #{:ueberauth, "~> 0.4"},
      #{:ueberauth_identity, "~> 0.2"},
      {:guardian, "~> 0.14"},
      {:canary, git: "https://github.com/philippneugebauer/canary"},
      {:bcrypt_elixir, "~> 0.12"},
      {:comeonin, "~> 4.0"},
      {:gravity, "~> 1.0.0"},
      {:credo, "~> 0.8", only: [:dev, :test]},
      {:dogma, "~> 0.1", only: [:dev, :test]}
   ]
  end

Maybe a restart and/or recompilation fixed the problem. Before other routes did not work anymore which work now again.

For what it’s worth, I’ve encountered problems before which could only be fixed by stopping and restarting the application. Despite recompile/0 succeeding in the iex session, errors would pop up.

I couldn’t reproduce which try actually solved the problem. It just disappeared miraculously as it appeared so that I guessed what solved it.