pentacent / keila

Open Source Newsletter Tool.
https://keila.io
GNU Affero General Public License v3.0
1.38k stars 70 forks source link

(Plug.Conn.NotSentError) a response was neither set nor sent from the connection #313

Open almereyda opened 3 months ago

almereyda commented 3 months ago

There were repeating unhandled exceptions in our log, which also didn't surface anywhere near an administrator backend.

14:24:27.655 [error] #PID<0.83010.0> running KeilaWeb.Endpoint (connection #PID<0.81100.0>, stream id 7) terminated
Server: keila.example.com:80 (http)
Request: GET /unsubscribe/np_X4V8agWa/nmr_9xLe8ngB/MTBVV3JlSF
** (exit) an exception was raised:
    ** (Plug.Conn.NotSentError) a response was neither set nor sent from the connection
        (phoenix 1.6.11) lib/phoenix/endpoint/cowboy2_handler.ex:80: Phoenix.Endpoint.Cowboy2Handler.maybe_send/2
        (phoenix 1.6.11) lib/phoenix/endpoint/cowboy2_handler.ex:55: Phoenix.Endpoint.Cowboy2Handler.init/4
        (cowboy 2.10.0) /deps/cowboy/src/cowboy_handler.erl:37: :cowboy_handler.execute/2
        (cowboy 2.10.0) /deps/cowboy/src/cowboy_stream_h.erl:306: :cowboy_stream_h.execute/3
        (cowboy 2.10.0) /deps/cowboy/src/cowboy_stream_h.erl:295: :cowboy_stream_h.request_process/3
        (stdlib 5.2.3) proc_lib.erl:241: :proc_lib.init_p_do_apply/3

These should probably be turned into a proper error message.

wmnnd commented 3 months ago

Thank you for reporting this. When a contact no longer exists, this should show a 404 error instead of giving this 500 error.