smpallen99 / coherence

Coherence is a full featured, configurable authentication system for Phoenix
MIT License
1.27k stars 224 forks source link

In POST /sessions: ** (KeyError) key :peer not found in: %Plug.Conn #357

Closed danieljaouen closed 6 years ago

danieljaouen commented 6 years ago

Here's the full error:

[error] #PID<0.488.0> running PhoenixTemplatesWeb.Endpoint (cowboy_protocol) terminated
Server: localhost:4000 (http)
Request: POST /sessions
** (exit) an exception was raised:
    ** (KeyError) key :peer not found in: %Plug.Conn{...}
        (coherence) lib/coherence/services/trackable_service.ex:215: Coherence.TrackableService.last_at_and_ip/2
        (coherence) lib/coherence/services/trackable_service.ex:68: Coherence.TrackableService.track_login/4
        (coherence) lib/coherence/controllers/session_controller.ex:132: Coherence.SessionController.do_lockable/4
        (coherence) lib/coherence/controllers/session_controller.ex:1: Coherence.SessionController.action/2
        (coherence) lib/coherence/controllers/session_controller.ex:1: Coherence.SessionController.phoenix_controller_pipeline/2
        (phoenix_templates) lib/phoenix_templates_web/endpoint.ex:1: PhoenixTemplatesWeb.Endpoint.instrument/4
        (phoenix) lib/phoenix/router.ex:278: Phoenix.Router.__call__/1
        (phoenix_templates) lib/phoenix_templates_web/endpoint.ex:1: PhoenixTemplatesWeb.Endpoint.plug_builder_call/2
        (phoenix_templates) lib/plug/debugger.ex:102: PhoenixTemplatesWeb.Endpoint."call (overridable 3)"/2
        (phoenix_templates) lib/phoenix_templates_web/endpoint.ex:1: PhoenixTemplatesWeb.Endpoint.call/2
        (plug) lib/plug/adapters/cowboy/handler.ex:16: Plug.Adapters.Cowboy.Handler.upgrade/4
        (cowboy) /Users/dan/src/phoenix_templates/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4
andreaseriksson commented 6 years ago

Same issue after upgrading to Phoenix 1.3.3 and Plug 1.6.0

general-CbIC commented 6 years ago

+1 with Plug 1.6.0

UPD Fixed by freezing {:plug, "1.5.0"} in deps. But would be great to avoid this lame :(