(Mix) Could not start application poolboy_py_elixir: PoolboyPyElixir.Application.start(:normal, []) returned an error: shutdown: failed to start child: :square_worker
** (EXIT) an exception was raised:
** (MatchError) no match of right hand side value:
{:error, {:EXIT, {:undef, [{PoolboyPyElixir.SquareWorker, :start_link, [[]], []}, {:supervisor, :do_start_child_i, 3, [file: 'supervisor.erl', line: 414]}, {:supervisor, :handle_call, 3, [file: 'supervisor.erl', line: 439]},
{:gen_server, :try_handle_call, 4, [file: 'gen_server.erl', line: 721]},
{:gen_server, :handle_msg, 6, [file: 'gen_server.erl', line: 750]},
{:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 226]}]}}}
The sample repo’s application.ex
is here .
I am trying to follow this post .
This is first time trying to understand poolboy. Any help is appreciated.
krstfk
February 22, 2022, 4:00pm
2
It’s probably because the start_link
in your SquareWorker
module expect 0 argument while the supervisor starting the process expects 1 argument.
2 Likes
that is not obvious from the error, right?
krstfk
February 22, 2022, 5:36pm
4
Well, it’s not really obvious, but when you see that after the error:
TwistingTwists:
{:undef, [{PoolboyPyElixir.SquareWorker, :start_link, [[]], []}
You see that something is undefined, and if you know about the mfa notation (module, function, arguments), namely PoolboyPyElixir.SquareWorker
is the module, :start_link
is the function, and [[]]
are the arguments (one arg of empty list), it starts to make sense. Especially if you keep in my that in Erlang/Elixir, the arity of a function is part of its signature.
2 Likes
thanks for insight on reading the error message. Kudos for the acronym mfa
.
This helps me become 1% better debugger.
1 Like