quiqupltd / ueberauth_token

UeberauthToken is a library which helps validate an oauth2 token received by the resource server. The token should be validated against the authorization server and an ueberauth struct constructed.
MIT License
6 stars 3 forks source link

undefined function 'Elixir.Logger':info #15

Closed IanVaughan closed 6 years ago

IanVaughan commented 6 years ago

I introduced this error while fixing #8, but its not any worse than it was, just a different crash now!

11:48:46.532 [error] GenServer :ueberauth_token_worker_oauth2_token_adapters_quiqup terminating
** (UndefinedFunctionError) function Logger.info/1 is undefined or private. However there is a macro with the same name and arity. Be sure to require Logger if you intend to invoke this macro
    (logger) Logger.info("worker ueberauth_token_worker_oauth2_token_adapters_quiqup with process_id #PID<0.1564.0> terminated, {#Reference<0.3335495774.3294363651.92180>, %{provider: Oauth2Token.Adapters.Quiqup}},\nmodule: UeberauthToken.Worker,\nfunction: {:terminate, 2},\nline: 89\n\n")
    (ueberauth_token) lib/ueberauth_token/worker.ex:92: UeberauthToken.Worker.terminate/2
    (stdlib) gen_server.erl:648: :gen_server.try_terminate/3
    (stdlib) gen_server.erl:833: :gen_server.terminate/10
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: :timeout

=CRASH REPORT==== 18-Sep-2018::11:48:46 ===
  crasher:
    initial call: Elixir.UeberauthToken.Worker:init/1
    pid: <0.1564.0>
    registered_name: ueberauth_token_worker_oauth2_token_adapters_quiqup
    exception error: undefined function 'Elixir.Logger':info/1
      in function  'Elixir.UeberauthToken.Worker':terminate/2 (lib/ueberauth_token/worker.ex, line 92)
      in call from gen_server:try_terminate/3 (gen_server.erl, line 648)
      in call from gen_server:terminate/10 (gen_server.erl, line 833)
    ancestors: ['Elixir.UeberauthToken.Supervisor',<0.1554.0>]
    message_queue_len: 0
    messages: []
    links: [<0.1555.0>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 1598
    stack_size: 27
    reductions: 3285
  neighbours:
11:48:46.532 [warning] lager_error_logger_h dropped 79 messages in the last second that exceeded the limit of 50 messages/sec

=SUPERVISOR REPORT==== 18-Sep-2018::11:48:46 ===
     Supervisor: {local,'Elixir.UeberauthToken.Supervisor'}
     Context:    child_terminated
     Reason:     {undef,
                     [{'Elixir.Logger',info,
                          [<<"worker ueberauth_token_worker_oauth2_token_adapters_quiqup with process_id #PID<0.1564.0> terminated, {#Reference<0.3335495774.3294363651.92180>, %{provider: Oauth2Token.Adapters.Quiqup}},\nmodule: UeberauthToken.Worker,\nfunction: {:terminate, 2},\nline: 89\n\n">>],
                          []},
                      {'Elixir.UeberauthToken.Worker',terminate,2,
                          [{file,"lib/ueberauth_token/worker.ex"},{line,92}]},
                      {gen_server,try_terminate,3,
                          [{file,"gen_server.erl"},{line,648}]},
                      {gen_server,terminate,10,
                          [{file,"gen_server.erl"},{line,833}]},
                      {proc_lib,init_p_do_apply,3,
                          [{file,"proc_lib.erl"},{line,247}]}]}
     Offender:   [{pid,<0.1564.0>},
                  {id,'Elixir.UeberauthToken.Worker'},
                  {mfargs,
                      {'Elixir.UeberauthToken.Worker',start_link,
                          [[{provider,
                                'Elixir.Oauth2Token.Adapters.Quiqup'}]]}},
                  {restart_type,permanent},
                  {shutdown,5000},
                  {child_type,worker}]

11:48:46.532 [error] gen_server ueberauth_token_worker_oauth2_token_adapters_quiqup terminated with reason: call to undefined function 'Elixir.Logger':info/1 from 'Elixir.UeberauthToken.Worker':terminate/2 line 92
11:48:46.539 [error] CRASH REPORT Process ueberauth_token_worker_oauth2_token_adapters_quiqup with 0 neighbours crashed with reason: call to undefined function 'Elixir.Logger':info(<<"worker ueberauth_token_worker_oauth2_token_adapters_quiqup with process_id #PID<0.1564.0> termi...">>)
11:48:46.540 [error] Supervisor 'Elixir.UeberauthToken.Supervisor' had child 'Elixir.UeberauthToken.Worker' started with 'Elixir.UeberauthToken.Worker':start_link([{provider,'Elixir.Oauth2Token.Adapters.Quiqup'}]) at <0.1564.0> exit with reason call to undefined function 'Elixir.Logger':info(<<"worker ueberauth_token_worker_oauth2_token_adapters_quiqup with process_id #PID<0.1564.0> termi...">>) in context child_terminated
IanVaughan commented 6 years ago

This can be seen locally with this changes to config/config.exs

-   background_checks: {:system, :boolean, "TEST_BACKGROUND_CHECKS", false},
-   background_frequency: {:system, :integer, "TEST_BACKGROUND_FREQUENCY", 120},
+   background_checks: {:system, :boolean, "TEST_BACKGROUND_CHECKS", true},
+   background_frequency: {:system, :integer, "TEST_BACKGROUND_FREQUENCY", 1},
$ iex -S mix
11:59:19.232 [error] GenServer :ueberauth_token_worker_ueberauth_token_test_provider terminating
** (UndefinedFunctionError) function Logger.warn/1 is undefined or private. However there is a macro with the same name and arity. Be sure to require Logger if you intend to invoke this macro
    (logger) Logger.warn("worker ueberauth_token_worker_ueberauth_token_test_provider with process_id #PID<0.183.0> terminated, {#Reference<0.3355519748.3511681025.46542>, %{provider: UeberauthToken.TestProvider}},\nmodule: UeberauthToken.Worker,\nfunction: {:terminate, 2},\nline: 89\n\n")
    (ueberauth_token) lib/ueberauth_token/worker.ex:92: UeberauthToken.Worker.terminate/2
    (stdlib) gen_server.erl:648: :gen_server.try_terminate/3
    (stdlib) gen_server.erl:833: :gen_server.terminate/10
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: :timeout

@stephenmoloney would have an idea on how to solve this? Cheers